Thanks a lot Francis… I’ve been looking for it before posting but couldn’t find it…
binary_sensor:
- platform: mqtt
name: 'RFremotebuttonA'
state_topic: 'RFbridge01/tele/RESULT'
value_template: >-
{% if value_json.RfReceived.Data == '510044' %}
{{'ON'}}
{% else %}
{{states('binary_sensor.rfremotebuttona') | upper}}
{% endif %}
off_delay: 5
Now the sensor (no device class) goes ‘On’ when pushing the remote button A and after 5 seconds gets back to ‘Off’.
I still have a problem with the automation for switching on a switch… (I know sounds very stupid and trivial but I’ve tried everything).
Automation doesn’t work either this way:
- id: '1578848075751'
alias: BUTTON A OF RFREMOTE
description: ''
trigger:
- entity_id: binary_sensor.rfremotebuttona
platform: state
to: 'On'
action:
- device_id: 953a0c1d89ca44cdb35aaef9caadf07c
domain: switch
entity_id: switch.sonoff_basic01
type: toggle
…or this way:
- id: '1578848075751'
alias: BUTTON A OF RFREMOTE
description: ''
trigger:
- entity_id: binary_sensor.rfremotebuttona
platform: state
to: 'On'
action:
entity_id: switch.sonoff_basic01
service: switch.toggle
Of course, if I force (trigger) the automation (either first or second version) the switch duly alternates ‘On’ and ‘Off’ state…
I have plenty of automations in my automations.yaml (none relevant with RFbridge inputs thought) and they all regularly working.
Sorry guys, I know we are talking about basics but cannot make it work…