ScratMan / HASmartThermostat

Smart Thermostat with PID controller for HomeAssistant
336 stars 48 forks source link

Disabled thermostat turns off switch when manually turned on. #136

Closed mtausk closed 9 months ago

mtausk commented 1 year ago

Describe the bug When the termostat is turned off and I manually turn on heater, the thermostat turns off the heater after it discovers the entity is on.

Similar issue is described here: https://community.home-assistant.io/t/random-service-homeassistant-turn-off/281671/18

To Reproduce Steps to reproduce the behavior:

Expected behavior

When I turn off thermostat, it should stay disabled and allow other possibilities to turn the heater/ac switch on without further interference (eg. automations or manual switch on).

Expected behavior would be when I turn on the thermostat, it turns off the entity and after successful entity switch-off, it should stop watching switch status of the entity, ie. thermostat should "disable" itself or at least stop meddling with the switch...

This is written to the log: 2023-03-02 17:30:46.041 INFO (MainThread) [custom_components.smart_thermostat.climate] climate.konvektor_detska1_pid: Turning OFF switch.konvektor_detska_1

The logbook says: "Turned off by service homeassistant.turn_off"

Screenshots obrázok

Version Current / 2023.2.1

Desktop (please complete the following information): Not applicable

Smartphone (please complete the following information): Not applicable

Thank you!!!

ScratMan commented 1 year ago

This has been added on purpose. An issue has been raised in the past requesting the switch to be forced synced to the thermostat, otherwise the heater could be locked in on state.

As a workaround, you may use a Boolean helper as heater entity in the thermostat with an automation to turn on or off your real heater when helper's state toggles. Then by disabling the thermostat, the helper will remain off, the automation will not be triggered and you'll be able to set the heater on or off manually.

mtausk commented 1 year ago

First of all, thank you for your answer.

Workarounds are there to work-around an existing problem. I have lots of integrations in my homeassistant, but no workaround since everything is working independently and as designed.

I kindly ask you to reevaluate this issue. What are the odds and possibilities that the switch would remain in on state when you turn off the thermostat? I believe that it should be possible to disable everything that has any influence on entities, just as you can disable automations, for instance - otherwise it can interfere with other intentions and have other consequences. Can you point me to the past problem due to which this is now forced?

So, with the past problem (requesting the switch to be forced synced to the thermostat) another problem has been introduced and so far a workaround is proposed. However, what needs to be reevaluated is this:

Please, let's think about how this can be solved for both sides.

ScratMan commented 1 year ago

Understand, I'll look for a way to add a parameter to force sync heater off when thermostat is disabled only if required.

ulicskad commented 1 year ago

This feature tricked me :) I have got 4 PID climate for my 4 room, but the heater switch are common. Only 1 PID can be turned on, others switches off automaticly. In the last 2 years it was working well, but after the last update the heater keeps turning off every 30 seconds. It was a few cold days while i figured out what happened. (Also my floor heating pid worked well...). If this feature could be configurable, that would be great. Also great work with the thermostat, i like it very much, and saves me a lot of gas price. D

AnduriI commented 1 year ago

@ScratMan is there now the option to disable the force_OFF behaviour? As described in https://github.com/ScratMan/HASmartThermostat/issues/86 I would really like to have PID for heating on room level, but also have the option to cool without restart of HA. The easiest way would be to manually set the valve (or with an automation) where cooling is wanted. I don't need PID for cooling as my heatpump is doing that according to the outside temperature for the complete house.

ScratMan commented 1 year ago

For #86 , it's work in progress, I can switch the mode from heat to cool via a service, but the heater entity still acts as a pure heater, enabling when temperature is below setpoint even in cooling mode.

ScratMan commented 12 months ago

Hi, v2023.7.0-beta1 is available with the new force_off_state parameter. You can switch to this pre-release by enabling "beta versions" in HACS download screen. I will make the final release if the pre-release is confirmed to work well. Thanks.

AnduriI commented 10 months ago

Thank you, that fix works. I think this can be closed now.