Closed d-rez closed 9 months ago
Interesting! It seems like that project sets the target temperature to 0
to "turn it off". The only issue with doing something like a "Switch" to turn it on or off is that the "Target Temperature" would be set to 0 and the value would need to be stored elsewhere until it is turned on again. That might be a confusing behavior, but is definitely doable. Just a question of how best to implement it. Another option is using the "presets" requested in #45. Creating one for "Off" with a value of zero would work too.
I have tested setting it to 0
and it does seem to disable the heating. As test I created a switch entity in the branch feature/test-temp-control-switch
and it does seem to work well. The only issue is the target temp needs to be stored somewhere else as it can't be stored in the mug and it needs to persist across reboots in case you restart home assistant when it's off. Only way I have found so far is to store it in a file. It's not very clean, but it works.
Currently, the Target Temp sensor will show the saved value instead of zero, but changing it to something else will re-enable temperature control. I'm not sure if that's the best behavior, but that's what it is right now. I'm open to ideas.
This has been incorperated in release 1.0.0 so I'm going to close this, but feel free to open a new issue if it is not to your liking or you would like to suggest other things. Thanks!
Description
First of all thanks for writing this component!
I've noticed that other mug apps like Ember Supreme and https://github.com/zopieux/mugctl allow to disable/enable heating and that you've implemented
cold_no_control
andwarm_no_control
states, however there's (seemingly?) no option to disable heating in the component. I was wondering if there's already a way to do this or if that's something you were looking at implementing sometime in the future?This could be useful for certain automations or cases where the (empty) mug randomly decides to heat itself up for no good reason (had that happen once or twice)
Thanks!