Hi everyone,
Probably a stupid question, but I’ll give it a try.
I’m experimenting with Sonoff RF bridge + tasmota to use small RF-remotes to toggle my lights.
I have created an automation that works: If I push button “A” on my remote, it sends code “FF5F71” to the RF receiver, and my lights toggle:
- id: sonoff_rfbridge_FF5F71_mqtt
alias: sonoff_rfbridge_FF5F71_mqtt
trigger:
- platform: mqtt
topic: "tasmota/tasmota-112/tele/RESULT"
payload: "FF5F71"
value_template: "{{ value_json.RfReceived.Data }}"
action:
- data:
entity_id: light.group_n00_p00
transition: 0
service_template:
homeassistant.toggle
Now I want to be a little bit more organized:
- define a sensor that reflects the RF-value
- toggle the light, everytime the sensor receives a value.
So I defined
Sensor
- platform: mqtt
name: "Sonoff RF bridge: RfReceived.Data"
state_topic: "tasmota/tasmota-112/tele/RESULT"
value_template: "{{ value_json.RfReceived.Data }}"
icon: mdi:chip
Grreat! I can see the RF-value on my dashboard.
However, if I create an automation like
- id: sonoff_rfbridge_FF5F71
alias: sonoff_rfbridge_FF5F71
trigger:
- platform: state
entity_id: sensor.sonoff_rf_bridge_rfreceived_data
to: "FF5F71"
action:
- data:
entity_id: light.group_n00_p00
transition: 0
service_template:
homeassistant.toggle
it only toggles my lights if there is a change in state.
So if I want to toggle my lights: I first have to press another button, and than my button “A” again. So by simply pressing “A”, my sensor does not change it’s value, so the automation is not triggered.
Any suggestions how I could achieve this?
Thus: every time a sensor gets a certain value, trigger an automation? Even when the received value is the same as the previous value?
sorry for my ignorance,
kind regards,
Bart Plessers