Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

isa.camera.hlc6 crashes on hw_ver #33

Closed
marines opened this issue Mar 14, 2021 · 10 comments
Closed

isa.camera.hlc6 crashes on hw_ver #33

marines opened this issue Mar 14, 2021 · 10 comments
Labels
bug Something isn't working device: camera miot-cloud Need enabled miot_cloud

Comments

@marines
Copy link

marines commented Mar 14, 2021

I've just set up a fresh HA instance and I'm trying to integrate the isa.camera.hlc6 camera. I'm running HA in a docker container in host network mode. I've tried the latest stable, latest beta and master branch build of the integration. I'm using Europe Mi servers.

Providing host/token ends up with the following error on initialization:

homeassistant    | 2021-03-14 17:00:38 ERROR (MainThread) [homeassistant.components.camera] Error while setting up xiaomi_miot platform for camera
homeassistant    | Traceback (most recent call last):
homeassistant    |   File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in _async_setup_platform
homeassistant    |     await asyncio.shield(task)
homeassistant    |   File "/config/custom_components/xiaomi_miot/camera.py", line 44, in async_setup_entry
homeassistant    |     await async_setup_config_entry(hass, config_entry, async_setup_platform, async_add_entities, ENTITY_DOMAIN)
homeassistant    |   File "/config/custom_components/xiaomi_miot/__init__.py", line 349, in async_setup_config_entry
homeassistant    |     await async_setup_platform(hass, c, async_add_entities)
homeassistant    |   File "/config/custom_components/xiaomi_miot/camera.py", line 62, in async_setup_platform
homeassistant    |     entities.append(MiotCameraEntity(hass, cfg, srv))
homeassistant    |   File "/config/custom_components/xiaomi_miot/camera.py", line 71, in __init__
homeassistant    |     super().__init__(miot_service, config=config)
homeassistant    |   File "/config/custom_components/xiaomi_miot/__init__.py", line 903, in __init__
homeassistant    |     super().__init__(miot_service, device, **kwargs)
homeassistant    |   File "/config/custom_components/xiaomi_miot/__init__.py", line 538, in __init__
homeassistant    |     super().__init__(name, device, **kwargs)
homeassistant    |   File "/config/custom_components/xiaomi_miot/__init__.py", line 389, in __init__
homeassistant    |     'hardware_version': self._miio_info.hardware_version,
homeassistant    |   File "/usr/local/lib/python3.8/site-packages/miio/device.py", line 84, in hardware_version
homeassistant    |     if self.data["hw_ver"] is not None:
homeassistant    | KeyError: 'hw_ver'

Setting up an integration with Mi Account credentials successfuly adds devices but it shows either that camera is off or there was an error opening stream:

homeassistant    | 2021-03-14 17:09:56 ERROR (MainThread) [homeassistant.components.camera] Error requesting stream: Camera is off
homeassistant    | 2021-03-14 17:13:25 ERROR (stream_worker) [homeassistant.components.stream.worker] Error opening stream https://de01.livestreaming.io.mi.com/hlstranscoder/.../playlist.m3u8

Let me know if I can help fixing this somehow as I cannot use the camera in HA. :(

al-one added a commit that referenced this issue Mar 15, 2021
@al-one al-one added bug Something isn't working device: camera labels Mar 15, 2021
@marines
Copy link
Author

marines commented Mar 17, 2021

Just to add that with the above fix the camera can be added properly but it says that camera is off when trying to view the feed.

@al-one
Copy link
Owner

al-one commented Mar 17, 2021

Get the stream_address from the entity state attributes (Developer tools > State), and test whether it can play through VLC and other players.

@marines
Copy link
Author

marines commented Mar 17, 2021

There is no stream_address attribute. :/

image

@al-one
Copy link
Owner

al-one commented Mar 17, 2021

Before getting the stream address, click on the camera entity dialog, and the stream address is only valid for 5 minutes.

@marines
Copy link
Author

marines commented Mar 17, 2021

I have also tried that before but stream_address didn't show up.

image

@al-one al-one added the miot-cloud Need enabled miot_cloud label Mar 17, 2021
@al-one
Copy link
Owner

al-one commented Mar 17, 2021

The state_updater is lan, do your enable miot_cloud ?

@marines
Copy link
Author

marines commented Mar 17, 2021

Right. Forgot that the camera requires cloud connection. So with cloud connection enabled there is the issue I've described in the first post.

Here's the entity state:

image

The playlist file is accessible by both my PC and HA container and has the following content (except X-es):

#EXTM3U
#EXT-X-VERSION:3
#EXT-X-STREAM-INF:BANDWIDTH=250000
chunklist_w2XXXXXXX1.m3u8

But VLC just spins trying to load the stream.

@lexin8
Copy link

lexin8 commented Mar 19, 2021

Abnormal camera access seems not a case. At present, the plug-in is not well supported!

@al-one al-one closed this as completed Mar 22, 2021
@marines
Copy link
Author

marines commented Mar 22, 2021

@al-one Does that mean it can't be fixed?

@al-one
Copy link
Owner

al-one commented Mar 23, 2021

If the stream address is not available, then I have no idea.
This component only get stream address from xiaomi cloud and generates camera entity proxy to stream address through HA ffmpeg.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working device: camera miot-cloud Need enabled miot_cloud
Projects
None yet
Development

No branches or pull requests

3 participants