I have some switches that I control using the command_line switch component i HA. These switches are 433Mhz and are controlled over http GET. I have no issues controlling these switches, problem is that I have some physical switches that also control these lights, so when I use them, the status displayed in HA is wrong.
To just keep sending the turn_on/off command doesn´t feel like clean solution. Is there a way I can use Node Red to simly update the state of the switch?
I found this, but haven´t had any success getting it to work.
If there is no way to simply update a state i HA, then I would be happy to know how I can send the turn_on/off command only when checked state has changed from last check
Hello jappish 84, Although I am not a great expert, but I know that 433 mhz sockets have no return channel, the current switching status of the socket can not be requested. Unfortunately, I do not see any solution to your problem. If the devices are connected to the network, you could use the “ping” node to see if the device is on or off, and then change the switch setting to HA with “Call Service”.
Thanks for the reply! I have a separate webserver that actually controls the 433 switches, and I can check the status of the switches either by using a python script I created, or the node red flow setup visible in the first post. Problem is, I don’t know how to change the status in HA without actually sending a switch on/off command. How can I only update the status in HA?
I had a similar problem umd I know that you can change the switching position of a switch in HA in the “dev tools” in “States” without an actual circuit is performed.
I had recently addressed my problem and Pippyn helped me a lot, but this will probably not solve your problem, but here is still the link to my problem. Can you have a look …
See post # 30 in the thread linked below. It explains how to change the state using Nodered. It involves installing the node-red-contrib-hass package which contains a hass-post node. Might be worth trying though there’s discussion about whether the api still allows this.
You need the websocket version. I had this problem, now it can communicate… not sure if it has the post to HA piece or not, but it can communicate with the long lived tokens.
Sorry, hadn’t had the time to test this until now. Unfortunately I can’t get this to work, I simply don’t understand what data I need to send to HA. I can successfully check the state of the switch, but what node should I use and what data do I send to HA?
I tried using the “Fire Event”-Node with the following data:
but nothing happens in HA, switch stays “off” even though server reports on.
EDIT:
Or if someone knows of a way to setup a node that only fires once on same message and ignores future messages until message has changed, I’d be interested in that aswell
EDIT2:
Managed to get around this by using the “rbe” node
I’m quite the beginner here, but:
I want to change the state if my Aqara vibration sensor to “off” after X seconds of being triggered and still can’t seem to find how to do that exactly.
For people who are not that familiar with NodeRed, APIs, “GET”, REST, “POST” commands, I suggest checking the “Set State” HACS approach shared on the links below. For me, this is by far the most straightforward approach.