Control light with HA as well as 433Mhz remote control

Hi there,

I have a 433Mhz remote controlled light, which I want to control via HA and via remote control.

There is only one single command for toggeling the light ON or OFF and there is no feedback on the action or status. The command is sent via MQTT. For this I created the script “light_toggle”.

Now I am unsure about the most prudent way for:

  • Having one switch in HA which I can use for switching the light on or off
  • But also reflecting the ON or OFF status, which can either be triggered by HA or by remote

I assumed creating a helper switch and link two automation on it might be helpful:

  1. Automation: Run script “light_toggle”, if helper switch is triggered in HA
  2. Automation: Change status of helper switch, if remote control command is received

Here I need to make sure the 1. Automation is not triggered, if 2.Automation runs due to remote control command. Otherwise the remote turns light on and right afterwards 1. Automation triggers 1. Automation and turns the light OFF again.

Do you have any advice how to do so?
Thanks and regards!

433Mhz device do not give feed back as to the status of the device. The only way that you could make this happen would if this light is in say a lamp and that lamp is plugged in to an outlet that has power monitoring, you could monitor for power letting you know the light is on. But, if this light is in lets say a ceiling fixture, there really isnt anyway to accomplish this that I can think of. But now that I think of it you might be able to some how to use a light monitor, food for thought.

I (have to) rely on each command will be transferred into switching the light. My question is which structure to set up in order to have the switch controlling the light as well as changes status, if the remote sends a command.

It will be extremely unreliable, for example when the remote is in reach of the lamp but isn’t with ha, this will create a mismatch. But you are on the right track assuming you have something connected to ha which can both send and receive rf signals. Btw if it is a ceiling lamp one could add a shelly to it to measure the power.

Maybe a Tasmota’ed Sinoff RF bridge would be an option.
It’s cheap, so not a big loss if it can’t work.
I use mine for recieving RF signals from remotes and sending RF signals to devices, so it should be able to do what you need.

Apologies for late reaction. I have been quite busy recently and worming up the topic delayed.

Regarding reliability I am aware, but I need to deal with the situation as it is and fortunately the RF transceiver is located right next to the light to control, so I have to assume either light and tranceiver are both receiving the signal or none auf them.

I am more wondering about the software structure within HASS. As explained in first post I currently plan to set up two automations:

  1. Run script “toggle_light“, when helper switch is toggled via HASS visualization

  2. Toggle the helper switch, when “Remote_signal received“ BUT do not run script “toggle_light“ as part of 1. automation (This automation is intended to reflect the correct on/off status of the light at the helper switch)

I am wondering how to set up condition in 2nd automation (to only control helper and not the actual light). If this is not in place a remote command would turn on the light (without HASS involved) but immediately afterwards condition 2 toggles helper switch, which turn off light again due to condition 1.

I hope my problem is clearly described and you are able to help me.

Thanks a lot!

So you want a helper set up as light.
Then you want a script to set the helper to on.
You also want a script to send the RF command to turn the actual light on.

Now you need an automation that when recieving a click in HA activates both scripts above.
You also want an automation that when recieving the RF command from the remote will activate only the turn on script for the helper.

You then need all the same parts for turn off.

In case your light helper gets out of sync, then an extra click on either remote or HA should correct it.

Thanks for the reply

I think right here I have the issue. For the automation I added condition (ID) “Triggerd by”. A warning appears: No trigger has an ID set for it. You can set an ID using the button in the Trigger menu. (Translated from German). Ignoring that and edit YAML to:

condition: trigger
id: "input_boolean.licht_abzugshaube_virtuell"

will prevent the automation to run. The helper does have an ID - the one I erntered.

I managed to assign id, by clicking the three dots on top of “Trigger”

platform: state
  - input_boolean.licht_abzugshaube_virtuell
id: input_boolean.licht_abzugshaube_virtuell

However both automations run, if HASS receives remote control signal (via MQTT)

Does anybody have an advice how to configure automation in order to only run it in case of changes of the helper switch by visualization (Hass, Homekit or Alexa) and no action if helper switch status is changed by other automation?

Thanks a lot!