cyberjunky / home-assistant-toon_climate

This component provides a climate device for rooted Toon thermostats.
MIT License
32 stars 8 forks source link

Possibility to add option set_operation_mode programOn & programOff #7

Closed Emacee closed 4 years ago

Emacee commented 4 years ago

Before the repository moved to be HACS compatible which is a great plus if you ask me, the following items was discussed:

https://github.com/cyberjunky/home-assistant-custom-components/issues/8

The option to have the schedule / program of the Toon turned off. I would like this option as it makes it possible to disable the thermostat when you are away all together and having it return to the correct setting as soon as you arrive back home, all without complex automations that are based on the time of day etc.

Is it possible to integrate this option into the component? I don't have that much coding experience but are willing to learn.

iiLaurens commented 4 years ago

+1 from me!

Also with Google Home Assistant integration, there are two operational modes: off and heating mode. You can't change the temperature when the mode is off (even though you can change it in hass or on the toon itself). And when you switch to 'heating mode' in google home then it actually turns on your Toon program! Is there a way to keep the program mode off?

cyberjunky commented 4 years ago

I have coded this, but it turns out to behave exactly like the current thermostat uit/verwarmen off/heating does. I don't see what is different.

So in my code below you can switch off schedule with 'off' preset, and when pressing 'on' it resumes, or if you made manual changes to preset it jumps back to the pre-programmed schedule option, so if you manually put it on 'home' while thermostat was 'off' and you switch 'on', it jumps to 'away' if that was the schedule setting based on time.

You can find the code below, can you try it? So it gives your preset mode 'on' and 'off', viewable in device params, or mini-thermostat gui.

climate.py.txt