Coder Social home page Coder Social logo

roleoroleo / yi-hack_ha_integration Goto Github PK

View Code? Open in Web Editor NEW
198.0 6.0 32.0 319 KB

Home Assistant custom integration for Yi cameras: yi-hack-MStar, yi-hack-Allwinner, yi-hack-Allwinner-v2, yi-hack-v5 and sonoff-hack

License: GNU General Public License v3.0

Python 100.00%
camera rtsp hack custom firmware yi home-assistant custom-component

yi-hack_ha_integration's People

Contributors

andurilll avatar dskvr avatar foxel avatar hcoohb avatar karolksionek avatar leandroissa avatar lukaszp2 avatar mcarbonne avatar mkampff avatar mrmarble avatar roleoroleo avatar thezoker avatar trombik avatar vin-w avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

yi-hack_ha_integration's Issues

error setting up integration

Hi, after install and copy the integration ive got the following error
latest frimware h201

Error setting up entry yi-hack-6023a403226e for yi_hack
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 249, in async_setup
result = await component.async_setup_entry(hass, self) # type: ignore
File "/config/custom_components/yi_hack/init.py", line 48, in async_setup_entry
hass.config_entries.async_update_entry(entry, data={**entry.data, CONF_TOPIC_AI_HUMAN_DETECTION: mqtt[CONF_TOPIC_AI_HUMAN_DETECTION]})
KeyError: 'TOPIC_AI_HUMAN_DETECTION'

Partial functioning

Hi, I have installed the latest version of the integration (HA docker on Synology).

Screenshot 2021-04-25 at 10 35 54

The snapshot is showing correctly. But when opening the stream, it does not load and generates the following error in the logs:

Logger: aiohttp.server
Source: custom_components/yi_hack/camera.py:200
First occurred: 10:30:39 AM (2 occurrences)
Last logged: 10:32:55 AM

Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 74, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 135, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 131, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 498, in get
    return await self.handle(request, camera)
  File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 533, in handle
    return await camera.handle_async_mjpeg_stream(request)
  File "/config/custom_components/yi_hack/camera.py", line 200, in handle_async_mjpeg_stream
    await stream.close()
  File "/usr/local/lib/python3.8/site-packages/haffmpeg/core.py", line 158, in close
    await self._loop.run_in_executor(None, _close)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/usr/local/lib/python3.8/site-packages/haffmpeg/core.py", line 153, in _close
    self._proc.stdin.write(b"q")
BrokenPipeError: [Errno 32] Broken pipe

I have auth setup on my camera

Firmware Version | 0.2.5
Base Version | 8.2.0.0A_201912270941
Model Suffix | y20ga

Speak service error

First of all, thank you for the integration!

However, when using the speak service I get this error:

2021-04-27 21:35:08 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [547890576640] Error handling message: Unknown error
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/decorators.py", line 18, in _handle_async_response
    await func(hass, connection, msg)
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 439, in handle_execute_script
    await script_obj.async_run(context=context)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1200, in async_run
    await asyncio.shield(run.async_run())
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 341, in async_run
    await self._async_step(log_exceptions=False)
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 359, in _async_step
    await getattr(self, handler)()
  File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 559, in _async_call_service_step
    await service_task
  File "/usr/src/homeassistant/homeassistant/core.py", line 1480, in async_call
    task.result()
  File "/usr/src/homeassistant/homeassistant/core.py", line 1515, in _execute_service
    await handler.job.target(service_call)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 583, in handle_service
    await service.entity_service_call(
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 649, in entity_service_call
    future.result()  # pop exception if have
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 692, in async_request_call
    await coro
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 686, in _handle_entity_call
    await result
  File "/config/custom_components/yi_hack/camera.py", line 255, in async_perform_speak
    await self.hass.async_add_executor_job(self._perform_speak, language, sentence)
  File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/yi_hack/camera.py", line 246, in _perform_speak
    if response.json()["error"] == "true":
  File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 900, in json
    return complexjson.loads(self.text, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/simplejson/__init__.py", line 525, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 370, in decode
    obj, end = self.raw_decode(s)
  File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 400, in raw_decode
    return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting ',' delimiter or '}': line 3 column 1 (char 17)

I've tried installing the https://github.com/roleoroleo/yi-hack-utils downloading the .tgz into the SD Card. Then, after uncompressing, copying /bin/nanotts to /home/yi-hack/bin/nanotts and the /usr/* to to /home/yi-hack/usr/* but the is not enough space left. Then, I only copied one language to be able to copy the files. Still, it doesn't work.

Is there anything I am missing or doing wrong?

YIapp "At home" and "Away" modes controlled by Home Assistant / YIHack

Hi,
There is a way, through integration, sensor, MQTT, to send the command "at home" and "not_home" from Home Assistant and have it read to the YI app. It would be handy for creating automations.
I have noticed that the commands that are sent via integration / MQTT are executed, but are not synchronized by HA / YIapp.
Example, if I activate the cam from YIapp, the switch on Home Assistant continues to be disabled
Thanks

Privacy sensor detached from camera

This is a strange issue. In the latest update of the integration, the new privacy sensor appeared (great) but for some reason it is not "attached" to the device.

I will try to explain it better with images.

The integration has one device and nine sensors (that's ok):
image

If I select the device, it shows the sensors attached to the device, it only shows eight sensors, the privacy one isn't there:
image

If I filter for the sensors related with the integration, the privacy sensor is there, there are nine sensors:
image

Adding this plugin to HACS repository

Hello,
I've come accross this great initiative for integrating yi-hack device and HA and I was wondering if there was any plan to integrate this plugin into HACS. It is quite famous in the HA community and allow people to easily find and add non-official plugins to their HA installation. Although the current installation procedure is already quite easy, this would help boosting the popularity of the
plugin. I'm not an expert but I think the integration into HACS repo is usually not that hard. It is described here:
https://hacs.xyz/docs/publish/start
Thanks again for your amazing work roleoroleo.
EDIT:
Looks like I typed too fast, it's already in HACS :D! (For some strange reason it did not appear directly in my list).

Problem with HA

Hi,

I have a problem with this awesome plugin. My stream isn't working. Does someone have something similar?
Webrtc shows me an error:

obraz

GK-200MP2B PTZ issue

So I was able to connect the Sonoff cam, model GK-200MP2B, using the hacked firmware. Using your component I can see 5 entities in the HA (cam, motion detection, motion detection cam, privacy, status). The question is, how to get the PTZ controls? Are they somehow implemented? Or should I try some other approach, like WebRTC and Sonoff LAN?

media player

@roleoroleo can you please put an example and also options we can use in content id and content type?

Guide on how to copy files

Hi to all of you.

Would it be possible to have a link or someone can guide me on how to copy files?

I've created folder "yi-hack" in the root folder of cameras FTP server. Copied nano file so I can use TTS but it doesn't work. Do i need to ssh or there is something else?

Kind regards.

Unknown error occurred

Receiving the above error when setting up the yi-hack configuration via Integrations. MQTT is enabled and I can sub to (and see) my Yi topics via MQTT in HA Integrations. Authenticaion credentials are enabled in the yi-hack interface. RTSP stream can be viewed in VLC. Home assistant log below,

Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
resp = await self._request_handler(request)
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 202, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 144, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 155, in post
return await super().post(request, flow_id)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 63, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 109, in post
result = await self._flow_mgr.async_configure(flow_id, data)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 202, in async_configure
result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 260, in _async_handle_step
result: FlowResult = await getattr(flow, method)(user_input)
File "/config/custom_components/yi_hack/config_flow.py", line 68, in async_step_user
response = await self.hass.async_add_executor_job(get_status, user_input)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/yi_hack/config.py", line 39, in get_status
return response.json()
File "/usr/local/lib/python3.8/site-packages/requests/models.py", line 900, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/local/lib/python3.8/site-packages/simplejson/init.py", line 525, in loads
return _default_decoder.decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 370, in decode
obj, end = self.raw_decode(s)
File "/usr/local/lib/python3.8/site-packages/simplejson/decoder.py", line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Invalid control character '\n' at: line 8 column 18 (char 172)

Motion detection

Congratulations very good integration.

In the motion capture add the date and time, is it possible to increase the size or change the color?

PTZ implementations

Hi,

Wondering how do I add PTZ into webRTC implementations? Yes, my yi have PTZ access. Thanks

Error opening stream rtsp://****:****@192.168.1.170/ch0_1.h264

Hi,

y25ga camera with y25ga_0.2.6 firmware from yi-hack-Allwinner. I have activated only the High profile in RTSP stream but it looks like Home Assistant integration is looking for the Low profile because of the error:

Error opening stream rtsp://:@192.168.1.170/ch0_1.h264

If I enable BOTH profile in the RTSP stream I can see it correctly.

Thanks.

Update this integration

Hi,
how properly to update this ha_integration?
I installed this in previous 0.2.9 version and have 6 cam used.
Can I simply delete folder yi_hack and copy this new one?

Cannot work with Home Assistant 2021.4.4

First, many thanks of your work and I look forward to this custom_component.
Got the error below with new version of hass

2021-04-23 02:46:02 WARNING (MainThread) [homeassistant.util.async_] Detected I/O inside the event loop. This is causing stability issues. Please report issue to the custom component author for yi-hack doing I/O at custom_components/yi-hack/config_flow.py, line 71: response = requests.get("http://" + host + ":" + port + "/cgi-bin/status.json", timeout=5, auth=auth)
2021-04-23 02:46:02 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 119, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 74, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 135, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 131, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 155, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 60, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 107, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 156, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 214, in _async_handle_step
    result: dict = await getattr(flow, method)(user_input)
  File "/config/custom_components/yi-hack/config_flow.py", line 71, in async_step_user
    response = requests.get("http://" + host + ":" + port + "/cgi-bin/status.json", timeout=5, auth=auth)
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 76, in get
    return request('get', url, params=params, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/api.py", line 61, in request
    return session.request(method=method, url=url, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.8/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 699, in urlopen
    httplib_response = self._make_request(
  File "/usr/local/lib/python3.8/site-packages/urllib3/connectionpool.py", line 394, in _make_request
    conn.request(method, url, **httplib_request_kw)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 234, in request
    super(HTTPConnection, self).request(method, url, body=body, headers=headers)
  File "/usr/local/lib/python3.8/http/client.py", line 1255, in request
    self._send_request(method, url, body, headers, encode_chunked)
  File "/usr/local/lib/python3.8/http/client.py", line 1266, in _send_request
    self.putrequest(method, url, **skips)
  File "/usr/local/lib/python3.8/site-packages/urllib3/connection.py", line 214, in putrequest
    return _HTTPConnection.putrequest(self, method, url, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 150, in protected_loop_func
    check_loop()
  File "/usr/src/homeassistant/homeassistant/util/async_.py", line 139, in check_loop
    raise RuntimeError(
RuntimeError: I/O must be done in the executor; Use `await hass.async_add_executor_job()` at custom_components/yi-hack/config_flow.py, line 71: response = requests.get("http://" + host + ":" + port + "/cgi-bin/status.json", timeout=5, auth=auth)
111

Dome U Pro - Switch Motion Tracking

Hi @roleoroleo ,
could you implement the switch for the motion tracking sensor present on the Dome U Pro?

Motion Tracking ON
01 00 00 00 08 00 00 00 0b 40 01 00 04 00 00 00 01 00 00 00

Motion Tracking OFF
01 00 00 00 08 00 00 00 0b 40 01 00 04 00 00 00 00 00 00 00

THANKS!

Stream Freezes within a Few Seconds

As title states, Im having issues with the camera stream in Hass. The integration connects fine (although it fails to get the connection status and times out). I have a feeling that this bears relation to the stream failing. My network is hardwired and the camera has decent wifi connection, so I think it might be related to the integration. Please let me know how I can help provide more info if needed.

Edit: Was finally able to time the error in the log. It says error demuxing stream. Not the slightest clue what that means, but I assume it has something to do with ffmpeg?

Edit2: Completely forgot to note the model camera Im using. Its allwinner V1. Yi cam 1080p. RTSP is set to low quality

Edit 3: I have two cameras that are the same. One is an older version of allwinner and the other is the latest allwinner version. The one with the older version is streaming through onvif just fine. The other one on latest version that was freezing on the yi-hack integration is ALSO freezing with the onvif integration, so Im starting to believe that it is a camera firmware issue and nothing to do with this integration. Should I leave this open or close it?

Initial state of baby crying sensor should not be "on"

@foxel

I think there is a minor bug in the baby crying detection event sensor initial state.

We shouldn't assume the baby crying event is "on" at HASS startup/restart.
The next publish event received with "crying" should indicate "on" instead.

 $ mosquitto_sub -d -t yicam/baby_crying
Client mosqsub|11445-raspberry sending CONNECT
Client mosqsub|11445-raspberry received CONNACK (0)
Client mosqsub|11445-raspberry sending SUBSCRIBE (Mid: 1, Topic: yicam/baby_crying, QoS: 0)
Client mosqsub|11445-raspberry received SUBACK
Subscribed (mid: 1): 0
Client mosqsub|11445-raspberry received PUBLISH (d0, q0, r1, m0, 'yicam/baby_crying', ... (6 bytes))
crying                       ######## this is the value received when subscribed, should NOT consider as baby is crying
Client mosqsub|11445-raspberry sending PINGREQ
Client mosqsub|11445-raspberry received PINGRESP
Client mosqsub|11445-raspberry sending PINGREQ
Client mosqsub|11445-raspberry received PINGRESP
Client mosqsub|11445-raspberry received PUBLISH (d0, q0, r0, m0, 'yicam/baby_crying', ... (6 bytes))
crying                       ######## this is a new baby crying event, make sensor "on" and make it "off" after 60 sec.
Client mosqsub|11445-raspberry sending PINGREQ
Client mosqsub|11445-raspberry received PINGRESP
Client mosqsub|11445-raspberry sending PINGREQ

binary_sensor.yi_hack_XX_baby_crying is now false alarm "on" for 1 min on startup
and wait for _off_delay = 60 to "off"

Can't decode payload 'motion_detection_image'

Hi everybody.

I am running the 0.2.5 yihack AllWinner version. After enable MQTT Discovery in Home Assistant, i have seen my log is full of this message:

Can't decode payload b'\xff\xd8\xff\xe0\x00\x10JFIF\x00\x01\x01\x00\x00\x01\x00\x01\x00\x00\xff\xdb\x00C\x00\x03\x02\x02\x03\x02\x02\x03\x03\x(\x01iGZ0h\x00\xe6\xa4\xb2e\xe9KH\xbd)h\x01\xf4QE\x00:\x8a(\xa0\x07\xd2\x8e\xb4\x94\xa3\xad\x00H:Q@\xa2\x80\x1fN\x03\x14\xd1\xd6\x9f@\x0e\xa2\x8a\\\x1a\x00u\x14Q@\x0f\xa2\x8a(\x00\xa2\x8a(\x00\xa2\x8a+D\x03\xa8\xa2\x8a`\x14QE\x00\x14QE\x00>\x8a(\xeb@\x0f\xa5\x02\x80)i\xa0\n(\xa2\xa8\x05\xc5\x18\xa7Q@\r\xc5\x18\xa7Q@\r\xc5\x18\xa7Q@\x0c\xa2\x8a
...
(\x00\xa2\x8a(\x00\xc5\x04qE\x07\xa5\x00Fz\xd2R\x9e\xb4\x94\x00\xca(\xa2\x80\n(\xa2\x80\n(\xa2\x80\n(\xa2\x80\x1bE\x14P\x03)\x94\xfae\x006\x8a(\xa0\x06PzQA\xe9@\x11\x1e\xb4\x87\xa5)\xebHzP\x04g\xad1\xc8\xda\xe0\x9caI\xa7?\x19\xaa:\xc3y:c\xcb\x9c\x16;?:\x00\xe0u\xf9$\x9e\xd2w\xdd\xcb\x1c\x03\xedX\x1e\x04\xb1[\x9f\x8bZ"' on yicam-salon/motion_detection_image with encoding utf-8 (for <Job HassJobType.Coroutinefunction <function websocket_subscribe.<locals>.forward_messages at 0xa057f2f8>>)

Do you know what the problem could be?

Can't add integration

I followed instructions of install of this component.
When I trying to fill a form with Yi Camera data (address, port, login, password) I received an:
"User input malformed"

Privacy without error logs in Home Assistant

Hi! The new privacy switch is great, I use it a lot, but I've a "cosmetic" problem with it.
When enabled, the Home Assistant log shows a lot of errors because is trying to connect with the camera RTSP or snapshot stream.

2021-09-30 09:14:48 ERROR (stream_worker) [libav.tcp] Connection to tcp://192.168.100.20:554?timeout=5000000 failed: Connection refused
2021-09-30 09:14:48 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream rtsp://****:****@192.168.100.20/ch0_0.h264

Is there a way to tell Home Assistant that the camera image is down, stopped or suspended? In this way it will not try to connect with it I suppose.
Thanks!

Home Assistant complains against width and height support

I have this warning in the Home Assistant logs:

Logger: homeassistant.components.camera
Source: components/camera/__init__.py:465
Integration: Cámara (documentation, issues)
First occurred: 2 de septiembre de 2021 15:14:38 (2 occurrences)
Last logged: 8:03:10

The camera entity camera.pasillo does not support requesting width and height, please open an issue with the integration author
The camera entity camera.camara_pasillo_movimiento_camara does not support requesting width and height, please open an issue with the integration author

I think this is related with the new version 2021.9.0:

Thanks to @bdraco, camera images can now be scaled to a resolution that fits the device/screen you are looking at; Additionally, they only update when visible. This makes cameras usable in any bandwidth situation.

Unable to get mac address or serial number from device

I own a Sonoff GK-200MP2B webcam with Sonoff-hack with IP 192.168.1.161.

After adding the integration, at the first dialog when I try to enter:

  • IP: 192.168.1.161
  • port: 8080
  • username:
  • password:
  • ffmpeg parameters: -rtsp_transport tcp

my entries are not accepted and a blank form is shown.
In the log of Home Assistant i see:
"Unable to get mac address or serial number from device 192.168.1.161"

IP is correct and the URL http://:@192.168.1.161:8080 is working properly.

Thank you for any advice

yi_hack integration install

Hi there, thank you for all the hard work maintaining this project. I got my camera flashed successfully, and now I am trying to install the custom integration, but I get the same error message over and over after reboot.

The following integrations and platforms could not be set up:
yi_hack
Please check your config and logs.

Log:
Logger: homeassistant.setup
Source: setup.py:138
First occurred: 20:41:12 (1 occurrences)
Last logged: 20:41:12
Setup failed for yi_hack: No setup function defined.

Also, no entities are created.

What can i do to fix this error?

How to configure mqtt binary sensors?

How can I configure the binary sensors to match my mqtt topics?

I made my own topics from my camera, they look like cams/<cam>/motion_detected and so on... and need to configure the binary sensors created by this integration, but cannot find any example anywhere on how to do it

Error - Config flow could not be loaded

Hi @roleoroleo

(3) Configure device and entities:

Go to Settings -> Integrations
Click "Add Integration" in the lower-right corner
Select "Yi Cam with yi-hack" integration

I am trying to follow the instructions, so after the above steps, the following error appears.

image

I am running HA as the container on QNAP with a dedicated config folder.

HA core-2021.5.1 Compatibility

Hello, is it compatible with core-2021.5.1 version of HA?
I just set it in custom_components , I see in logs a message that tells it's not tested component..
But then I cant call it anywhere... checked in integrations and no Yi object at all..

Any help?

Thanks

Two cameras linked in the same integration

Hello,
I use the h30ga hack for my two Yi Outdoor 1080p IFUS cameras.
I use two differents device name in camera settings (IP:8080)

I add the first one in a new piece, I change the entity name, it's ok.
I add the second in another piece, the two cam are on this same piece, and the two integrations are linked.

There is no problem with my others cam Yi 1080p Home IFUS, there is one integration for each camera.

“Config flow could not be loaded”

after copying to home assistant dir. the integrate cannot load properly “ Config flow could not be loaded”


2021-07-13 13:46:51 WARNING (SyncWorker_0) [homeassistant.loader] We found a custom integration yi_hack which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2021-07-13 13:47:23 ERROR (MainThread) [homeassistant.setup] Setup failed for mqtt: Integration failed to initialize.
2021-07-13 13:47:23 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of yi_hack. Setup failed for dependencies: mqtt
2021-07-13 13:47:23 ERROR (MainThread) [aiohttp.server] Error handling request
Traceback (most recent call last):
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
resp = await self._request_handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_app.py", line 499, in _handle
resp = await handler(request)
File "/usr/local/lib/python3.9/site-packages/aiohttp/web_middlewares.py", line 119, in impl
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 60, in security_filter_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/forwarded.py", line 77, in forwarded_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 24, in request_context_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 78, in ban_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 144, in auth_middleware
return await handler(request)
File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 135, in handle
result = await result
File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 128, in post
return await super().post(request)
File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 63, in wrapper
result = await method(view, request, *args, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 72, in post
result = await self._flow_mgr.async_init(
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 153, in async_init
flow, result = await task
File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 171, in _async_init
flow = await self.async_create_flow(handler, context=context, data=data)
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 693, in async_create_flow
await async_process_deps_reqs(self.hass, self._hass_config, integration)
File "/usr/src/homeassistant/homeassistant/setup.py", line 371, in async_process_deps_reqs
raise HomeAssistantError("Could not set up all dependencies.")
homeassistant.exceptions.HomeAssistantError: Could not set up all dependencies.

Integration not discovering movment

Hi,

I installed this integration in HA (latest hassio) and after login I have new entities available. Unfortunately motion sensor is not working at all - it's always showing no movment.

I sshed into camera and execute mqttv4 and I can see MQTT events for motion_detection without any issue.

CALLBACK MOTION START
Client yi-cam sending PUBLISH (d0, q1, r1, m2, 'yicam/motion_detection', ... (12 bytes))
Starting program
Mapping file /dev/shm/fshare_frame_buf, size 1786156, to b6da5000
Decoding h264 frame
Starting decode
Decode frame
Client yi-cam received PUBACK (Mid: 2)
Writing yuv buffer
Cleaning ffmpeg memory
Adding watermark
Encoding jpeg image
Unmapping file /dev/shm/fshare_frame_buf, size 1786156, from b6da5000
Client yi-cam sending PUBLISH (d0, q1, r1, m3, 'yicam/motion_detection_image', ... (234533 bytes))
Client yi-cam received PUBACK (Mid: 3)
CALLBACK MOTION STOP
Client yi-cam sending PUBLISH (d0, q1, r1, m4, 'yicam/motion_detection', ... (11 bytes))
Client yi-cam received PUBACK (Mid: 4)
CALLBACK MOTION START
Client yi-cam sending PUBLISH (d0, q1, r1, m5, 'yicam/motion_detection', ... (12 bytes))
Starting program
Mapping file /dev/shm/fshare_frame_buf, size 1786156, to b6d72000
Decoding h264 frame
Starting decode
Decode frame
Writing yuv buffer
Client yi-cam received PUBACK (Mid: 5)
Cleaning ffmpeg memory
Adding watermark
Encoding jpeg image
Unmapping file /dev/shm/fshare_frame_buf, size 1786156, from b6d72000
Client yi-cam sending PUBLISH (d0, q1, r1, m6, 'yicam/motion_detection_image', ... (234377 bytes))
Client yi-cam received PUBACK (Mid: 6)
CALLBACK MOTION STOP

Unable to set up dependencies of yi_hack. Setup failed for dependencies: mqtt

First of all, I would like to say thank you for this integration.
Unfortunately on step "Select "Yi Cam with yi-hack" integration" I see an error and in log I see the following

Logger: homeassistant.setup
Source: setup.py:152
First occurred: 22:44:32 (1 occurrences)
Last logged: 22:44:32

Unable to set up dependencies of yi_hack. Setup failed for dependencies: mqtt

Motion detection on MQTTP but not appearing in the motion_sensor in HA

HI,

I'm having aproblem, with 5 cameras and the motion_sensor. I can see the MQTTP packets on HO, but it don't refresh the sensors on HA.

image

I have tried to configure first the mqttp on the cameras and later add them in the integration but nothing, but i'm getting the connect status to work.
image

Even i've tried to use a diferent Topics Prefix for each camera.

P.d works fine! but any other sensor than the offline don't work.

This camera is

Thanks Again!!

Update for switch entity failed

There has been error thrown in log after HA restart (upgraded to 2021.9.0):

2021-09-01 23:02:06 ERROR (MainThread) [homeassistant.helpers.entity] Update for switch.yi_hack_allwinner_7caxxxxx_privacy fails
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 446, in async_update_ha_state
await self.async_device_update()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 649, in async_device_update
await task
File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/yi_hack/switch.py", line 43, in update
self._state = get_privacy(self.hass, self._device_name, conf)
File "/config/custom_components/yi_hack/common.py", line 193, in get_privacy
if response is not None:
UnboundLocalError: local variable 'response' referenced before assignment

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.