GithubHelp home page GithubHelp logo

Comments (57)

fboulange avatar fboulange commented on September 18, 2024 8
  username: xiaomi_username
  password: xiaomi_password
  server_country: fr

Thanks @al-one !

The country FR was not working.
So I've checked that the only European server is Germany and not France therefore what I did is :

  • remove my camera from Xiaomi CN server within Mi Home app
  • Log out / Log in in Mi Home app using France as location (before I used China)
  • Add my camera within Mi Home app so it will be on European server
  • Find out my new camera Token on this Germany (de) server
  • Modifiy my configuration.yaml to server_country: de and using my DE camera token.
  • Restart HA

And voila
image

It is not really smooth but at least I've got a feed !
Now I've got to find out how to use it to send to my Google Nest display :)

from hass-xiaomi-miot.

fboulange avatar fboulange commented on September 18, 2024 1

I checked again and the miot_cloud value was "true" (double quoted)
Then now I've got this debug trace but no feed is displayed neither stilll picture

2021-02-02 18:55:41 DEBUG (SyncWorker_2) [custom_components.xiaomi_miot] Call miot action to CameraJardin Camera Control ({'did': '294068056', 'siid': 5, 'aiid': 1, 'in': [0]}), result: {'did': '294068056', 'miid': 0, 'siid': 5, 'aiid': 1, 'code': 0, 'out': ['https://cn01.livestreaming.io.mi.com/hlstranscoder/XXXXXXXXXXA1MTFmNzQ0MTMwYjVjZThlMDg0ZTEzZDI2OBgKX191bnVzZWRfXwA_H265transH264/playlist.m3u8'], 'exe_time': 0, 'net_cost': 0, 'ot_cost': 0, 'otlocalts': 0, 'oa_cost': 0, '_oa_rpc_cost': 0}

(I changed the value for security measure)

When I copy/paste the https directly in Chome I got e 403 (cn01.livestreaming.io.mi.com access refused)
BTW I'm using CN server but live in France.

[Edit] the loveui card is displaying "Streaming" even if there is nothing
image

[Edit2] BTW your solution for camera does it need to have cloud service registration (payed) linked to our xiaomi account ?

[Edit3] I could ping cn01.livestreaming.io.mi.com without problem (resolved on 42.157.163.230)

Envoi d’une requête 'ping' sur cn01.livestreaming.io.mi.com [42.157.163.230] avec 32 octets de données :
Réponse de 42.157.163.230 : octets=32 temps=265 ms TTL=46

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024 1

@valdi-sudo This component doesn't support your cameras (chuangmi.camera.ipc016 / chuangmi.camera.ipc017), because it doesn't have start-hls-stream or start-rtsp-stream in miot-speg.org.

chuangmi.camera.ipc016
chuangmi.camera.ipc017

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

miot-spec中未发现名为start-hls-streamstart-rtsp-stream的action,因此不支持您的设备。
在我的设备isa.camera.hlc6中是支持的。

图片

from hass-xiaomi-miot.

womeimingzi11 avatar womeimingzi11 commented on September 18, 2024

明白了,我清楚应该查看什么 miot-spec 确认了

from hass-xiaomi-miot.

fboulange avatar fboulange commented on September 18, 2024

Hi, with an "isa.camera.hlc6" camera (firmware_version: 4.0.5_0105) I had to modify the /xiaomi_miot/init.py line 277 as the hardware version was not found (just modify it to 'hardware_version': 'dummy', )

Therefore I was able to see in Home Assistant an entity called "<camera_alias> Camera Control" but without any success to display image.

Should I customized this entity ? You got an example on how to get RSTP ?
Thanks (and congratulations about this MIOT integration)
Fred

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

@fboulange Do you enable miot-cloud?

from hass-xiaomi-miot.

fboulange avatar fboulange commented on September 18, 2024

image
@al-one Yeap I did.

from hass-xiaomi-miot.

TheBisk avatar TheBisk commented on September 18, 2024

Cattura
Same problem for me,i see the entity but with no image.

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

@fboulange @TheBisk I need debug logs of your camera entity.

from hass-xiaomi-miot.

fboulange avatar fboulange commented on September 18, 2024

I use this in my configuration.yaml

camera:

  • platform: xiaomi_miot
    name: camerajardin
    host: 192.168.0.48
    token: 48475874726c4137594e39724c******
    model: isa.camera.hlc6

Here is the debug log

`2021-02-02 09:25:10 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for xiaomi_miot 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-02-02 09:25:10 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs 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-02-02 09:25:23 DEBUG (MainThread) [custom_components.xiaomi_miot] Xiaomi Miot async_setup_entry {'entry_id': '94a21ae99011cd2f1fa05eb992025ec0', 'unique_id': '44:23:7c:e8:XX:XX', 'config': {'host': '192.168.0.48', 'token': '48475874726c4137594e39724cXXXXXX', 'name': 'CameraJardin', 'model': 'isa.camera.hlc6', 'mode': [], 'miot_type': 'urn:miot-spec-v2:device : camera : 0000A01C:isa-hlc6:1', 'miio_info': {'life': 6244, 'model': 'isa.camera.hlc6', 'token': '48475874726c4137594e39724cXXXXXX', 'ipflag': 1, 'miio_ver': '0.0.8', 'mac': '44:23:7C:E8::', 'fw_ver': '4.0.9_0112', 'hw_ver': 'Linux', 'miio_client_ver': '4.0.9', 'VmPeak': 42692, 'VmRSS': 1252, 'MemFree': 1756, 'ap': {'ssid': 'Boulange', 'bssid': '68:A3:78:D4:XX:XX', 'rssi': '-61', 'freq': 0}, 'netif': {'localIp': '192.168.0.48', 'mask': '255.255.255.0', 'gw': '192.168.0.254'}, 'miio_times': [6244, 1, 91, 6142]}, 'config_entry': <homeassistant.config_entries.ConfigEntry object at 0x7463b398>}, 'miio': {'life': 6244, 'model': 'isa.camera.hlc6', 'token': '48475874726c4137594e39724cXXXXXX', 'ipflag': 1, 'miio_ver': '0.0.8', 'mac': '44:23:7C:E8:XX:XX', 'fw_ver': '4.0.9_0112', 'hw_ver': 'Linux', 'miio_client_ver': '4.0.9', 'VmPeak': 42692, 'VmRSS': 1252, 'MemFree': 1756, 'ap': {'ssid': 'Boulange', 'bssid': '68:A3:78:D4:XX:XX', 'rssi': '-61', 'freq': 0}, 'netif': {'localIp': '192.168.0.48', 'mask': '255.255.255.0', 'gw': '192.168.0.254'}, 'miio_times': [6244, 1, 91, 6142]}}

2021-02-02 09:25:24 INFO (MainThread) [custom_components.xiaomi_miot.camera] Initializing CameraJardin Camera Control with host 192.168.0.48 (token 48475...)

2021-02-02 09:25:25 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Miot camera: CameraJardin Camera Control url: None expired: 0

2021-02-02 09:25:25 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Get miot camera stream from lan for CameraJardin Camera Control: {}

2021-02-02 09:26:25 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from CameraJardin Camera Control: {}, updater: lan

2021-02-02 09:27:25 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from CameraJardin Camera Control: {}, updater: lan

2021-02-02 09:28:25 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from CameraJardin Camera Control: {}, updater: lan
`

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

Enable miot_cloud:

# configuration.yaml
homeassistant:
  customize: !include customize.yaml

xiaomi_miot:
  username: xiaomi_username
  password: xiaomi_password

# customize.yaml (Configuration > Customize > Select Entity > Add Other Attribute)
climate.xiaomi_mc5_374e: # Your entity id
  miot_cloud: true       # Enabled cloud

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

"true" is ok.

Add config for xiaomi_miot:

# configuration.yaml

xiaomi_miot:
  username: xiaomi_username
  password: xiaomi_password
  server_country: de

You can use a player such as VLC to play within 5 minutes of generating the stream address.

from hass-xiaomi-miot.

womeimingzi11 avatar womeimingzi11 commented on September 18, 2024

miot-spec中未发现名为start-hls-streamstart-rtsp-stream的action,因此不支持您的设备。
在我的设备isa.camera.hlc6中是支持的。

你好,我手头还有一个小米摄像机云台版 2K,型号是 chuangmi.camera.029a02,当前的插件是不支持该设备的。开启云端,日志提示 -9999

不过我发现,在设备调试助手这个页面中,虽然没有直接俄的 start-hls-stream,但是在 camera-stream-for-google-home 服务中,有 start-hls-stream 方法且在 camera-stream-for-amazon-alexa 服务中,有start-rtsp-stream方法,不知道这个还有没有实现的可能?

Snipaste_2021-02-03_14-48-30

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

你好,我手头还有一个小米摄像机云台版 2K,型号是 chuangmi.camera.029a02,当前的插件是不支持该设备的。开启云端,日志提示 -9999

不过我发现,在设备调试助手这个页面中,虽然没有直接俄的 start-hls-stream,但是在 camera-stream-for-google-home 服务中,有 start-hls-stream 方法且在 camera-stream-for-amazon-alexa 服务中,有start-rtsp-stream方法,不知道这个还有没有实现的可能?

Snipaste_2021-02-03_14-48-30

开启miot_cloud后仍出现-9999是HA刚启动实例还没准备好,所有调用的还是局域网。#5 (comment)

from hass-xiaomi-miot.

womeimingzi11 avatar womeimingzi11 commented on September 18, 2024

你好,我手头还有一个小米摄像机云台版 2K,型号是 chuangmi.camera.029a02,当前的插件是不支持该设备的。开启云端,日志提示 -9999
不过我发现,在设备调试助手这个页面中,虽然没有直接俄的 start-hls-stream,但是在 camera-stream-for-google-home 服务中,有 start-hls-stream 方法且在 camera-stream-for-amazon-alexa 服务中,有start-rtsp-stream方法,不知道这个还有没有实现的可能?
Snipaste_2021-02-03_14-48-30

开启miot_cloud后仍出现-9999是HA刚启动实例还没准备好,所有调用的还是局域网。#5 (comment)

我刚刚重新配置了一次,虽然依然不能用,不过错误代码更新了,具体如下:

2021-02-03 15:29:30 WARNING (SyncWorker_11) [custom_components.xiaomi_miot] Call miot action to 客厅摄像头 Camera Control ({'did': 371449760, 'siid': 7, 'aiid': 1, 'in': [0]}) failed: None
2021-02-03 15:29:32 WARNING (SyncWorker_0) [custom_components.xiaomi_miot] Call miot action to 客厅摄像头 Camera Control ({'did': 371449760, 'siid': 7, 'aiid': 1, 'in': [0]}) failed: None
2021-02-03 15:29:33 WARNING (SyncWorker_3) [custom_components.xiaomi_miot] Call miot action to 客厅摄像头 Camera Control ({'did': 371449760, 'siid': 7, 'aiid': 1, 'in': [0]}) failed: None
2021-02-03 15:29:35 WARNING (SyncWorker_12) [custom_components.xiaomi_miot] Call miot action to 客厅摄像头 Camera Control ({'did': 371449760, 'siid': 7, 'aiid': 1, 'in': [0]}) failed: None

我的 customize 里面的配置如下:

camera.ke_ting_she_xiang_tou_camera_control:
  miot_cloud: true
  miot_did: 371449760

configuration.yaml 中的配置如下:

xiaomi_miot:
  username: my_username
  password: my_password
  server_country: cn

siid 7 为: Camera Stream Management for Google Home
aiid 1 为: Start Camera Stream for Google
但是我还看到一个 aiid 3 为: Get Stream Configuration of Camera

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

请在小米设备调试助手中执行start-hls-stream方法看看能不能获取stream-address,如果有,请在5分钟内用视频播放器如VLC试试能不能播放。

from hass-xiaomi-miot.

womeimingzi11 avatar womeimingzi11 commented on September 18, 2024

可以获取到 stream-address,虽然轮廓什么的倒是没有问题,但是画面是绿的,不过这个应该不影响到 HA 什么。

此外,我的设备每次调用 start-hls-stream 的时候,米家都会通知用户XXX于Time在带屏音箱上观看XXX直播视频

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

需要更多的HA日志

from hass-xiaomi-miot.

womeimingzi11 avatar womeimingzi11 commented on September 18, 2024

我不确定这样的日志是否可以:

2021-02-03 17:19:42 DEBUG (MainThread) [miio.miioprotocol] 192.168.50.87:54321 >>: {'id': 1, 'method': 'miIO.info', 'params': []}
2021-02-03 17:19:42 DEBUG (MainThread) [miio.miioprotocol] 192.168.50.87:54321 (ts: 1970-01-01 03:12:43, id: 1) << {'id': 1, 'result': {'life': 11563, 'uid': 1329098919, 'model': 'chuangmi.camera.029a02', 'token': '43714356423877686636444344716538', 'ipflag': 1, 'miio_ver': '0.0.8', 'mac': '78:8B:2A:D4:38:09', 'fw_ver': '4.1.2_0281', 'hw_ver': 'Linux', 'miio_client_ver': '4.1.2', 'VmPeak': 2412, 'VmRSS': 592, 'MemFree': 4072, 'ap': {'ssid': 'ASUS', 'bssid': '9C:9D:7E:42:0E:A0', 'rssi': '-24', 'freq': 2412}, 'netif': {'localIp': '192.168.50.87', 'mask': '255.255.255.0', 'gw': '192.168.50.1'}, 'config_type': 'app', 'miio_times': [11563, 0, 2, 11510]}, 'exe_time': 0}
2021-02-03 17:19:42 DEBUG (MainThread) [miio.protocol] Unable to decrypt, returning raw bytes: b''
2021-02-03 17:19:42 DEBUG (MainThread) [miio.miioprotocol] Got a response: Container:
data = Container:
data = b'' (total 0)
value = b'' (total 0)
offset1 = 32
offset2 = 32
length = 0
header = Container:
data = b'!1\x00 \x00\x00\x00\x00\x16\xcc\xcc\x0c\x00\x06l\x87' (total 16)
value = Container:
length = 32
unknown = 0
device_id = unhexlify('16cccc0c')
ts = 1970-01-05 20:56:39
offset1 = 0
offset2 = 16
length = 16
checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
2021-02-03 17:19:42 DEBUG (MainThread) [miio.miioprotocol] Discovered 16cccc0c with ts: 1970-01-05 20:56:39, token: b'ffffffffffffffffffffffffffffffff'
省略中间其它设备的日志
2021-02-03 17:19:43 WARNING (SyncWorker_4) [custom_components.xiaomi_miot] Call miot action to 客厅摄像头 Camera Control ({'did': 371449760, 'siid': 7, 'aiid': 1, 'in': [0]}) failed: None

上述 WARNING 会重复多次
每次点击摄像头,就会多一个该 Waning

我的状态也是可以看到实例信息:如下
Snipaste_2021-02-03_17-28-50

from hass-xiaomi-miot.

womeimingzi11 avatar womeimingzi11 commented on September 18, 2024

对了,如果我从 HomeKit 里面的摄像头调用,会产生如下日志,不知是否有帮助:

2021-02-03 17:30:33 ERROR (Thread-9) [pyhap.hap_server] Failed to process request for: /resource
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/pyhap/hap_server.py", line 275, in dispatch
getattr(self, self.HANDLERS[self.command][path])()
File "/usr/local/lib/python3.8/site-packages/pyhap/hap_server.py", line 673, in handle_resource
image = self.accessory_handler.accessory.get_snapshot(image_size)
File "/usr/src/homeassistant/homeassistant/components/homekit/accessories.py", line 544, in get_snapshot
return acc.get_snapshot(info)
File "/usr/src/homeassistant/homeassistant/components/homekit/type_cameras.py", line 450, in get_snapshot
asyncio.run_coroutine_threadsafe(
File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 439, in result
return self.__get_result()
File "/usr/local/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
raise self._exception
File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 164, in async_get_image
raise HomeAssistantError("Unable to get image")
homeassistant.exceptions.HomeAssistantError: Unable to get image
2021-02-03 17:30:33 ERROR (MainThread) [homeassistant.components.homekit.type_cameras] Camera has no stream source
2021-02-03 17:30:33 ERROR (MainThread) [pyhap.camera] [e67ad7e0-b981-42ec-83db-778f09551a8a] Failed to start/reconfigure stream, deleting session.

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

我不确定这样的日志是否可以:

2021-02-03 17:19:42 DEBUG (MainThread) [miio.miioprotocol] 192.168.50.87:54321 >>: {'id': 1, 'method': 'miIO.info', 'params': []}
2021-02-03 17:19:42 DEBUG (MainThread) [miio.miioprotocol] 192.168.50.87:54321 (ts: 1970-01-01 03:12:43, id: 1) << {'id': 1, 'result': {'life': 11563, 'uid': 1329098919, 'model': 'chuangmi.camera.029a02', 'token': '43714356423877686636444344716538', 'ipflag': 1, 'miio_ver': '0.0.8', 'mac': '78:8B:2A:D4:38:09', 'fw_ver': '4.1.2_0281', 'hw_ver': 'Linux', 'miio_client_ver': '4.1.2', 'VmPeak': 2412, 'VmRSS': 592, 'MemFree': 4072, 'ap': {'ssid': 'ASUS', 'bssid': '9C:9D:7E:42:0E:A0', 'rssi': '-24', 'freq': 2412}, 'netif': {'localIp': '192.168.50.87', 'mask': '255.255.255.0', 'gw': '192.168.50.1'}, 'config_type': 'app', 'miio_times': [11563, 0, 2, 11510]}, 'exe_time': 0}
2021-02-03 17:19:42 DEBUG (MainThread) [miio.protocol] Unable to decrypt, returning raw bytes: b''
2021-02-03 17:19:42 DEBUG (MainThread) [miio.miioprotocol] Got a response: Container:
data = Container:
data = b'' (total 0)
value = b'' (total 0)
offset1 = 32
offset2 = 32
length = 0
header = Container:
data = b'!1\x00 \x00\x00\x00\x00\x16\xcc\xcc\x0c\x00\x06l\x87' (total 16)
value = Container:
length = 32
unknown = 0
device_id = unhexlify('16cccc0c')
ts = 1970-01-05 20:56:39
offset1 = 0
offset2 = 16
length = 16
checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
2021-02-03 17:19:42 DEBUG (MainThread) [miio.miioprotocol] Discovered 16cccc0c with ts: 1970-01-05 20:56:39, token: b'ffffffffffffffffffffffffffffffff'
省略中间其它设备的日志
2021-02-03 17:19:43 WARNING (SyncWorker_4) [custom_components.xiaomi_miot] Call miot action to 客厅摄像头 Camera Control ({'did': 371449760, 'siid': 7, 'aiid': 1, 'in': [0]}) failed: None

上述 WARNING 会重复多次
每次点击摄像头,就会多一个该 Waning

我的状态也是可以看到实例信息:如下
Snipaste_2021-02-03_17-28-50

miot_cloud 没有开启成功。如果开启成功。日志中应该会找到updater: cloud,也不会去调用python-miio,请确认下。

from hass-xiaomi-miot.

womeimingzi11 avatar womeimingzi11 commented on September 18, 2024

我不确定这样的日志是否可以:

2021-02-03 17:19:42 DEBUG (MainThread) [miio.miioprotocol] 192.168.50.87:54321 >>: {'id': 1, 'method': 'miIO.info', 'params': []}
2021-02-03 17:19:42 DEBUG (MainThread) [miio.miioprotocol] 192.168.50.87:54321 (ts: 1970-01-01 03:12:43, id: 1) << {'id': 1, 'result': {'life': 11563, 'uid': 1329098919, 'model': 'chuangmi.camera.029a02', 'token': '43714356423877686636444344716538', 'ipflag': 1, 'miio_ver': '0.0.8', 'mac': '78:8B:2A:D4:38:09', 'fw_ver': '4.1.2_0281', 'hw_ver': 'Linux', 'miio_client_ver': '4.1.2', 'VmPeak': 2412, 'VmRSS': 592, 'MemFree': 4072, 'ap': {'ssid': 'ASUS', 'bssid': '9C:9D:7E:42:0E:A0', 'rssi': '-24', 'freq': 2412}, 'netif': {'localIp': '192.168.50.87', 'mask': '255.255.255.0', 'gw': '192.168.50.1'}, 'config_type': 'app', 'miio_times': [11563, 0, 2, 11510]}, 'exe_time': 0}
2021-02-03 17:19:42 DEBUG (MainThread) [miio.protocol] Unable to decrypt, returning raw bytes: b''
2021-02-03 17:19:42 DEBUG (MainThread) [miio.miioprotocol] Got a response: Container:
data = Container:
data = b'' (total 0)
value = b'' (total 0)
offset1 = 32
offset2 = 32
length = 0
header = Container:
data = b'!1\x00 \x00\x00\x00\x00\x16\xcc\xcc\x0c\x00\x06l\x87' (total 16)
value = Container:
length = 32
unknown = 0
device_id = unhexlify('16cccc0c')
ts = 1970-01-05 20:56:39
offset1 = 0
offset2 = 16
length = 16
checksum = b'\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff' (total 16)
2021-02-03 17:19:42 DEBUG (MainThread) [miio.miioprotocol] Discovered 16cccc0c with ts: 1970-01-05 20:56:39, token: b'ffffffffffffffffffffffffffffffff'
省略中间其它设备的日志
2021-02-03 17:19:43 WARNING (SyncWorker_4) [custom_components.xiaomi_miot] Call miot action to 客厅摄像头 Camera Control ({'did': 371449760, 'siid': 7, 'aiid': 1, 'in': [0]}) failed: None

上述 WARNING 会重复多次
每次点击摄像头,就会多一个该 Waning
我的状态也是可以看到实例信息:如下
Snipaste_2021-02-03_17-28-50

miot_cloud 没有开启成功。如果开启成功。日志中应该会找到updater: cloud,也不会去调用python-miio,请确认下。

可是没道理这样呀,空调伴侣 MCN02 和小爱音箱均通过 miot_cloud 参数成功链接,我应该如何确认这一点呢?

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

可是没道理这样呀,空调伴侣 MCN02 和小爱音箱均通过 miot_cloud 参数成功链接,我应该如何确认这一点呢?

[custom_components.xiaomi_miot] Got new state from ... updater: cloud
启动HA并运行几分钟后检查日志中该实体的updater是否为cloud。

from hass-xiaomi-miot.

karolzamosc avatar karolzamosc commented on September 18, 2024

Many thanks for your work @al-one. I have one problem and one question:

  1. After opening the tab with camera cast I have this error:
    error_ha

  2. Every time I open a tab with camera cast I got a push notification from Mi Home app that someone is watching a camera cast... I am using a Imilab cams app to watch this cameras too but I have no push notifications then...

from hass-xiaomi-miot.

TheBisk avatar TheBisk commented on September 18, 2024

Hi, now i see somethnig, but all is green...maybe we are near the goal
image

from hass-xiaomi-miot.

karolzamosc avatar karolzamosc commented on September 18, 2024

@TheBisk I have same screen with cams that has a weak wi-fi connection...

from hass-xiaomi-miot.

womeimingzi11 avatar womeimingzi11 commented on September 18, 2024

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024
1. After opening the tab with camera cast I have this error:

Login attempt failed because HA is not ready after restart.

2. Every time I open a tab with camera cast I got a push notification from Mi Home app that someone is watching a camera cast... I am using a Imilab cams app to watch this cameras too but I have no push notifications then...

The notification may have been sent by the Mi home for safety.

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

@womeimingzi11

太遗憾了,我发现日志里面并没有相关的信息。
我决定先暂且停止调试,也许后面我重新创建一个 HA全新的实例能解决问题。

需要开启插件debug日志:

logger:
  default: warning
  logs:
    custom_components.xiaomi_miot: debug

from hass-xiaomi-miot.

womeimingzi11 avatar womeimingzi11 commented on September 18, 2024

@womeimingzi11

太遗憾了,我发现日志里面并没有相关的信息。
我决定先暂且停止调试,也许后面我重新创建一个 HA全新的实例能解决问题。

需要开启插件debug日志:

logger:
  default: warning
  logs:
    custom_components.xiaomi_miot: debug

我重新创建了 HomeAssistant 的容器,然后也按照您的提示设置了 debug 日志,这是现在的日志内容:

2021-02-03 23:56:35 INFO (MainThread) [custom_components.xiaomi_miot.camera] Initializing 客厅摄像头云台版 Camera Control with host 192.168.50.87 (token 43714...)
2021-02-03 23:56:36 INFO (MainThread) [custom_components.xiaomi_miot.switch] Initializing 电热毯 Switch with host 192.168.50.254 (token f6741...)
2021-02-03 23:56:36 INFO (MainThread) [custom_components.xiaomi_miot.switch] Initializing 暖脚器 Switch with host 192.168.50.108 (token c34f1...)
2021-02-03 23:56:36 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Miot camera: 客厅摄像头云台版 Camera Control url: None expired: 0
2021-02-03 23:56:36 INFO (MainThread) [custom_components.xiaomi_miot.fan] Initializing 台扇 Fan with host 192.168.50.143 (token eb3f3...)
2021-02-03 23:56:36 DEBUG (SyncWorker_10) [custom_components.xiaomi_miot] Call miot action to 客厅摄像头云台版 Camera Control ({'did': '371449760', 'siid': 7, 'aiid': 1, 'in': [0]}), result: {'did': '371449760', 'miid': 0, 'siid': 7, 'aiid': 1, 'code': -704220035, 'exe_time': 0, 'net_cost': 0, 'ot_cost': 0, 'otlocalts': 0, 'oa_cost': 0, '_oa_rpc_cost': 0}
其它设备的日志出现了 updater:lan 字样
2021-02-03 23:58:15 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Miot camera: 客厅摄像头云台版 Camera Control url: None expired: 0
2021-02-03 23:58:15 DEBUG (SyncWorker_12) [custom_components.xiaomi_miot] Call miot action to 客厅摄像头云台版 Camera Control ({'did': '371449760', 'siid': 7, 'aiid': 1, 'in': [0]}), result: {'did': '371449760', 'miid': 0, 'siid': 7, 'aiid': 1, 'code': -704220035, 'exe_time': 0, 'net_cost': 0, 'ot_cost': 0, 'otlocalts': 0, 'oa_cost': 0, '_oa_rpc_cost': 0}
2021-02-03 23:58:15 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Get miot camera stream from cloud for 客厅摄像头云台版 Camera Control: {'did': '371449760', 'miid': 0, 'siid': 7, 'aiid': 1, 'code': -704220035, 'exe_time': 0, 'net_cost': 0, 'ot_cost': 0, 'otlocalts': 0, 'oa_cost': 0, '_oa_rpc_cost': 0}

奇怪的是,Camera 并没有出现 updater 相关的日志

from hass-xiaomi-miot.

womeimingzi11 avatar womeimingzi11 commented on September 18, 2024

继续观察,发现 出现了 updater:cloud 字样,然而依然是没有什么画面:

2021-02-04 00:10:38 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from 客厅摄像头云台版 Camera Control: {'video_codec_type': None, 'video_attribute': None, 'audio_codec_type': None, 'audio_attribute': None, 'authorization_type': None, 'stream_address': None, 'image_snapshot': None, 'expiration_time': None, 'stream_status': 1, 'stream_receiver_id': None, 'stream_auth_token': None, 'camera_control.on': True, 'camera_control.image_rollover': 0, 'camera_control.night_shot': 2, 'camera_control.wdr_mode': True, 'glimmer_full_color': True, 'camera_control.recording_mode': 1, 'camera_control.motion_tracking': False, 'camera_control.time_watermark': True}, updater: cloud
2021-02-04 00:10:45 ERROR (Thread-6) [xiaomi_gateway] Unknown gateway ip 192.168.50.88
2021-02-04 00:10:55 ERROR (Thread-6) [xiaomi_gateway] Unknown gateway ip 192.168.50.88
2021-02-04 00:10:59 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Miot camera: 客厅摄像头云台版 Camera Control url: None expired: 0
2021-02-04 00:10:59 DEBUG (SyncWorker_14) [custom_components.xiaomi_miot] Call miot action to 客厅摄像头云台版 Camera Control ({'did': '371449760', 'siid': 7, 'aiid': 1, 'in': [0]}), result: {'did': '371449760', 'miid': 0, 'siid': 7, 'aiid': 1, 'code': -704220035, 'exe_time': 0, 'net_cost': 0, 'ot_cost': 0, 'otlocalts': 0, 'oa_cost': 0, '_oa_rpc_cost': 0}
2021-02-04 00:10:59 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Get miot camera stream from cloud for 客厅摄像头云台版 Camera Control: {'did': '371449760', 'miid': 0, 'siid': 7, 'aiid': 1, 'code': -704220035, 'exe_time': 0, 'net_cost': 0, 'ot_cost': 0, 'otlocalts': 0, 'oa_cost': 0, '_oa_rpc_cost': 0}
2021-02-04 00:11:00 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Miot camera: 客厅摄像头云台版 Camera Control url: None expired: 0
2021-02-04 00:11:00 DEBUG (SyncWorker_4) [custom_components.xiaomi_miot] Call miot action to 客厅摄像头云台版 Camera Control ({'did': '371449760', 'siid': 7, 'aiid': 1, 'in': [0]}), result: {'did': '371449760', 'miid': 0, 'siid': 7, 'aiid': 1, 'code': -704220035, 'exe_time': 0, 'net_cost': 0, 'ot_cost': 0, 'otlocalts': 0, 'oa_cost': 0, '_oa_rpc_cost': 0}
2021-02-04 00:11:00 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Get miot camera stream from cloud for 客厅摄像头云台版 Camera Control: {'did': '371449760', 'miid': 0, 'siid': 7, 'aiid': 1, 'code': -704220035, 'exe_time': 0, 'net_cost': 0, 'ot_cost': 0, 'otlocalts': 0, 'oa_cost': 0, '_oa_rpc_cost': 0}
2021-02-04 00:11:00 ERROR (MainThread) [homeassistant.components.camera] Error requesting stream: camera.ke_ting_she_xiang_tou_yun_tai_ban_camera_control does not support play stream service
2021-02-04 00:11:00 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Miot camera: 客厅摄像头云台版 Camera Control url: None expired: 0
2021-02-04 00:11:01 DEBUG (SyncWorker_10) [custom_components.xiaomi_miot] Call miot action to 客厅摄像头云台版 Camera Control ({'did': '371449760', 'siid': 7, 'aiid': 1, 'in': [0]}), result: {'did': '371449760', 'miid': 0, 'siid': 7, 'aiid': 1, 'code': -704220035, 'exe_time': 0, 'net_cost': 0, 'ot_cost': 0, 'otlocalts': 0, 'oa_cost': 0, '_oa_rpc_cost': 0}
2021-02-04 00:11:01 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Get miot camera stream from cloud for 客厅摄像头云台版 Camera Control: {'did': '371449760', 'miid': 0, 'siid': 7, 'aiid': 1, 'code': -704220035, 'exe_time': 0, 'net_cost': 0, 'ot_cost': 0, 'otlocalts': 0, 'oa_cost': 0, '_oa_rpc_cost': 0}
2021-02-04 00:11:01 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Miot camera: 客厅摄像头云台版 Camera Control url is empty. {'model': 'chuangmi.camera.029a02', 'lan_ip': '192.168.50.87', 'mac_address': '78:8B:2A:D4:38:09', 'firmware_version': '4.1.2_0281', 'hardware_version': 'Linux', 'entity_class': 'MiotCameraEntity', 'video_codec_type': None, 'video_attribute': None, 'audio_codec_type': None, 'audio_attribute': None, 'authorization_type': None, 'stream_address': None, 'image_snapshot': None, 'expiration_time': None, 'stream_status': 1, 'stream_receiver_id': None, 'stream_auth_token': None, 'camera_control.on': True, 'camera_control.image_rollover': 0, 'camera_control.night_shot': 2, 'camera_control.wdr_mode': True, 'glimmer_full_color': True, 'camera_control.recording_mode': 1, 'camera_control.motion_tracking': False, 'camera_control.time_watermark': True}

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

'code': -704220035 中的 035解释为 Action参数错误

你的摄像头chuangmi.camera.029a02属性video-attribute格式为:

[
    {
        "value":1,
        "description":"1920_1080_30"
    },
    {
        "value":2,
        "description":"1280_720_30"
    },
    {
        "value":3,
        "description":"1024_768_30"
    }
]

而本插件该属性默认为0,因此你需要为摄像头实体添加自定义属性video_attribute: 2,如下:

# customize.yaml (Configuration > Customize > Select Entity > Add Other Attribute)
camera.entity_id:
  video_attribute: 2

from hass-xiaomi-miot.

womeimingzi11 avatar womeimingzi11 commented on September 18, 2024

from hass-xiaomi-miot.

karolzamosc avatar karolzamosc commented on September 18, 2024
2. Every time I open a tab with camera cast I got a push notification from Mi Home app that someone is watching a camera cast... I am using a Imilab cams app to watch this cameras too but I have no push notifications then...

The notification may have been sent by the Mi home for safety.

It looks like the connections with cameras are not keeped by the HA in the background, right? I am asking because I am getting the push notification on my phone every time I open tab with cameras in HA

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

It looks like the connections with cameras are not keeped by the HA in the background, right? I am asking because I am getting the push notification on my phone every time I open tab with cameras in HA

The stream address from the micloud is only valid for 5 minutes, so HA need to get a new stream address every 5 minutes.

from hass-xiaomi-miot.

karolzamosc avatar karolzamosc commented on September 18, 2024

@al-one thanks, now it is all clear for me, great job

from hass-xiaomi-miot.

valdi-sudo avatar valdi-sudo commented on September 18, 2024

Hi
I also have problem with getting feed from two of my cameras (chuangmi.camera.ipc017 and chuangmi.camera.ipc016).
Integration via Xiaomi Miot seems to be working fine. I have proper entities in HA, I can turn them on and off, but after adding a card in lovelace there's no feed (see atached) I already set region to de but it iddn't help...

Zrzut ekranu 2021-02-05 11 45 48

Zrzut ekranu 2021-02-05 08 33 14

Can you point me to how can I get it to work?

from hass-xiaomi-miot.

minnenratta avatar minnenratta commented on September 18, 2024

太棒了!终于成功了!

I have the same problem. Can you tell me how you solved this?
In whitch file I must insert this video attributes from the post before?
(The Translator dont show the full text in english/german)
Thank You.

from hass-xiaomi-miot.

genericmann avatar genericmann commented on September 18, 2024

Also have the same "data type not valid" problem with chuangmi.camera.ipc019

2021-02-18 21:27:27 INFO (MainThread) [custom_components.xiaomi_miot.camera] Initializing XiaomiCamera Camera Control with host 192.168.1.172 (token 4a5a6...)
2021-02-18 21:27:27 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Miot camera: XiaomiCamera Camera Control url: None expired: 0
2021-02-18 21:27:27 DEBUG (SyncWorker_6) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot spec: action, params: {'did': 311361412, 'siid': 4, 'aiid': 1, 'in': [1]} to cloud failed: {"code":-8,"message":"data type not valid","result":null} None
2021-02-18 21:27:27 WARNING (SyncWorker_6) [custom_components.xiaomi_miot] Call miot action to XiaomiCamera Camera Control ({'did': 311361412, 'siid': 4, 'aiid': 1, 'in': [1]}) failed: None
2021-02-18 21:27:27 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Get miot camera stream from cloud for XiaomiCamera Camera Control: {}
2021-02-18 21:27:34 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Miot camera: XiaomiCamera Camera Control url: None expired: 0
2021-02-18 21:27:34 DEBUG (SyncWorker_0) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot spec: action, params: {'did': 311361412, 'siid': 4, 'aiid': 1, 'in': [1]} to cloud failed: {"code":-8,"message":"data type not valid","result":null} None
2021-02-18 21:27:34 WARNING (SyncWorker_0) [custom_components.xiaomi_miot] Call miot action to XiaomiCamera Camera Control ({'did': 311361412, 'siid': 4, 'aiid': 1, 'in': [1]}) failed: None
2021-02-18 21:27:34 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Get miot camera stream from cloud for XiaomiCamera Camera Control: {}

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

Also have the same "data type not valid" problem with chuangmi.camera.ipc019

#17 (comment)

from hass-xiaomi-miot.

skip78 avatar skip78 commented on September 18, 2024

I checked again and the miot_cloud value was "true" (double quoted)
Then now I've got this debug trace but no feed is displayed neither stilll picture

2021-02-02 18:55:41 DEBUG (SyncWorker_2) [custom_components.xiaomi_miot] Call miot action to CameraJardin Camera Control ({'did': '294068056', 'siid': 5, 'aiid': 1, 'in': [0]}), result: {'did': '294068056', 'miid': 0, 'siid': 5, 'aiid': 1, 'code': 0, 'out': ['https://cn01.livestreaming.io.mi.com/hlstranscoder/XXXXXXXXXXA1MTFmNzQ0MTMwYjVjZThlMDg0ZTEzZDI2OBgKX191bnVzZWRfXwA_H265transH264/playlist.m3u8'], 'exe_time': 0, 'net_cost': 0, 'ot_cost': 0, 'otlocalts': 0, 'oa_cost': 0, '_oa_rpc_cost': 0}

(I changed the value for security measure)

When I copy/paste the https directly in Chome I got e 403 (cn01.livestreaming.io.mi.com access refused)
BTW I'm using CN server but live in France.

[Edit] the loveui card is displaying "Streaming" even if there is nothing
image

[Edit2] BTW your solution for camera does it need to have cloud service registration (payed) linked to our xiaomi account ?

[Edit3] I could ping cn01.livestreaming.io.mi.com without problem (resolved on 42.157.163.230)

Envoi d’une requête 'ping' sur cn01.livestreaming.io.mi.com [42.157.163.230] avec 32 octets de données :
Réponse de 42.157.163.230 : octets=32 temps=265 ms TTL=46

Can you help me, I don't understant how you solved it. I have exactly the same problem

from hass-xiaomi-miot.

HepoH3 avatar HepoH3 commented on September 18, 2024

I believe that your problem is h265 codec. Modern browsers except safary doesn't support it. If you try to open this card on the ha companion app, you'll be able to see the stream.

from hass-xiaomi-miot.

chrisis2 avatar chrisis2 commented on September 18, 2024

Hi,
I have a very similar error for camera isa.camera.hlc6 integrated with Home Assistant (preview of camera not available).

obraz

I have following errors in log:

obraz

2021-04-15 21:27:52 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Miot camera: kamera Camera Control url: None expired: 1618514548728.5745
2021-04-15 21:27:53 DEBUG (SyncWorker_0) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/action {'params': {'did': '373627529', 'siid': 5, 'aiid': 1, 'in': [2]}} result: {"code":0,"message":"","result":{"did":"373627529","miid":0,"siid":5,"aiid":1,"code":0,"out":["https://de28.livestreaming.io.mi.com/hlstranscoder/GCA4Y2U4ZDk0ZjFkODk0MmJkYWVjMjFlMzliYTBhOTA3NhgKX191bnVzZWRfXwA_H265transH264/playlist.m3u8"],"exe_time":0,"net_cost":0,"ot_cost":0,"otlocalts":0,"oa_cost":0,"_oa_rpc_cost":0}}
2021-04-15 21:27:53 DEBUG (SyncWorker_0) [custom_components.xiaomi_miot] Call miot action to kamera Camera Control ({'did': '373627529', 'siid': 5, 'aiid': 1, 'in': [2]}), result: {'did': '373627529', 'miid': 0, 'siid': 5, 'aiid': 1, 'code': 0, 'out': ['https://de28.livestreaming.io.mi.com/hlstranscoder/GCA4Y2U4ZDk0ZjFkODk0MxxxxxxxxzliYTBhOTA3NhgKX191bnVzZWRfXwA_H265transH264/playlist.m3u8'], 'exe_time': 0, 'net_cost': 0, 'ot_cost': 0, 'otlocalts': 0, 'oa_cost': 0, '_oa_rpc_cost': 0}
2021-04-15 21:27:53 DEBUG (MainThread) [custom_components.xiaomi_miot.camera] Get miot camera stream from cloud for kamera Camera Control: {'did': '373627529', 'miid': 0, 'siid': 5, 'aiid': 1, 'code': 0, 'out': ['https://de28.livestreaming.io.mi.com/hlstranscoder/GCA4Y2U4ZDkxxxxxxxxMmJkYWVjMjFlMzliYTBhOTA3NhgKX191bnVzZWRfXwA_H265transH264/playlist.m3u8'], 'exe_time': 0, 'net_cost': 0, 'ot_cost': 0, 'otlocalts': 0, 'oa_cost': 0, '_oa_rpc_cost': 0}
2021-04-15 21:27:53 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [2813076960] 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/camera/__init__.py", line 585, in ws_camera_stream
url = await _async_stream_endpoint_url(hass, camera, fmt=msg["format"])
File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 708, in _async_stream_endpoint_url
stream = await camera.create_stream()
File "/usr/src/homeassistant/homeassistant/components/camera/__init__.py", line 370, in create_stream
self.stream = create_stream(self.hass, source, options=self.stream_options)
File "/usr/src/homeassistant/homeassistant/components/stream/__init__.py", line 71, in create_stream
hass.data[DOMAIN][ATTR_STREAMS].append(stream)
AttributeError: 'dict' object has no attribute 'append'
2021-04-15 21:27:58 DEBUG (SyncWorker_3) [custom_components.xiaomi_miot.core.xiaomi_cloud] Request miot api: miotspec/prop/get {'params': [{'did': '373627529', 'siid': 4, 'piid': 1}, {'did': '373627529', 'siid': 2, 'piid': 1}, {'did': '373627529', 'siid': 2, 'piid': 2}, {'did': '373627529', 'siid': 2, 'piid': 3}, {'did': '373627529', 'siid': 2, 'piid': 4}, {'did': '373627529', 'siid': 2, 'piid': 5}]} result: {"code":0,"message":"","result":[{"did":"373627529","siid":4,"piid":1,"value":1,"code":0},{"did":"373627529","siid":2,"piid":1,"value":true,"code":0,"updateTime":1618511850},{"did":"373627529","siid":2,"piid":2,"value":0,"code":0,"updateTime":1618514878},{"did":"373627529","siid":2,"piid":3,"value":0,"code":0,"updateTime":1618514878},{"did":"373627529","siid":2,"piid":4,"value":true,"code":0,"updateTime":1618514878},{"did":"373627529","siid":2,"piid":5,"value":2,"code":0,"updateTime":1618514878}]}
2021-04-15 21:27:58 DEBUG (MainThread) [custom_components.xiaomi_miot] Got new state from kamera Camera Control: {'stream_status': 1, 'camera_control.on': True, 'camera_control.image_rollover': 0, 'camera_control.night_shot': 0, 'camera_control.time_watermark': True, 'camera_control.recording_mode': 2, 'state_updater': 'cloud', 'sub_entities': ['camera_control.on']}
2021-04-15 21:27:59 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/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/xiaomi_miot/camera.py", line 219, 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

Can you please help me diagnose?

from hass-xiaomi-miot.

y04551b11 avatar y04551b11 commented on September 18, 2024

怎么添加摄像头啊 看了一圈 没看懂

from hass-xiaomi-miot.

stevechen1970 avatar stevechen1970 commented on September 18, 2024

請問當前版本支持chuangmi.camera.ipc019 嗎? 我遇到的問題是, 串流影片只能看前幾分鐘, 之後串流影片就一直停留在同一時間點不再更新. 嘗試很多設置的改變, 但是一直無法解決串流沒法持續更新的問題, 請問哪裡設置有誤嗎? 謝謝.

access_token:
brand: chuangmi
model: chuangmi.camera.ipc019
lan_ip: 192.168.20.11
mac_address:
firmware_version: 4.0.9_0426
hardware_version:
entity_class: MiotCameraEntity
miot_type: urn:miot-spec-v2:device:camera:0000A01C:chuangmi-ipc019:1
miot_action_result:
did: '322619315'
miid: 0
siid: 4
aiid: 1
code: -704220025

stream_address:
expire_at: 2021-10-30 16:15:20.949613
miot_error: null
camera_control.on: true
camera_control.image_rollover: 0
camera_control.night_shot: 0
camera_control.time_watermark: true
camera_control.wdr_mode: false
glimmer_full_color-2-6: true
camera_control.recording_mode: 3
camera_control.motion_tracking: false
stream_status-3-1: 1
state_updater: cloud
sub_entities: camera_control.on, motion_event
miot_action_error: -704220025 The number of action parameters does not match
friendly_name: Mi Home Security Camera 360° 1080P Camera Control
entity_picture: /api/camera_proxy/camera.chuangmi_ipc019_c396_camera_control?token=
supported_features: 3

from hass-xiaomi-miot.

PrzemekSkw avatar PrzemekSkw commented on September 18, 2024

Hello, I also have that camera and don't see video. It looks OK in HA
Screenshot_20211031_204407

Screenshot_20211031_204500

I have that error in log:

Logger: custom_components.xiaomi_miot.camera
Source: custom_components/xiaomi_miot/camera.py:306
Integration: Xiaomi Miot Auto (documentation, issues)
First occurred: 20:36:46 (12 occurrences)
Last logged: 20:47:46

Niania Camera Control: camera events is empty. {'result': 'ok', 'retriable': False, 'code': 0, 'data': {'thirdPartPlayUnits': [], 'nextTime': 1635104626000, 'isContinue': True}, 'description': '成功', 'ts': 1635709427430}
Niania Camera Control: camera events is empty. {'result': 'ok', 'retriable': False, 'code': 0, 'data': {'thirdPartPlayUnits': [], 'nextTime': 1635104686000, 'isContinue': True}, 'description': '成功', 'ts': 1635709487430}
Niania Camera Control: camera events is empty. {'result': 'ok', 'retriable': False, 'code': 0, 'data': {'thirdPartPlayUnits': [], 'nextTime': 1635104746000, 'isContinue': True}, 'description': '成功', 'ts': 1635709547421}
Niania Camera Control: camera events is empty. {'result': 'ok', 'retriable': False, 'code': 0, 'data': {'thirdPartPlayUnits': [], 'nextTime': 1635104806000, 'isContinue': True}, 'description': '成功', 'ts': 1635709607517}
Niania Camera Control: camera events is empty. {'result': 'ok', 'retriable': False, 'code': 0, 'data': {'thirdPartPlayUnits': [], 'nextTime': 1635104866000, 'isContinue': True}, 'description': '成功', 'ts': 1635709667531}

I add that entry to my configuration.yaml:

#=======================
#     CAMERA XIAOMI
#======================
xiaomi_miot:
  username: xxxxxxxxxxxxxxxxxx
  password: xxxxxxxxxxxxxxxxxx
  server_country: de

What can I do to make it work?
Regards.

from hass-xiaomi-miot.

al-one avatar al-one commented on September 18, 2024

@PrzemekSkw You can enable the Home surveillance assistant in the Mihome APP, and then use another camera entity camera.chuangmi_ipc016_xxxx_motion_event under the device.

#206 (comment)

from hass-xiaomi-miot.

PrzemekSkw avatar PrzemekSkw commented on September 18, 2024

Thanks for answer but that don't help. Still don't have any picture from camera. I can turn it OFF and ON with switch.
In Developers tools looks like that:

camera.chuangmi_ipc016_aa6d_camera_control
Niania | idle | 
access_token: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
brand: chuangmi
model: chuangmi.camera.ipc016
lan_ip: 192.168.0.11
mac_address: 5D:A5:0C:89:AB:6D
firmware_version: 164.1.6_0407
hardware_version:  
entity_class: MiotCameraEntity 
miot_type: urn:miot-spec-v2:device:camera:0000A01C:chuangmi-ipc016:1 
camera_control.on: true 
camera_control.image_rollover: 0 
camera_control.night_shot: 0 
camera_control.time_watermark: true 
camera_control.wdr_mode: false 
glimmer_full_color-2-6: false 
camera_control.recording_mode: 3 
camera_control.motion_tracking: false 
state_updater: cloud 
sub_entities: camera_control.on 
friendly_name: Niania 
entity_picture: /api/camera_proxy/camera.chuangmi_ipc016_aa6d_camera_control?token=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx 
supported_features: 1

Regards

from hass-xiaomi-miot.

FrancYescO avatar FrancYescO commented on September 18, 2024

i have the same issue and cannot get the image from mine chuangmi.camera.ip026c, logs and developer tools are similar

image

i've also tried this #173 (comment) but it does not help

from hass-xiaomi-miot.

PrzemekSkw avatar PrzemekSkw commented on September 18, 2024

Hi @al-one is there a plans to make my Imilab camera (CMSXJ16A, chuangmi.camera.ipc016) works, to get live stream? I still have no live stream only switch button to turn on/off camera.
Regards

from hass-xiaomi-miot.

FrancYescO avatar FrancYescO commented on September 18, 2024

FYI i have same issue also with chuangmi.camera.ipc017

from hass-xiaomi-miot.

imnbug avatar imnbug commented on September 18, 2024

智能门铃是不能实时查看吗

from hass-xiaomi-miot.

FrancYescO avatar FrancYescO commented on September 18, 2024

After enabling Home surveillance assistant on chuangmi.camera.ipc016c i was able to get a screenshot of the camera (still not stable... sometime it just loads a broken image) live stream URL is shown in the developer options... but trying to get a live stream is still not working:
image

from hass-xiaomi-miot.

doktordoc1 avatar doktordoc1 commented on September 18, 2024

I get video, butt keeps only for about 10 sec, then goes from begining, over and over again

from hass-xiaomi-miot.

ductu3590 avatar ductu3590 commented on September 18, 2024

In # configuration.yaml

homeassistant: 
  customize: !include customize.yaml
xiaomi_miot:
  username: xiaomi_username #Replaced with my account
  password: xiaomi_password #Replaced with my account
  server_country: cn

I live in Vietnam and use "CN" server in Mihome app settings
In /config/customize.yaml:

camera.chuangmi_ipc019_a4a9_camera_control:
  video_attribute: 1 
  keep_streaming: true

But it can't display the video stream, please help me. Where did I go wrong? My camera: Chuangmi.ipc019

Logger: homeassistant.components.stream.stream.camera.chuangmi_ipc019_a4a9_camera_control
Source: components/stream/init.py:434
Integration: Stream (documentation, issues)
First occurred: 08:30:00 (3 occurrences)
Last logged: 08:30:34

Error from stream worker: Error opening stream (HTTP_FORBIDDEN, Server returned 403 Forbidden (access denied)) https://cn01.livestreaming.io.mi.com/hlstranscoder/GCBkZDNiNTY1MmQ3YmQ0MGFlOWI2MDM5ODQ5OGI4MjU1NhgKX191bnVzZWRfXwA_H265transH264/playlist.m3u8

from hass-xiaomi-miot.

iQuadro avatar iQuadro commented on September 18, 2024

Hello please help me, my camera model is chuangmi.camera.039a04

from hass-xiaomi-miot.

Related Issues (20)

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.