make-all / tuya-local

Local support for Tuya devices in Home Assistant
MIT License
1.42k stars 547 forks source link

Request support for Fuers 5MP WiFi Camera #2410

Closed Esp32-zapper closed 2 weeks ago

Esp32-zapper commented 1 month ago

Log message

Device matches kerui_300w_camera with quality of 93%. DPS: {"updated_at": 1729239162.8115568, "101": true, "103": false, "104": true, "105": false, "106": "2", "108": "0", "109": "0|0|0", "110": 5, "117": 0, "134": true, "150": false, "151": "1", "160": 35, "161": true, "241": "{\"video\":[{\"restype\":\"4\",\"oldres\":\"2304*1296\",\"newres\":\"2880*1620\"},{\"restype\":\"2\",\"oldres\":\"2304*1296\",\"newres\":\"2880*1620\"}],\"message\":\"2880*1620\"}"}

DPS information

{
  "result": {
    "model": "{\"modelId\":\"fxa80g\",\"services\":[{\"actions\":[],\"code\":\"\",\"description\":\"\",\"events\":[],\"name\":\"默认服务\",\"properties\":[
{\"abilityId\":101,\"accessMode\":\"rw\",\"code\":\"basic_indicator\",\"description\":\"设备设置页面-基本功能设置\\n设备指示灯是否打开,true打开,false关闭\",\"extensions\":{\"iconName\":\"icon-setting\",\"attribute\":\"1152\"},\"name\":\"状态指示灯\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":103,\"accessMode\":\"rw\",\"code\":\"basic_flip\",\"description\":\"设备设置页面-基本功能设置\\n使直播画面垂直翻转,true打开翻转,false关闭翻转\",\"extensions\":{\"iconName\":\"icon-setting\",\"attribute\":\"1024\"},\"name\":\"画面翻转\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":104,\"accessMode\":\"rw\",\"code\":\"basic_osd\",\"description\":\"设备设置页面-基本功能设置\\n时间水印功能开关,true打开水印,false关闭水印\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"时间水印\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":105,\"accessMode\":\"rw\",\"code\":\"basic_private\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-setting\",\"attribute\":\"128\"},\"name\":\"隐私模式\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":106,\"accessMode\":\"rw\",\"code\":\"motion_sensitivity\",\"description\":\"0-2,灵敏度依次增加;仅为灵敏度,0并不是关闭移动侦测报警;规定0为低灵敏度,1为中灵敏度,2为高灵敏度。\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"移动侦测灵敏度\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"0\",\"1\",\"2\"]}},
{\"abilityId\":108,\"accessMode\":\"rw\",\"code\":\"basic_nightvision\",\"description\":\"0:自动\\n1:关\\n2:开\",\"extensions\":{\"iconName\":\"icon-setting\",\"attribute\":\"1024\"},\"name\":\"红外夜视\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"0\",\"1\",\"2\"]}},
{\"abilityId\":109,\"accessMode\":\"ro\",\"code\":\"sd_storge\",\"description\":\"单位改为kb\\n---\\n3503775744|778977280|2718158848\\n其中第一字符串是总容量,第二个字符串是已使用的容量,第三个是剩余容量\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"获取存储卡容量\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}},
{\"abilityId\":110,\"accessMode\":\"ro\",\"code\":\"sd_status\",\"description\":\"status:sd卡状态,1-正常,2-异常,3-空间不足,4-正在格式化,5-无SD卡;\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"存储卡状态\",\"typeSpec\":{\"type\":\"value\",\"max\":5,\"min\":1,\"scale\":0,\"step\":1}},
{\"abilityId\":111,\"accessMode\":\"rw\",\"code\":\"sd_format\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"存储卡格式化\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":115,\"accessMode\":\"ro\",\"code\":\"movement_detect_pic\",\"description\":\"该功能实现请参考SDK\\n---------------\\n{\\\"dp_id\\\",\\\"bucket;object;key\\\"}/{\\\"dp_id\\\",\\\"bucket;object;\\\"}\\n\\nbucket:根文件夹;objcet:文件路径;key:加密\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"检测到移动\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},
{\"abilityId\":116,\"accessMode\":\"rw\",\"code\":\"ptz_stop\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-setting\",\"attribute\":\"1024\"},\"name\":\"停止转动\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":117,\"accessMode\":\"ro\",\"code\":\"sd_format_state\",\"description\":\"返回错误码:\\n-2000:SD卡正在格式化\\n-2001:SD卡格式化异常\\n-2002:无SD卡\\n-2003:SD卡错误\\n\\n//正数为格式化进度\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"格式化状态\",\"typeSpec\":{\"type\":\"value\",\"max\":200000,\"min\":-20000,\"scale\":0,\"step\":1}},
{\"abilityId\":119,\"accessMode\":\"rw\",\"code\":\"ptz_control\",\"description\":\"direction:方向,共8个;0-上,1-右上,2-右,3-右下,4-下,5-左下,6-左,7-左上\",\"extensions\":{\"iconName\":\"icon-setting\",\"attribute\":\"1024\"},\"name\":\"云台转动\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"]}},
{\"abilityId\":134,\"accessMode\":\"rw\",\"code\":\"motion_switch\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"移动报警开关\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":150,\"accessMode\":\"rw\",\"code\":\"record_switch\",\"description\":\"设备设置页面-存储卡设置\\nSD卡录像开关,true为打开,false为关闭\\n功能关闭时,不录像到SD卡\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"SD卡录像开关\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":151,\"accessMode\":\"rw\",\"code\":\"record_mode\",\"description\":\"设备设置页面-存储卡设置\\nSD卡录像模式选择,1为事件录像(检测到移动再录像到SD卡),2为连续录像\",\"extensions\":{\"iconName\":\"icon-setting\"},\"name\":\"录像模式\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"1\",\"2\"]}},
{\"abilityId\":160,\"accessMode\":\"rw\",\"code\":\"basic_device_volume\",\"description\":\"控制设备端播放对讲声音的音量\",\"extensions\":{\"iconName\":\"icon-setting\",\"attribute\":\"1152\"},\"name\":\"设备音量控制\",\"typeSpec\":{\"type\":\"value\",\"max\":100,\"min\":1,\"scale\":0,\"step\":1,\"unit\":\"%\"}},
{\"abilityId\":161,\"accessMode\":\"rw\",\"code\":\"motion_tracking\",\"description\":\"\",\"extensions\":{\"iconName\":\"icon-setting\",\"attribute\":\"1024\"},\"name\":\"移动追踪开关\",\"typeSpec\":{\"type\":\"bool\"}},
{\"abilityId\":185,\"accessMode\":\"ro\",\"code\":\"alarm_message\",\"description\":\"实现方式参考嵌入式SDK使用文档\",\"extensions\":{\"iconName\":\"icon-setting\",\"attribute\":\"1024\"},\"name\":\"告警消息上报\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},
{\"abilityId\":212,\"accessMode\":\"rw\",\"code\":\"initiative_message\",\"description\":\"参考SDK文档实现\",\"extensions\":{\"attribute\":\"2048\"},\"name\":\"主动消息推送\",\"typeSpec\":{\"type\":\"raw\",\"maxlen\":128}},
{\"abilityId\":239,\"accessMode\":\"ro\",\"code\":\"ipc_movement_detect\",\"description\":\"\",\"name\":\"检测到移动\",\"typeSpec\":{\"type\":\"enum\",\"range\":[\"motion\"]}},
{\"abilityId\":241,\"accessMode\":\"ro\",\"code\":\"ipc_res_change\",\"description\":\"\",\"name\":\"插值放大\",\"typeSpec\":{\"type\":\"string\",\"maxlen\":255}}]}]}"
  },
  "success": true,
  "t": 1729239090967,
  "tid": "94f7c4788d2811ef844fc2ceb152d8fe"
}

Product ID

o9jlvpqqunankygf

Product Name

Fuers 5MP WiFi Indoor Surveillance Camera

Information about how the device functions

Works a lot like the kerui_300w_camera exept that you can not access the camera output. no feed detected

Could not find a manual but this page might help https://fuers.co.uk/index.php/product/fuers-5mp-ip-tuya-smart-home-wifi-wireless-surveillance-camera/

Esp32-zapper commented 4 weeks ago

Sorry but I didn't understa much of that? Do we have something I could try out or was the conclusion that Kerui is as close as it possibly can be?

make-all commented 4 weeks ago

There are some changes to kerui 300w config that should better support this device. But these are so close in functionality it is not worth adding a new device.

Esp32-zapper commented 3 weeks ago

All sensors are working but there is no video stream and to change direction of the camera is very hard. In the Tuya app thee is a step by step directional arrow cross to point the camera but here you will only get a menu to select end points. There is a stop button but it has no effect because of the delay. It will not pick up the stop command until it already reached the max position.

Screenshot_20241101-145012

Is there something that could be done of is this as good as it could be on this cam?

Esp32-zapper commented 3 weeks ago

Strange. Downloaded the new file and reloaded the device. New arrow devices shows up, so it must have recognised the new file for the 300w. However, the video stream is still dead so I thought maybe just updating the file still doesn't change that it's been "paired" with the kerui and didn't really care about the new option in the file for the Fuers. So, I removed the device and tried to add it again. Now it refuses to give me the Kerui300w as suggestion but the 200w shows up instead. The 300w model doesn't even show up on the list. Screenshot_20241104-113753

I have checked. The 300 file is in the device folder. When it thought it was a 300, it could access the file as I got the upgraded buttons.

What could be wrong?

make-all commented 3 weeks ago

Video output does not come through the tuya protocol, so is outside the scope of this integration. For some cameras, WebRTC or RTSP can work locally if you can find the right parameters for your camera. For others, they can only work via the cloud.

The still snapshots may show up if the camera is encoding still images in the local protocol, and not sending a key/partial link for fetching them from the cloud.

Esp32-zapper commented 3 weeks ago

Ok, but it used to recognize the camera as a kerui300w but now it can't even see that as similar. Checked permission and it has root/root 644 just as the rest of the files in the device folder.

make-all commented 3 weeks ago

I can't answer questions posed as "it doesn't work, what am I doing wrong?". I am not psychic.

The config has been made based on the data provided. If it is not working, you need to provide new data in order for anyone to try to figure out why. Since the DPS information is fixed and does not change, this means the Logs.

Esp32-zapper commented 3 weeks ago

Felet härrör från en anpassad integration.

Logger: custom_components.tuya_local.config_flow Källa: custom_components/tuya_local/config_flow.py:485 integration: Tuya Local (dokumentation, ärenden) Inträffade först: 13:20:29 (1 händelser) Senast loggade: 13:20:29

Device matches kerui_200w_camera with quality of 83%. DPS: {"updated_at": 1730722823.0028386, "101": false, "103": false, "104": true, "105": false, "106": "2", "108": "0", "109": "0|0|0", "110": 5, "116": true, "117": 0, "119": "3", "134": true, "150": false, "151": "1", "160": 81, "161": true, "239": "motion", "241": "{\"video\":[{\"restype\":\"4\",\"oldres\":\"23041296\",\"newres\":\"28801620\"},{\"restype\":\"2\",\"oldres\":\"23041296\",\"newres\":\"28801620\"}],\"message\":\"2880*1620\"}"}

As you can see in the orig post, it recognised the 300w version as 93% alike but now it ignores that file completely and thinks the closest is the 200w version, with only 83% likeness. Screenshot_20241104-133146

Esp32-zapper commented 3 weeks ago

That worked much better! Now it picked up the 300w version with 100% likeness directly. Pity about video feed but I can get that from Tuya and the rest from you. Will work! Tnx a lot!