Dear all,
I’ve got a TP-Link HS110 connected to my Hassio install and set up a sensor to show the amount of Watt:
- platform: template
sensors:
retro_watts:
value_template: '{{ states.switch.attick_retro.attributes["current_power_w"] | replace(" W", "") | float }}'
unit_of_measurement: 'W'
That part is working perfectly, but I want to a trigger that turns off the HS110 if it’s below 12 Watt for 30 seconds. That part doesn’t work. It sometimes triggers, but most of the time it doesn’t:
- id: '1540494169288'
alias: Turn off Switch for Retro
trigger:
- platform: numeric_state
entity_id: sensor.retro_watts
below: '12'
for:
seconds: 30
condition:
- condition: state
entity_id: switch.attick_retro
state: 'on'
- condition: state
entity_id: media_player.sony_XXXX
state: 'off'
action:
- service: switch.turn_off
entity_id: switch.attick_retro
Could someone help me figure out what I’m missing? Thanks in advance for all the help!