Could you awesome peeps here give me a hand please? I just cant get it through to 100%
The boolean sets to on when the machine starts, but doesnt turn it off when finished, so somewhere in between is something wrong.
If I manually turn if off sonos do the TTS. It seems like the timer isnât started like supposed to, and therefor doesnt finishâŠ
# Washer starts, W goes above 5, boolean sets to on
# If the machine isnt finished, it will go above 5W and cancel any active timer
- action:
- entity_id: input_boolean.tvattmaskin
service: input_boolean.turn_on
- entity_id: timer.tvattmaskin
service: timer.cancel
alias: TvÀttmaskinen startar
condition: []
id: 'Tvattmaskin1'
trigger:
- platform: template
value_template: '{{ states.switch.tvattmaskinen_3.attributes.current_power_w > 5 }}'
# Washer pauses, (or ends) W goes below 5W, Timer starts for 2min.
- action:
- service: timer.start
entity_id: timer.tvattmaskin
alias: TvÀttmaskinen stannar
condition: []
id: 'Tvattmaskin2'
trigger:
- platform: template
value_template: '{{ states.switch.tvattmaskinen_3.attributes.current_power_w < 5 }}'
# The washer was finished, timer ends and will set the boolean to off
- action:
- service: input_boolean.turn_off
entity_id: input_boolean.tvattmaskin
alias: TvÀttmaskinen stannar
condition: []
id: 'Tvattmaskin3'
trigger:
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.tvattmaskin
# The boolean sets to off, and Sonos tells us the washer is done.
- action:
- service: script.say
data:
delay: 00:00:05
volume: 0.2
message: TvÀttmaskinen Àr klar
where: media_player.vardagsrum
alias: TvÀttmaskinen talar
condition: []
id: 'Tvattmaskin4'
trigger:
- platform: state
entity_id: input_boolean.tvattmaskin
to: 'off'
Thanks for your input
The boolean isnât switching off when the laundry is done, if I turn it off manually in the frontend the Sonos speaks as supposed. So I tripped somewhere on the timer would be my guess
Sadly the snapshot/restore doesnt work on my Sonos right now, but thats another issue to be fixed later.
Tried your suggestion but still no success,
Seems like something is still broken⊠trying the template engine
TvÀttmaskinen drar just nu: {{ states.switch.tvattmaskinen_3.attributes.current_power_w }} W
gives me the output:
TvÀttmaskinen drar just nu: 4.355 W
(testing with a bulb right now)
So by creating:
{% if ("states.switch.tvattmaskinen_3.attributes.current_power_w" '> 5') %} PĂ„
{% else %} Av
{% endif %}
Gives me the output:
On
Which is wrong⊠?
And trying withâŠ
Det betyder att tvÀttmaskinen Àr: {% if is_state_attr('switch.tvattmaskinen_3', 'current_power_w', 'above: 4') %}
PĂ„
{% else %}
av
{%- endif %}
Gives me AVâŠ
What on earth am i templating wrong with this switch? It is reporting the wattage correctly.
Thatâs about the new approach I need help templating⊠I just canât get it to work.
As my switch reports W correctly and Iâve tried a few different approaches, I just cant get the condition to work.
TvÀttmaskinen drar {{ states.switch.tvattmaskinen_3.attributes.current_power_w }} W
{% if states('states.switch.tvattmaskinen_3.attributes.current_power_w') | float > 4 %}
PĂ„
{% else %}
Av
Gives me:
TvÀttmaskinen drar 4.398 W
Av
I just canât understand why HA is doing something wrong with the information it gets from the attribute.
Itâs clearly seeing the current wattage (thats why I use the first line)