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
If it indicates Unknown in the Lovelace UI then in Developer Tools > States it will be displayed as unknown (all lowercase) which is its actual state value.
sensor:
- platform: template
sensors:
temperature_kitchen:
friendly_name: Kitchen Temperature
unit_of_measurement: "°C"
value_template: >
{% set t1 = states('sensor.pz_ble_temperature_kitchen') %}
{% set t2 = states('sensor.ble_temperature_kitchen') %}
{{ t2 if t1 == 'unknown' else t1 }}
Please consider marking my post above with the Solution tag. It will automatically place a check-mark next to the topic’s title which signals to other users that this topic has been resolved. This makes it easier for users to find answers to similar questions. For more information refer to guideline 21 in the FAQ.
Say Taras… you’re kinda smart… is it possible to set up sensors something like this? Or not possible with sensors…?
ble_sensors = {‘kitchen’ : ‘pz_ble_temperature_kitchen’, ‘ble_temperature_kitchen’, ‘ben’ : ‘sensor.pz_ble_temperature_ben’, ‘sensor.ble_temperature_a4c13825e91f’ }
for name in ble_sensor.name():