tuya-local icon indicating copy to clipboard operation
tuya-local copied to clipboard

Device Support Request:WIFI Human Presence Sensor

Open superman110 opened this issue 3 years ago • 8 comments

Hi,friend Can you support new device,Thanks

Human Presence Sensor II

SD123-HPR01 http://sd123iot.com/ProductDetail/6203856.html https://detail.tmall.com/item.htm?id=649910182910&spm=a1z09.2.0.0.5baf2e8d4O4LBM&_u=d3biddif8b6

superman110 avatar Mar 13 '22 13:03 superman110

TuyaDebug (Tuya DPs dump) [1.0.0]

Device xxx at 192.168.1.247 key xxx protocol 3.3 dev_type type_0a: DPS [1] VALUE [none]
DPS [101] VALUE [0_meters]
DPS [102] VALUE [6_meters]
DPS [103] VALUE [case_0]
DPS [104] VALUE [case_1]
DPS [105] VALUE [not_reset] DPS [106] VALUE [normal]
DPS [107] VALUE [1200]
DPS [108] VALUE [1000]
DPS [109] VALUE [1]
DPS [110] VALUE [1]
DPS [111] VALUE [10] DPS [112] VALUE [2]
DPS [113] VALUE [0]
DPS [114] VALUE [True]

Device Debugging Logs

Time Device Event DP ID Event Details Source 2022-03-13 20:40:30 Report Radar switch On device itself 2022-03-13 20:36:50 Report Radar switch Off device itself
2022-03-13 20:32:34 Report Scene mode Meeting/Office device itself 2022-03-13 20:31:27 Report Target points to maintain 0个 device itself 2022-03-13 20:30:31 Report Target points to maintain 3个 device itself 2022-03-13 20:30:14 Report Target maintenance pow 1000 device itself 2022-03-13 20:29:14 Report Target maintenance pow 700 device itself 2022-03-13 20:28:14 Report Target triggered frames 1帧 device itself 2022-03-13 20:27:04 Report Target triggered frames 4帧 device itself 2022-03-13 20:26:36 Report Interrupt frames 1帧数 device itself 2022-03-13 20:26:32 Report Interrupt frames 2帧数 device itself 2022-03-13 20:25:35 Report Interrupt frames 7帧数 device itself 2022-03-13 20:23:58 Report Target points triggered 2个 device itself 2022-03-13 20:22:55 Report Target points triggered 4个 device itself 2022-03-13 20:22:51 Report Target points triggered 4个 device itself 2022-03-13 20:21:08 Report Target trigger pow 1200 device itself 2022-03-13 20:20:37 Report Target trigger pow 2100 device itself 2022-03-13 20:16:11 Report Scene mode Custom device itself 2022-03-13 20:15:11 Report Scene mode Classroom/Corridor device itself 2022-03-13 20:13:25 Report Scene mode Sleep/Micro motion device itself 2022-03-13 20:13:05 Report LED Mode Normal Mode device itself 2022-03-13 20:12:08 Report LED Mode Slient Mode device itself 2022-03-13 20:10:45 Report Max Range 6m device itself 2022-03-13 20:09:58 Report Max Range 4m device itself 2022-03-13 20:09:44 Report Safe Range 0m device itself 2022-03-13 20:08:48 Report Safe Range 5m device itself 2022-03-13 20:08:28 Report Safe Range 3m device itself 2022-03-13 20:06:46 Report Closing Hesitation 10s device itself 2022-03-13 20:05:11 Report Closing Hesitation 30min device itself 2022-03-13 20:04:06 Report Closing Hesitation 5min device itself 2022-03-13 20:02:55 Report Closing Hesitation 2min device itself 2022-03-13 20:02:26 Report Presence State No detected device itself 2022-03-13 20:01:11 Report Presence State Presenced device itself

DPS [1]: Presence State {none,presence} DPS [103]:Closing Hesitation {case_0,case_1,case_2,case_3,case_4,case_5,case_6} case_0: 10 second case_1: 30 second case_2: 1 minute case_3: 2 minute case_4: 5 minute case_5: 10 minute case_6: 30 minute DPS [104]:Scene mode {case_0,case_1,case_2,case_3} case_0: Sleep/Micro motion case_1: Meeting/Office case_2: Classroom/Corridor case_3: Custom DPS [106]: LED Mode {normal,slient} DPS [114]: Radar switch {True,False}

If DPS [114] is False,Someone's coming and DPS [1] will not change.

If DPS [104] is case_3,Some detection parameters can be set:

DPS [101]:Safe Range {0_meters,1_meters,2_meters,3_meters,4_meters,5_meters,6_meters} DPS [102]:Max Range {0_meters,1_meters,2_meters,3_meters,4_meters,5_meters,6_meters,7_meters} DPS [107]:Target trigger pow {0-5000 step 100} DPS [108]:Target maintenance pow {0-5000 step 100} DPS [109]:Target triggered frames {0-20 step 1} DPS [110]:Interrupt frames {0-20 step 1} DPS [112]:Target points triggered {0-10 step 1} DPS [113]:Target points to maintain {0-10 step 1}

superman110 avatar Mar 13 '22 13:03 superman110

If this is a battery powered device, it may not be possible to support by local communication, as battery powered devices tend to only come online for a short period when they have something to report to the cloud.

make-all avatar Mar 15 '22 20:03 make-all

No, it's not battery powered and requires an external 12V power adapter

superman110 avatar Mar 16 '22 12:03 superman110

Support for this device is in 0.16.0

make-all avatar Apr 03 '22 08:04 make-all

Thanks,I tested that the sensor status cannot be updated in real time. I checked the log and refreshed the query status every 30 seconds, which is fatal for human sensors.

2022-04-03 22:23:11 DEBUG (SyncWorker_7) [custom_components.tuya_local.device] Refreshing device state for SD123 Human Presence Radar. ...................................................................................... 2022-04-03 22:23:41 DEBUG (SyncWorker_7) [custom_components.tuya_local.device] Refreshing device state for SD123 Human Presence Radar. ...................................................................................... 2022-04-03 22:24:11 DEBUG (SyncWorker_4) [custom_components.tuya_local.device] Refreshing device state for SD123 Human Presence Radar. ...................................................................................... 2022-04-03 22:24:41 DEBUG (SyncWorker_2) [custom_components.tuya_local.device] Refreshing device state for SD123 Human Presence Radar. ...................................................................................... 2022-04-03 22:25:11 DEBUG (SyncWorker_3) [custom_components.tuya_local.device] Refreshing device state for SD123 Human Presence Radar. ......................................................................................

superman110 avatar Apr 03 '22 14:04 superman110

Unfortunately that is the limit of this component. Polling tuya devices too frequently causes some of them to stop responding.

make-all avatar Apr 03 '22 19:04 make-all

I'm very sorry to hear that. Is there any other way to solve it? For example, only real-time query of sensor devices

superman110 avatar Apr 04 '22 13:04 superman110

For realtime updates, you need devices that push rather than waiting to be polled. Tuya devices push to the cloud. For local operation, they need to be polled, so they are limited in that respect. There do appear to be local periodic broadcasts, and if the device is pushing out a broadcast as soon as there is a change, that might work. But I have yet to investigate how to add a broadcast listener within Home Assistant (I had it on the roadmap for discovery of new devices, but it may be also useful for more responsive updates as well if the devices are doing things correctly).

make-all avatar Apr 04 '22 20:04 make-all