Generic Thermostat Turns Off At 4am

Hello,

I’m fairly new to Home Assistant and have been trying to integrate a few automations. My current system is Home Assistant Core running on an unRAID docker, as well as a Zigbee2MQTT and MQTT docker (and ZHA running for my Z2M unsupported wafer leds). I have Adaptive Lighting running and working great as well as a motion sensor for some lights.

Recently I set up a themostat for my bedroom electric heater. It’s an in-wall 2000W, 240V heater that I’m controlling with a Sonoff ZBMINI and a separate 240V, 30A relay. The temperature sensor being used is an Aqara temp/humidity sensor. The yaml config is as follows:

climate:
  - platform: generic_thermostat
    name: Bedroom
    heater: switch.zbmini_d
    target_sensor: sensor.aqara_temp_sensor_a_temperature
    min_temp: 64
    max_temp: 72
    ac_mode: false
    target_temp: 68
    cold_tolerance: 0.3
    hot_tolerance: 0
    initial_hvac_mode: "off"
    away_temp: 66
    precision: 0.1

I’ve had it running for 2 days, and it does a great job maintaining the set temperature. Except for around 4am where the thermostat is actually switched “off”. This happened 2 days ago when I first made the automation, and last night. The Aqara sensor still reports fine, so I’m not sure what the issue is. No other automations use the ZBMINI. Any thoughts?

image

This is the history for the thermostat:

Could you post the registry of the thermostat?

What do you mean by this?

Also scan you logs, maybe you can see, who or what turned it off…

This page for the thermostat that turned off at 4AM

Perhaps this is a translation issue.

Logbook.

1 Like

I’m sure you’ll get this working. If the clunk of the relay ever becomes a noise issue in a bedroom, there are no-neutral line voltage thermostats that integrate to HA. Eg. Sinope.

The advantage of being quiet comes with partial wattage modes as well. At the cost of no neutral parasitic usage when not heating.

I actually have the relay down by the breaker panel, so its just as quiet as the normal heater. Going to eventually get rid of it and add my regular boiler to that room.

Yep, there’s nothing there besides when I manually turned on the heat. Does not log any “turned off” events at that time.

Well, it looks, like the heater stops right at the moment, when somehow the target temp goes up. I guess, it is not you, who sets it higher?

Ah okay, found the problem. Home assistant itself turned off for 7 minutes at 4am:

Home Assistant stopped

4:00:07 AM - 10 hours ago

Home Assistant started

4:07:11 AM - 9 hours ago

Might start a different thread if I can’t figure out whats restarting HA. I’ll have to see if it’s the docker or HA itself.

That makes sense. After a HA restart the generic thermostat comes back in OFF state and sets the defined target temperature. Normal behavior. That is, what I see happening there. :wink:

In the short term, how would I set the default state to “on” for the thermostat?

Make an automation

alias: restart heater after HA restart
description: ''
trigger:
  - platform: homeassistant
    event: start
condition: []
action:
  - delay:
      hours: 0
      minutes: 3
      seconds: 0
      milliseconds: 0
  - service: climate.turn_on
    target:
      entity_id: climate.YOURNAME
mode: single
1 Like

Just try it after you set it please, I did not tested this :stuck_out_tongue:

So after you make the automation and set it active, manually restart HA to see, if it works :wink:

This works as expected, HA reboots and the service turns on. Thank you!

1 Like

As a side note, the issue was all my docker containers on unraid were being backed up at 4am and restarting.

Why not just edit generic thermostat and configure

    initial_hvac_mode: "off"

accordingly to desired mode?