I needed eyes on this.
Been P—ing me off for a day now.
The sensor flips correctly, but the icon won’t change.
I waited until today when the dryer would cycle to check it again, and everything worked fine except the icon does not change to off when the sensor turns off.
It may or may not be obvious but this is in the template / binary_sensor ‘domain’
#####################################################
# Dryer State #
#####################################################
- name: "Dryer Running"
unique_id: 4105191d-d7b4-4e60-1142-715847353f33
state: >-
{# Flip sensor for better visual state. #}
{% set dr_st = is_state('binary_sensor.dryer', 'off') %}
{% if dr_st %}
true
{% else %}
false
{%- endif %}
delay_off:
minutes: 1
availability: >-
{% from 'availability_template.jinja' import avail %}
{{- avail(['binary_sensor.dryer']) | bool -}}
attributes:
friendly_name: "Dryer Running"
icon: >-
{# Flip sensor for better visual state. #}
{% set dr_st = is_state('binary_sensor.dryer', 'off') %}
{% if dr_st %}
mdi:tumble-dryer
{% elif not dr_st %}
mdi:tumble-dryer-off
{% else %}
mdi:tumble-dryer-alert
{% endif %}
I do similar with the washer, different, but the same is and it all works fine…
#####################################################
# Washer State #
#####################################################
- name: "Washer Running"
unique_id: a735192a-271a-4c27-83ea-c25d342652b2
state: >-
{# Set the variable. #}
{% set wm_amps = states('sensor.wash_machine_energy_current') | float(0.07) %}
{# Create a dead zone to prevent oscillations. #}
{%- if wm_amps > 0.16 %}
true
{%- elif wm_amps < 0.077 %}
false
{%- else %}
{{ states('binary_sensor.washer_running') }}
{%- endif %}
delay_off:
minutes: 5
auto_off:
hours: 1.5
availability: >-
{% from 'availability_template.jinja' import avail %}
{{- avail(['sensor.wash_machine_energy_current']) | bool -}}
attributes:
friendly_name: "Washer Running"
icon: |
{# Set the variable. #}
{% set wm_amps = states('sensor.wash_machine_energy_current') | float(0.07) %}
{# Set the icon #}
{%- if wm_amps > 0.16 %}
mdi:washing-machine
{%- elif wm_amps < 0.077 %}
mdi:washing-machine-off
{%- else %}
mdi:washing-machine-alert
{%- endif %}
But even when off the Dryer has the same icon.
And with the washer running normal