I’m pretty confident i’ve got the light bit set up properly (as i have others working on timers)… so i just need to know how to capture the xiaomi stuff i guess…
Yes I still need help please. I tried quite a bit to find a tutorial or something to teach me but didn’t find anything really. Glad to hear you’ve figured it out
So, the first node is an “All Events” node… which is basically saying to node-red "Listen to absolutely everything Home Assistant does and pass it to the next node.
The next one “Light Switches” is checking the msg.payload.entity_id that the “All Events” node sends, and if it is the entity ID of one of your xiaomi buttons, then it sends it down to the next node (Which one depends on which button is pressed)
The Xiaomi buttons have 3 click types… single, long and double… i don’t care how it’s pressed. so i just set all three types to do the same thing as you can see from the first image.
the last node is what actually turns the light bulb on and it does this by calling the service.toggle and sending it to the entity_id of the light bulb
I hope this makes sense… i tried to explain it how i would of liked it explained to me in the start… If you need more clarification or i’ve skipped a head too far, let me know.
I’ve added the code for the actual flow incase you want to import it and change it to suit :
Thank you danmed for taking the time to write out such easy instructions to follow. I tried adding the All Events node but when I do my Node Red keeps crashing. Sometimes it will work for a while and I will see all events except my Xiaomi Aqara Cube. The Xiaomi motion sensors, door sensors, and humidity sensors all work fine on their own with the “events: state” Home assistant node. I think maybe the cube is the problem. It never registers anything on the debug node like the rest of the xioami devices do.
The cube isn’t showing any debug and in the mii home app you cant add two actions on the same bulb…
Little bit disapointing. I mean you create 1 automation in the app (flip 90° toggle the bulb) then you cant add another automation (rotate by example to change brightness)…
I woke up this morning to find that all my xiaomi sensors are offline. not sure what is causing this. What are you all using for the sensors to connect to the gateway? I am using the Husbzb-1 stick.
I’m using the Xiaomi Gateway… i am running HA in an LXC container on a machine far too far away from the rest of the devices to be able to use a USB stick… (though i’d love to… the Xiaomi gateway does have a tendancy to occasionally shout at you in Chinese for no reason!)
I moved back to the Xiaomi hub, it seems to retain a better connection to the sensors. I am using a door sensor to turn on the hub’s light when the door is opened, but there seems to be a delay for the signal to get through - 10 second. Are you experiencing this? Any idea how I can resolve this because by the time the hub lights up the door is closed again.
Do you use the xiaomi motion sensor? I am trying to use this to activate a night lamp, the motion sensor does not always catch the motion.
ok, I don’t want the Chinese to know that there was motion. I currently have the hubs external access turned off. Do you have the external access enabled?
I found this also when running on a pi 3 it was chewing up all the cycles for sensors and polling there was too much lag for automation. I firstly moved all automation off to a dedicated pi which works really well and happen almost instantly. I had an sd card failure on my main one this week and moved over to a Intel nuc and this is way snappier again. Unless you are using a server with enough resources I would suggest running 2 instances one for sensors polling ui etc and one for automation and brokers.
You could get away with the celeron version for under $500aus so probably cheaper outside of Australia as we get gouged for everything. I actually went with an i5 version as I installed Ubuntu and use it for facial regonition and machine learning.
I’ve created a new topic recently about the xiaomi button sending duplicate messages.
Figured I’d ask here too, as those of you using nodered and xiaomi buttons would be here.
Anyone else recently notice duplicate messages being sent for the xiaomi buttons?
Here’s my topic: