hrietman / node-red-contrib-xiaomi-devices

node-red extension to integrate Xiaomi gateway devices
15 stars 28 forks source link

Data not coming through #9

Open depaljas opened 3 years ago

depaljas commented 3 years ago

Hi, thanks for setting up these nodes. I've tried using them but the messages are not coming through. image The 'raw' and 'json' debug nodes register the messages just fine, but the 'sensor_json' is not picking up anything. I've double checked the sids in the configurator, and the nodes pick up the configurator OK: image

depaljas commented 3 years ago

Here's an example output of the debug node 'json': image

depaljas commented 3 years ago

From /var/log/syslog I do see what appear valid events up to that point:

Feb 28 13:03:20 raspberrypi Node-RED[11734]: 28 Feb 13:03:20 - [info] [xiaomi-ht:sensorterras] Received message from: weather.v1 sid: (sid_of_sensorterras) payload: {"temperature":"1091"} Feb 28 13:03:20 raspberrypi Node-RED[11734]: 28 Feb 13:03:20 - [info] [xiaomi-ht:sensorgarage] Received message from: weather.v1 sid: (sid_of_sensorterras) payload: {"temperature":"1091"} Feb 28 13:03:20 raspberrypi Node-RED[11734]: 28 Feb 13:03:20 - [info] [xiaomi-ht:sensor_slaapkamersi] Received message from: weather.v1 sid: (sid_of_sensorterras) payload: {"temperature":"1091"} Feb 28 13:03:20 raspberrypi Node-RED[11734]: 28 Feb 13:03:20 - [info] [xiaomi-ht:sensor_slaapkamerir] Received message from: weather.v1 sid: (sid_of_sensorterras) payload: {"temperature":"1091"}

depaljas commented 3 years ago

Seems model names have changed, local fix e.g.:

< if (payload.sid == node.sid && (payload.model == "motion") {
> if (payload.sid == node.sid && (payload.model == "motion" || payload.model == "sensor_motion.aq2")) {
Sungtroll commented 2 years ago

Hi. I had to rename "weather.v1 to "sensor_ht" to get it to work. Please make it possible to configure the temperature node to different sensor model and even include the 3rd output pressure as my Aqara sensors have temperature, humidity and pressure.

Original message that does not work: "cmd":"report","model":"weather.v1","sid":"158d00044afb","short_id":65098,"data":"{\"temperature\":\"2467\"}"} Modified message that works. "cmd":"report","model":"sensor_ht","sid":"158d00044afb","short_id":65098,"data":"{\"temperature\":\"2467\"}"}

I use a function node between the json node and the temperature node to change it so it works with temperature node.

image