I have a BLE sensor attached to a remote HA instance which sometimes times out. When this happens, I want to use the main HA instance (provided the BLE sensor is in range) to show the BLE value.
I have seen many contradicting examples over this forum and reddit but none seem to work for me… I have tried == none None unknown Unknown unavailable Unavailable and nothing works for me. In HA Lovelace is shows as Unknown
What is the correct syntax?
configuration.yaml
sensor:
temperature_kitchen:
friendly_name: 'Kitchen Temperature'
unit_of_measurement: °C
value_template: >
{% if states('sensor.pz_ble_temperature_kitchen') == "Unknown" %}
{{states('sensor.ble_temperature_kitchen')}}
{% else %}
{{states('sensor.pz_ble_temperature_kitchen')}}
{% endif %}