vindaalex / multizone-thermostat

This is a home assistant custom component. It is a thermostat including various control options, such as: on-off, PID, weather controlled. The thermostat can be used in stand-alone mode or as zoned heating (master- satellites).
35 stars 6 forks source link

Feature request to improve passive_switch_check #23

Closed payo22 closed 7 months ago

payo22 commented 10 months ago

Hello. As the title says, I would love to see some additional config options to this feature (to prevent valves from being stuck). 1) The time could be configurable (although 2:00 AM works for me) 2) I would love if this could be defined to turn it on regardless whether it was operated during last XY hours/days. Something like force option (I often make changes to HA, reboot it, and reboot, I think, wipes that data. So I would like to just force it) 3) I noticed it opens valve for 30 seconds. I am using valves that take ~2-3 minutes to fully open. Therefore to be able to configure time for which it should stay opened?

Do you think these features would make sense? I must say that I have been using multizone-thermostat for last 2 winters (3rd coming) and I am very happy with it. I wanted to come up with my own "anti stuck prevention", however it is bit complex (since when thermostat is off, operating switch directly turns it off immediately. Therefore I need to turn it on, rise temperature to force it to open, and then return to previous state, which is not as simple as I would think. Not saying not doable, but clearly if this could work out of the box, it would be way better)

vindaalex commented 10 months ago

Hi payo,

Thank you for your feedback. I think your requests should be feasible. I have to think about the forced activation. I think best might be to store last activation by the thermostat and base a check on it.

vindaalex commented 9 months ago

A brief update. The thermostat now saves the last time it was requested by the routine to open a valve thus restarts will have no influence anymore. Also included the option to specify the duration of opening. However also found out that the coordination of thermostats need some checking. I hope to have mid next week a release.

stomko11 commented 9 months ago

This is awesome news and I would appreciate this feature myself too Have you considered adding something like "force" mode - just open it regardless of when was the valve opened last time?

vindaalex commented 9 months ago

The routine checks each night of the switch stale period is exceeded. When the system (master) is idle (no heating or cooling) it will run the routine. However when in summer cooling is active (or in winter heating) the switch is not allowed to open as it would start heat/cool. Then the routine is cancelled and next day it tries again.

So the force is (sort of) actually there already.

stomko11 commented 9 months ago

Understand. In my situation I am not using master thermostat, as this didn't work well in combination with heatpump, etc (state changes of master were not in-line with state changes of satellites, etc.). I just use thermostat for each zone and turn on/off my heatpump depending on the demand of any of zones. I do run that check every 5 minutes or so. This leads me to question - when valve opens at night as a prevention to stuck valve, does state of thermostat changes to "heating" or it just operates valve withour state change? Can you expose attribute in each thermostat when this stuck prevention is running? It gives flexibility... :-)

vindaalex commented 9 months ago

Understand. In my situation I am not using master thermostat, as this didn't work well in combination with heatpump, etc (state changes of master were not in-line with state changes of satellites, etc.).

It is worth to try again with the master as past year the whole routine has been overhauled. Now the master schedules the satellites to distribute the heat requirement evenly in time and the master switch only opening when heat is required. For a heat pump you should use the master with operation_mode "balanced" or "continuous". If you want to give it a try I think best to wait till the coming release.

This leads me to question - when valve opens at night as a prevention to stuck valve, does state of thermostat changes to "heating" or it just operates valve withour state change? Can you expose attribute in each thermostat when this stuck prevention is running? It gives flexibility... :-)

I'll check if it changes the HVAC state. In any case the attribute can be made, I'll include it.

Note, when you use it without the master there will be no check if Colling or heating is active and thus could result in unwanted situations like heating of rooms or in case of cooling condensation on pipes.

stomko11 commented 9 months ago

I may give it a try again after upcoming release.

vindaalex commented 9 months ago

I've placed a new version in the branch 'refactor' which has the option for:

Would you be able to test this version? I think next week I'll release it via HACS. link.

Please note that it has significant changes compared to the previous releases regarding operatien and some new functionality. See a new worked-out example in the [example](https://github.com/vindaalex/multizone-thermostat/tree/refactor/examples/multizone thermostat - explanation.yaml)

stomko11 commented 9 months ago

Awesome news. Thanks for that. However I may wait until it is released in HACS - it is easier for me to install rather than playing around with files now. Just an idea - maybe you could add beta branch (I have seen that on other integrations via HACS - when selecting "re-download" option, some have option to check beta versions and download beta (if available).

vindaalex commented 9 months ago

I've made a release of the latest version and a beta release. Hope that it works as I haven't used it yet.

stomko11 commented 9 months ago

So I found version 0.6 and 0.7beta. I guess 0.7beta is the one that has all the new refactored features. Therefore i have adjusted config to reflect new custom modes and passive switch check: Example:

 heat:
    entity_id: switch.underfloor_heating_1st_floor_4
    min_target_temp: 17
    max_target_temp: 28
    initial_target_temp: 20
    custom_presets:
      away_20: 20
      away_17: 5 
    passive_switch_duration: 
      days: 1
    passive_switch_opening_time:
      minutes: 7
    proportional_mode:
      control_interval:
        seconds: 180
      pwm_scale: 100
      pwm_threshold: 5
      pwm_duration:
        hours: 2
      PID_mode:
        kp: 100
        ki: 0.003
        kd: -220000
  sensor_stale_duration:
    hours: 12
  passive_switch_check: true

But it still gives me error about custom_presets

Invalid config for 'climate.multizone_thermostat' at climate_multi.yaml, line 99: 'custom_presets' is an invalid option for 'climate.multizone_thermostat', check: heat->custom_presets, please check the docs at https://github.com/vindaalex/multizone_thermostat
vindaalex commented 9 months ago

Did you perform the yaml config update and the multizone_upgrade both at the time and then rebooted? First after the upgrade a reboot is required before the yaml can be adjusted. After the yaml change you can use the reload in 'development'->'yaml config'.

However, I found a bug in the beta and therefore removed it again. The master pwm signal did not update correctly. I'm trying an update tonight and hopefully release a new beta tomorrow.

stomko11 commented 9 months ago

The error came after the restart - new beta, new config.

vindaalex commented 9 months ago

My apologies, it should have been extra_presets instead of custom_presets

vindaalex commented 9 months ago

A new beta version released v0.7.1-beta. Nesting bug has been solved

stomko11 commented 9 months ago

Thank you for this. I downloaded new beta and adjusted to extra_presets. I am not using master thermostat at this point as I would need to re-do my config and logic bit more. I am hoping to get some more free time to do that later. For now, I will observe how this works, especially passive switch check.

stomko11 commented 9 months ago

Hello. Little input from my side - would it be possible to define time of check? I am thinking that 2AM may not be ideal for everyone and looks like "easy" change?

Also qq regarding master - when heat is needed, does it only send "on" signal when needed, and then "off" when heat is no longer needed? Reason I am asking - I mentioned I am using automation that kicks off every 5 minutes and sends "on" if any of zones need heat. Directly on relay, I defined auto-off timer as a prevention that heater does not stay on indefinitely in case something goes wrong. I am thinking out loud here how could I achieve similar behavior.

vindaalex commented 9 months ago

Hello. Little input from my side - would it be possible to define time of check? I am thinking that 2AM may not be ideal for everyone and looks like "easy" change?

New beta version (v0.7.2-beta) released where the time for the stuck loop can be chosen. See readme and 'examples\multizone thermostat - explanation.yaml' detailed explanation.

Also qq regarding master - when heat is needed, does it only send "on" signal when needed, and then "off" when heat is no longer needed? Reason I am asking - I mentioned I am using automation that kicks off every 5 minutes and sends "on" if any of zones need heat. Directly on relay, I defined auto-off timer as a prevention that heater does not stay on indefinitely in case something goes wrong. I am thinking out loud here how could I achieve similar behavior.

See screenshot below for an example how scheduling works.

Good question regarding the fail safe of the thermostat. I think it would be better to seperate the master and related questions to in its own tread in the multizone page in HA community to keep this issue focussed to passive switch check. Are you oke with that?

afbeelding

stomko11 commented 9 months ago

Sure and thanks for your work. I have adjusted check time accordingly. It also looks like the HVAC state is not changing which is nice. I do not mind opening my valves daily it they have not been operated. I will open new feature request here on Github

vindaalex commented 7 months ago

Partly implemented in new version v0.7 where time of switch check can be specified. Closing this request. Please re-open in case of feedback.