Hi all,
I’m having an issue with a plug not turning off or staying on too long while using the countdown timer. I’m unsure if it’s an automation (user) issue or a container restart issue.
The plug runs a heater overnight when cold. From 12:00am until 7:00am, if the temperature falls below a threshold, the switch is turned on and the countdown timer set for 1 hour.
Additionally, when the plug is manually toggled, I have an automation that sets the countdown for an hour (this keeps the heater from running too long if someone switches it on and forgets or leaves).
The last part of this is that at 1:30am, the Home Assistant and Zigbee2MQTT containers are stopped so backups can be synced offsite, and then restarted. This can happen while the plug is on and timer is counting down.
I noticed the heater on way to long one night so set the “power outage memory” to off, to see if that would help, but it doesn’t. I guess that is irrelevant of HA being restarted.
Questions:
- Is it bad to have the overnight automation set a countdown AND the manual switch set one?
- Is there a correct way to deal with HA/MQTT resets in these situations?
Here are the relevant automations:
alias: Overnight bedroom heat
description: ""
triggers:
- trigger: numeric_state
entity_id:
- sensor.bedroom_thermastat_temperature
for:
hours: 0
minutes: 10
seconds: 0
below: 12
id: temp
- trigger: time
at: "00:00:00"
id: time
conditions:
- condition: or
conditions:
- condition: and
conditions:
- condition: trigger
id:
- temp
- condition: time
after: "00:00:00"
before: "04:30:00"
- condition: and
conditions:
- condition: trigger
id:
- time
- type: is_temperature
condition: device
device_id: 1a9a1a0c5e507cb2f9f26f8f61a2e489
entity_id: 1a6d06ec66f8d36cb0e8c8fc563fc019
domain: sensor
below: 12
actions:
- type: turn_on
device_id: a91e70912520dc28809bbf1e81954a54
entity_id: bdf2cd712a60c2f2001b11af3ad30d2f
domain: switch
- action: number.set_value
metadata: {}
target:
entity_id: number.bedroom_plug_countdown
data:
value: "3600"
mode: single
alias: Bedroom plug manual timer
description: ""
triggers:
- type: turned_on
device_id: a91e70912520dc28809bbf1e81954a54
entity_id: bdf2cd712a60c2f2001b11af3ad30d2f
domain: switch
trigger: device
conditions: []
actions:
- device_id: a91e70912520dc28809bbf1e81954a54
domain: number
entity_id: afb0347c86ac3239a9f16c6dfebacea1
type: set_value
value: 3600
mode: single
And here’s the activity. (I have a similar automation that does the same as the Overnight, but just at 9pm) So at 9pm it was turned on and that automation set the countdown to 1hr. Then at 9:30 I restarted HA & MQTT. You can see the switch be marked as on again at 9:31 which triggers the “manual automation” timer.
Is my best option to remove the countdowns from the night time automations and just leave it on the “manual automation”? What else am I misunderstanding?
