Using a PIR motion sensor, which sends only one RF code, I would like to change the status text on the card. Now it shows “Niet gedetecteerd” (not detected) and “Gedetecteerd” (detected) and I cannot change it. The code below works when using it with a Philips Hue sensor but not with the PIR sensor:
# Change text motion sensor status
sensor:
- platform: template
binary_sensor_aanrecht:
friendly_name: "Aanrecht"
value_template: >-
{% if is_state('binary_sensor_aanrecht', 'on') %}
Beweging
{% else %}
Geen beweging
{% endif %}
icon_template: >-
{% if is_state('binary_sensor_aanrecht', 'on') %}
mdi:run-fast
{% else %}
mdi:motion-sensor
{% endif %}
The PIR sensor is connected over MQTT with a Sonoff/Tasmota bridge. This is the relevant code:
# PIR Sensor
binary_sensor aanrecht:
- platform: mqtt
name: 'Aanrecht'
state_topic: 'tele/SonoffRF1/RESULT'
value_template: '{{value_json.RfReceived.Data}}'
payload_on: 'B42666'
payload_off: 'B42666off'
device_class: Motion
Would be great to read what I am doing wrong!