Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing HVAC mode #84

Open
hawtvawt opened this issue Feb 2, 2025 · 9 comments
Open

Changing HVAC mode #84

hawtvawt opened this issue Feb 2, 2025 · 9 comments

Comments

@hawtvawt
Copy link

hawtvawt commented Feb 2, 2025

I have two Warmup 6iE's with entity names of climate.conservatory and climate.workshop. Both are intergrated into HA and work well.

I recently tried the following automation:

action: climate.set_hvac_mode
metadata: {}
data:
hvac_mode: "off"
target:
entity_id: climate.conservatory

It works and changes the HVAC state of the conservatory BUT it also changes the state of the workshop as well.

Any thoughts? Mike

@artmg
Copy link
Collaborator

artmg commented Feb 2, 2025

Thanks for raising this issue, Mike.

I have noticed that some changes to HVAC mode don't work in the logical way you might expect. For instance if my 4ie is set to Off, and I set an Override (say 24 deg for 1 hr), it returns to Program mode afterwards instead of Off. This happens whether I use HA or some other control (like the thermostat's digital panel).

I suggest that you try 'playing around' with different features and settings, and try activating them using different interfaces (HA vs front panel vs mobile app). It is quite possible that you may come across commands or settings that have not been foreseen by the manufacturer, so were not set up in their cloud back-end and therefore you might have to find a way to work around these limitations.

For instance, can you create an automation that first reads the state of workshop? Then, if it was ON when you want to turn off conservatory, it does the Off and after a few seconds turns workshop back On? I know that is not really ideal, but the alternative might be to simply accept that the thermostat product is not quite as clever as you might have hoped.

Good luck

@hawtvawt
Copy link
Author

hawtvawt commented Feb 2, 2025

Just another thought. If I use the default climate card you can change HVAC mode on each device and it works perfectly well therefore HA is correctly sending the appropriate commands. What is different from what I have written in the automation?

@hawtvawt
Copy link
Author

hawtvawt commented Feb 3, 2025

Had a quick look at the Python code and found out what is going on. When you use climate.set_hvac_mode it invokes code which turns off all devices in the same location, not an individual device. Not sure why it does this when using climate.set_hvac_mode but not from the drop down on the thermostat card.

@artmg
Copy link
Collaborator

artmg commented Feb 3, 2025

Well done for diagnosing this yourself, I stand corrected that this project contains the fault.

Unfortunately, the warmup4ie python wrapper for the API does not have a set_room_off (or equivalent) - see the code. However, although warmup4ie was designed as a pypi package, it has not been maintained and we hold source code inside this package.

That means that it would be within our control to make such a correction, as long as the Warmup API supports it. Your suggestion that the card works implies that it must, so it shouldn't be too hard a task for someone to work out what what to pass to the API and add such a function to warmup4ie.

It might even be that you could hack a set_room_to_off function simply by passing the room id instead of the location id...

    def set_room_to_off(self, room_id):
        self._set_location_mode(room_id, "off")

but unfortunately I don't have a rig to hand where I could easily test this

@hawtvawt
Copy link
Author

hawtvawt commented Feb 3, 2025

If I get a moment I will take a look. Thank you for your suggestion.

@hawtvawt
Copy link
Author

hawtvawt commented Feb 4, 2025

I had previously tried this "hack" and it had not worked so I tried a variation but with no luck either. Unfortunately, I come from a Fortran background and my exposure to Python is limited so its a steep learning curve. Will have another go in the coming weeks but I am sure there are others out there who could solve this very quickly.

@hawtvawt
Copy link
Author

hawtvawt commented Feb 4, 2025

I must put my hand up to a mistake on my part. When you use the climate card and change mode from Auto to Off all devices at the same location go to Off. However, if then change mode back to Auto only the device you selected changes from Off to Auto NOT all locations as I first said. If you inspect the code this is exactly as intended.

I have spent several hours changing the code in climate.py and warmup4ie.py to resolve the issue. Unfortunately, it does not work. The changes I have now made are limited to one device but when I try and change mode from Auto to Off the card display Off but then after a few seconds reverts back to Auto. In the code there are some subtle differences between selecting Auto and my version of selecting Off which my limited knowledge of Python prevents me from understanding. More than happy to share my changes if you fancied taking a look.

@hawtvawt
Copy link
Author

hawtvawt commented Feb 6, 2025

Have given up as without details on the "official" API for Warmup its not possible to know whether the changes I have made are even recognized by the API.

@artmg
Copy link
Collaborator

artmg commented Feb 6, 2025

Unfortunately it is a bit like working blind, I'm afraid. I am told the original developer managed to get some API documentation from the vendor, although I have not been able to track down a copy. It may be possible to use some kind of packet inspection to work out what API calls are going back and forth, and I have heard of charles proxy being used to 'listen in' on the phone app's API calls to understand syntax that works. One contributor said that they tried using postman to diagnose API issues, but to no avail. There is a recent NPM package warmup-api which also uses GraphQL, and perhaps their Schema might give some clues. Unfortunately, that's getting beyond my expertise and I am not sure what to suggest next.

Thanks for reporting the issue, and adding useful narrative to what you have tried - with any luck someone might stop by and shine a light on how to get things working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants