hemphen / clevertouch

API for controlling Touch E3-connected radiators via CleverTouch cloud accounts
MIT License
2 stars 1 forks source link

Update radiator.py #3

Closed hasselrot closed 1 year ago

hasselrot commented 1 year ago

Add boost as an available heat mode

hemphen commented 1 year ago

How does the boost mode work? I never used it myself.

I was under the impression it is activated for a certain period. Can the period be pre-defined "outside" the library (much like the program schedule)? If it is at all useful to be able to switch it on with the pre-defined period I am happy to merge. I guess one ideally would like to be able to set the period from within the library?

One minor thing though, shouldn't the boost temperature setting be removed from the _READONLY_TEMP_TYPES at least?

hasselrot commented 1 year ago

Yes, you are correct!

It will set the radiator to "TempType.BOOST" for the duration of "time_boost".

This is how I did it with a Curl: /usr/bin/curl -s https://e3.lvi.eu/api/v0.1/human/query/push/ --data-raw "token=1234567890&context=1&smarthome_id=12345&query%5Bid_device%5D=C003-002&query%5Btime_boost%5D=7200&query%5Bconsigne_boost%5D=770&query%5Bconsigne_manuel%5D=770&query%5Bgv_mode%5D=4&query%5Bnv_mode%5D=4&peremption=20000&lang=sv_SV"

And that works, setting the boost to 7200 seconds. Not really sure where or how to put that in to the code.

I think there could be 2 options:

You are also correct about the READONLY_TEMP_TYPES, I missed that one! Will commit.

hemphen commented 1 year ago

I think it's a good idea to implement the timer value with read and write capability in the API to start with. Since it is present for the devices at all times regardless of the boost is active or not that should be easy. One maybe need to test what happens if one changes the timer value without changing mode etc.

For the HA integration it is probably easiest to implement it as a number just like the temperatures. Maybe use hours as unit. One need to know what one's doing when using it, but at least the functionality is there for both reading and writing.

I will be away a few days over Easter but I can look into the setting / slider thing afterwards if you're uncertain how to do it.

hasselrot commented 1 year ago

No rush!

My python kung fu is quite limited :) But I will help with testing!

On Fri, 7 Apr 2023 at 11:58, hemphen @.***> wrote:

I think it's a good idea to implement the timer value with read and write capability in the API to start with. Since it is present for the devices at all times regardless of the boost is active or not that should be easy. One maybe need to test what happens if one changes the timer value without changing mode etc.

For the HA integration it is probably easiest to implement it as a number just like the temperatures. Maybe use hours as unit. One need to know what one's doing when using it, but at least the functionality is there for both reading and writing.

I will be away a few days over Easter but I can look into the setting / slider thing afterwards if you're uncertain how to do it.

— Reply to this email directly, view it on GitHub https://github.com/hemphen/clevertouch/pull/3#issuecomment-1500137372, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBC6PCSXYEGT5PSZ24L2ATW77QOBANCNFSM6AAAAAAWUN6XRU . You are receiving this because you authored the thread.Message ID: @.***>

-- Sent from Gmail Mobile

hemphen commented 1 year ago

I have made some limited tests on what works and what doesn't over the API. These added functions in the two commits - one for reading and one for writing - will cover the needs of the home assistant integration. I will proceed with that next.

hasselrot commented 1 year ago

Awesome! Let me know when to test!

hemphen commented 1 year ago

I have made a beta release in https://github.com/hemphen/hass-clevertouch/releases/tag/v0.4.0b1

Heating season seems to be almost over :) but would be great if you tried it out @hasselrot. (Betas are well hidden but available through HACS.)

Boost mode and Home Assistant is not a perfect match (and the CleverTouch service is bit slow as usual). But at least he functionality is there and you can probably customize HA for most use cases. Check out the service call for custom actions.

hasselrot commented 1 year ago

From what I can see, it works like a charm! Slow, but like you said, it is to be expected from CleverTouch.

On Mon, Apr 17, 2023 at 8:12 PM hemphen @.***> wrote:

I have made a beta release in https://github.com/hemphen/hass-clevertouch/releases/tag/v0.4.0b1

Heating season seems to be almost over :) but would be great if you tried it out @hasselrot https://github.com/hasselrot. (Betas are well hidden but available through HACS.)

Boost mode and Home Assistant is not a perfect match (and the CleverTouch service is bit slow as usual). But at least he functionality is there and you can probably customize HA for most use cases. Check out the service call for custom actions.

— Reply to this email directly, view it on GitHub https://github.com/hemphen/clevertouch/pull/3#issuecomment-1511859827, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBC6PCZ7DB7YLU5MRPDBBDXBWB2HANCNFSM6AAAAAAWUN6XRU . You are receiving this because you were mentioned.Message ID: @.***>

hemphen commented 1 year ago

Great! Let’s leave it like this then!

I was experimenting a bit with setting the end time instead of the duration (which “feels” more natural to me) but that can still be achieved via scripting. Decided to keep the functionality close to what the API provides.

Thanks for helping out!

On Mon, 17 Apr 2023 at 20:32 Lars Hasselrot @.***> wrote:

From what I can see, it works like a charm! Slow, but like you said, it is to be expected from CleverTouch.

On Mon, Apr 17, 2023 at 8:12 PM hemphen @.***> wrote:

I have made a beta release in https://github.com/hemphen/hass-clevertouch/releases/tag/v0.4.0b1

Heating season seems to be almost over :) but would be great if you tried it out @hasselrot https://github.com/hasselrot. (Betas are well hidden but available through HACS.)

Boost mode and Home Assistant is not a perfect match (and the CleverTouch service is bit slow as usual). But at least he functionality is there and you can probably customize HA for most use cases. Check out the service call for custom actions.

— Reply to this email directly, view it on GitHub https://github.com/hemphen/clevertouch/pull/3#issuecomment-1511859827, or unsubscribe < https://github.com/notifications/unsubscribe-auth/AEBC6PCZ7DB7YLU5MRPDBBDXBWB2HANCNFSM6AAAAAAWUN6XRU

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/hemphen/clevertouch/pull/3#issuecomment-1511882678, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABS3PURLFW3TMR4NXMRIT3DXBWEDBANCNFSM6AAAAAAWUN6XRU . You are receiving this because you modified the open/close state.Message ID: @.***>

hasselrot commented 1 year ago

Yeah the rest can be fixed using home assistant.

Thank you for a great integration, and hope more people find this useful!

On Mon, Apr 17, 2023 at 8:37 PM Michael Hemph @.***> wrote:

Great! Let’s leave it like this then!

I was experimenting a bit with setting the end time instead of the duration (which “feels” more natural to me) but that can still be achieved via scripting. Decided to keep the functionality close to what the API provides.

Thanks for helping out!

On Mon, 17 Apr 2023 at 20:32 Lars Hasselrot @.***> wrote:

From what I can see, it works like a charm! Slow, but like you said, it is to be expected from CleverTouch.

On Mon, Apr 17, 2023 at 8:12 PM hemphen @.***> wrote:

I have made a beta release in https://github.com/hemphen/hass-clevertouch/releases/tag/v0.4.0b1

Heating season seems to be almost over :) but would be great if you tried it out @hasselrot https://github.com/hasselrot. (Betas are well hidden but available through HACS.)

Boost mode and Home Assistant is not a perfect match (and the CleverTouch service is bit slow as usual). But at least he functionality is there and you can probably customize HA for most use cases. Check out the service call for custom actions.

— Reply to this email directly, view it on GitHub <https://github.com/hemphen/clevertouch/pull/3#issuecomment-1511859827 , or unsubscribe <

https://github.com/notifications/unsubscribe-auth/AEBC6PCZ7DB7YLU5MRPDBBDXBWB2HANCNFSM6AAAAAAWUN6XRU

. You are receiving this because you were mentioned.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/hemphen/clevertouch/pull/3#issuecomment-1511882678, or unsubscribe < https://github.com/notifications/unsubscribe-auth/ABS3PURLFW3TMR4NXMRIT3DXBWEDBANCNFSM6AAAAAAWUN6XRU

. You are receiving this because you modified the open/close state.Message ID: @.***>

— Reply to this email directly, view it on GitHub https://github.com/hemphen/clevertouch/pull/3#issuecomment-1511889143, or unsubscribe https://github.com/notifications/unsubscribe-auth/AEBC6PCMG4667X3LZG4YSXDXBWEYBANCNFSM6AAAAAAWUN6XRU . You are receiving this because you were mentioned.Message ID: @.***>