I have an automation and timer set up to turn off a Wemo switch once it’s been on for a fixed period of time. (it’s running a kids electric blanket - to prevent it being left on overnight) When the timer runs out, the turn_off action is called; this turns the wemo off but then it immediately turns back on again. Otherwise HA controls the wemo perfectly; I can turn it off and on through the dashboard with no trouble.
The automation for turning off looks like this:
alias: N and M blanket off
description: ""
trigger:
- platform: time
at: "23:00:00"
- platform: event
event_type: timer.finished
event_data:
entity_id: timer.n_and_m_blanket_off
condition: []
action:
- type: turn_off
device_id: 223dce31f01c42c551926a5309a74a88
entity_id: switch.n_and_m_blanket
domain: switch
mode: single
(the only slight complication being that there’s a failsafe trigger to always turn it off at 23:00:00)
and the automation to start the timer looks like this:
alias: N and M blanket restart timer
description: ""
trigger:
- platform: device
type: turned_on
device_id: 223dce31f01c42c551926a5309a74a88
entity_id: switch.n_and_m_blanket
domain: switch
condition: []
action:
- service: timer.start
data:
duration: "7200"
target:
entity_id: timer.n_and_m_blanket_off
mode: single
There is another automation to cancel the timer in case the switch is turned off manually:
alias: N and M blanket cancel timer
description: ""
trigger:
- platform: device
type: turned_off
device_id: 223dce31f01c42c551926a5309a74a88
entity_id: switch.n_and_m_blanket
domain: switch
condition: []
action:
- service: timer.cancel
data: {}
target:
entity_id: timer.n_and_m_blanket_off
mode: single
and finally another one kicks the whole thing off at the same time:
alias: N and M blanket
description: ""
trigger:
- platform: time
at: "19:35"
condition:
- condition: state
entity_id: input_boolean.blankets_enabled
state: "on"
action:
- type: turn_on
device_id: 223dce31f01c42c551926a5309a74a88
entity_id: switch.n_and_m_blanket
domain: switch
mode: single
The logbook from yesterday looks like this:
N and M blanket turned off triggered by service switch.turn_off
21:35:04 - 13 hours ago - Sandy Brownlee
N and M blanket turned on triggered by automation N and M blanket off triggered by event 'timer.finished'
21:35:00 - 13 hours ago
N and M blanket turned off triggered by automation N and M blanket off triggered by event 'timer.finished'
21:35:00 - 13 hours ago
N and M blanket turned on triggered by automation N and M blanket triggered by time
19:35:00 - 15 hours ago
(you can see me turning the switch off manually after it turned itself back on).
The trace for the “turning off” shows the turn off/on happening:
…which leads me to believe there’s something weird on the HA rather than a fault with the Wemo itself. Is there anything wrong with the way I’ve configured things? Or a known bug with switches that causes this? I’ve looked for other examples of this happening but can’t find any.
I’m running Home Assistant Core 2022.12.1 on Raspbian 10, on a Raspberry Pi 4B.
Thanks!