Closed piznel closed 5 years ago
I also would like to know the answers to these questions. I did quite a bit of searching to find a good Xiaomi module for Node-Red. This one seems the best but still it seems to have some issues, or I'm doing something wrong.
Like:
Door opens... Message 1: status: open, previous status: close (correct) Message 2 (3 milliseconds later): status: open, previous status: open (why this message?) Door closes... Message 3: status: close, previous status: open (correct) Message 4 (2 milliseconds later): status: close, previous status: close (why this message?)
/edit: played around a bit more and suddenly I'm receiving 4 messages for each event, instead of 2. It's message 2 and message 4 of above example (the useless messages) that appears 2 times more. This can be handled by putting a RBE node on 'payload.status' before the debug node to filter out the duplicate messages, but things like that should not be necessary.
Hi @igdr would you be able to have a look at these issues?
Same problem here. I actually got 5 (almost) similar door opening messages. There were some initial messages that reported the door opening but had no battery status info, only the last three did.
I gave up on Xiaomi Gateway in combination with Node-RED as there doesn't seem to be a proper module. I now use it in Node-RED via Home Assistant which works flawlessly.
Hmm, I'm not too eager to have to configure another package ( HA )
I can understand that. In my case I'm already using HA and all my automations are in NR. Fortunately the integration between the two is superb, via this module: https://community.home-assistant.io/t/node-red-contrib-home-assistant-websocket/71032
I'll have a look at that, thanks.
Meanwhile, there seems to be something going haywire in the specific device code. The gateway itself is correctly sending only two messages so it seems. One for open and one for close. I'll run through the code to see if I can find out what is happening..
I will look at it this problem this weekend
The issue with duplicating messages has been fixed, the new version is 1.0.9. Could you check it up?
Hi, thanks for the fix. Did a quick test with a door sensor and ended up getting 3 messages, I guess it has to do with getting the battery level?
msg : Object object fromip: "192.168.1.208:4321" ip: "192.168.1.208" port: 4321 payload: object status: "open" previous_status: null voltage: null voltage_level: null time: 1552122873493 device: "zolder" _msgid: "7b03df92.11fb9" 09/03/2019, 10:14:34node: 8e1326ed.b5dbe8
msg : Object object fromip: "192.168.1.208:4321" ip: "192.168.1.208" port: 4321 payload: object status: "open" previous_status: "open" voltage: 3.075 voltage_level: "high" time: 1552122874731 device: "zolder" _msgid: "91d79223.8e3b1" 09/03/2019, 10:14:36node: 8e1326ed.b5dbe8
msg : Object object fromip: "192.168.1.208:4321" ip: "192.168.1.208" port: 4321 payload: object status: "close" previous_status: "open" voltage: 3.075 voltage_level: "high" time: 1552122875958 device: "zolder" _msgid: "bc912d15.72d89"
@realjax What you can do in NR is use a change node to move the status element to the payload and then a RBE-node afterwards to only handle messages with real status changes so you filter out that heartbeat message. I'll stick to HA, but thanks for your efforts @igdr
Also, I can actually skip heartbeat messages - just update voltage and do not pass the message to the node output
Hi. Thanks for the info. AFAIC I think it is fine the way it is. They are actual and valid messages being sent so it is up the user to handle them. I was just wonderin about the third message. Ive found it to be pretty difficult getting any info on the net about what messages are being sent by the gateway and messages you can send to it.
Close issue cause no activity
Hello, Congratulations on this work! I have a magic cube, several temperature sensors, opening alarms and switch. I have several questions: 1- Why in your diagram, did you connect the devices to the output of the gateway? By doing like you, I have several times the same payload per action on a device. 2-What are the nodes of the equipment for, because by putting the gateway alone, I get the same message? 3-could you share your processing function before the MQTT? Thank you in advance:)