I’m new to Home Assistant, after using Domoticz for the past 5 years. Wow, what an awesome platform Home Assistant is…!
I have a question about syncing wall switches states to bulb states, and couldn’t find a good answer online.
Situation:
Light bulbs: MiLight, integrated using esp8266 milight emulator hub.
Wall Switches: KaKu (klikaan klikuit) 433MHz, integrated using RFlink.
Node red Flow that listens for events with state changed for the 433MHz KaKu switches. If switch state is changed to On or Off, MiLight bulb goes On or Off. Also see picture below for the flow.
Problem:
When using home assistant to switch MiLight Bulbs, switch state of 433MHz KaKu switc doesn’t reflect the state of the Bulb. This results in the fact that a bulb can only switched off
by the 433MHz kaku switch after first pressing ‘On’, on the KaKu Switch. Otherwise, home assistant will not sent a state changed event, because 433MHz switch in HASS was already off.
(Temporary) Fix:
For now, I temporarily fixed it by making an extra flow in Node Red, that listens for state changed events of the bulbs, and sync it that way to the 433MHz switches. This results in
2 state changed events when turning a bulb On or Off in HASS. See picture below!
I have the feeling that this could be more easily done without two state changed events.
Let me see if I got this right.
You have a Milight bulb that you are controlling with an ESP8266.
And on the other hand you have a KaKu switch that acts as an emitter, RFLink receives the signal and HA acts on the bulb (through ESP8266).
It is right?
And your problem must be the representation of the KaKu switch in HA, since being in a wrong state it does not react correctly to state changes.
The RFLink integration don’t expose any service to change the device’s status (without triggering an action).
One option is for RFLink to ‘listen’ for events from a device alias, but being different integrations I don’t think this is possible.
Another option could be to define the KaKu switch as a light of type toogle and use a template to represent the switch. That way I guess you could modify the state of the template and no events would be fired from RFLink part.
So as you can see, no, I don’t see a simple alternative to the solution you already have implemented.
Thanks so much! Yes you are absolutely understand it correct!
Schematic:
Kaku wall switch --> rflink --> HAS <–> ESP8266 with milight emulator software —> milight bulb
Thanks for your suggestions on some other methods to implement a correct switch state for the dumb kaku wall switches, templating way sounds interesting and I’ll have a look at it
So, for everyone out there who faces the same issue someday…I managed to make it work like I wanted to. I hope it can be helpfull for you.
This setup assumes that represententation of 433MHz kaku switches state in Home Assistant is not important; Kaku wall switches acts like “button press” devices. In fact I just don’t look at the states of the switches in HASS at all. This automation works way quicker than my Node-Red method as in my first post.
Make an automation with the event ‘button_pressed’ as trigger and your desired action. E.g. I toggle lights connected to the switches. I don’t care about an ‘On’ or ‘Off’ command from the switch, but you can incorporate it too off course.