Hello,
I’m trying to create temporary sensor which shows proper load power attribute from xiaomi switch. The problem I have with the switch is that it shows ‘None’ instead of 0.0W in it’s attributes. My code looks like that at the moment:
washing_machine_load_power_level:
friendly_name: Obciążenie mocy Pralka Łazienka
value_template: >-
{% if state_attr('switch.xiaomi_miio_switch', 'load_power') != ('unavailable' or 'unknown' or 'None') %}
0.0
{% else %}
{{ state_attr('switch.xiaomi_miio_switch', 'load_power') }}
{% endif %}
unit_of_measurement: "W"
but unfortuntely it shows 0.0W all the time (i checked the switch entity and it shows for example 1 in 'Load power" attribute. What am I doing wrong? Thank you in advance for any advice.