python-verisure
python-verisure copied to clipboard
HeatPumps
I am interested in adding support for HeatPumps (get status, change temperature, etc)
They show up in the /overview as:
"heatPumps": [ { "deviceLabel": "XXX XXX", }, "heatPumpModel": "PANASONIC", "heatPumpConfig": { "status": "RUNNING", "mode": "HEAT", "power": "ON", "targetTemperature": 21, "fanSpeed": "LOW", "airSwingDirection": { "vertical": "0_DEGREES" }, "feature": "QUIET", "changedTime": "2017-09-27T22:12:48.647Z" } } ],
However from there I haven't managed to work out the resource for fetching only the heatpump or to post updates to it.
This could be done with the regular "mypages" There you could send the payload as a post request. First choice however would be to keep it all on the same URL and session.
Any tips on going forward?
Hi, Is it possible to do this from the app?
Exactly, you can control all the functions of the heatpump from the apps.
Then It should be doable. I don't have a heatpump myself so you have to add the functionality yourself.
I have installed https://www.charlesproxy.com on a computer used it as a reverse proxy for my cell phone. When ask certificate is exchanged it is possible to sniff the traffic from the app.
I managed to added HeatPumps, tested at home, works as expected. However the interface for the HeatPump has a few more options. I opted for a single function that takes (property, state) with property freely being any given property of the HeatPump. Given that I would like to contribute this code, is there a preferred style?
Great! If you create a pull request I can take a look at it.
Hi @persandstrom and @jamiewalters I am also hoping to find heat pump support... It seems like Jamie got i running - but it does not appear to be a part of the main line. Is there any plan to add it - or perhaps I could get a copy of the prototype to see if I can make it work?
Hi @taugusti I got it running at home but I have been quite busy to merge it with the latest code and push it back. I am more than happy to share this, maybe you can add some input to make it more useable before merging.
-Jamie
Great - how do I get access to it? can you mail it (or link to it): thomas at augustinus dot dk? Btw. I got the existing version up and running and now have the staus of the heatpump in my Home Assistant setup. But adding "change settings" would be great. It is a great module @persandstrom.
https://github.com/jamiewalters/python-verisure
Fantastic - I will try it out right away- thanks @jamiewalters !
Let me know how it works, I have only tested it with my pump. Sorry I took to long to get back, had to put this aside while I was renovating.
I am working on a HASS climate component to go with this, let me know if you are interested in testing it.
Hi @jamiewalters, I have only had limited time to test - and I seem to recall that I could test by executing the scripts from the ssh console or on my pc... but I can't do that anymore because of a missing reference. I will look at it later. I made an extra python script to wrap the other one - that handles initiating the session, getting/setting and then closing the session. It is my first attempt at setting parameters with input_select. It seems that the script is not called when I change values. The same when I try to make the selector reflect the current state. I must be doing something totally wrong :-) Are you doing it the same way? or is there an easier way to go? Btw - since you are using hass - could you show me the scripts/config you use to present it ?
And yes - I would love to help test the climate component!
I tested it using python3 on my pc, worked fine. The climate component, I just add to custom_components and it shows up in HASS under climate, it still a little rough on the edges, but it works and shows up in HomeKit, will upload a copy to github later this evening
Hmm - I need to look into it again. Did you install any extra libraries? It would be great to see your config - thanks!
Ok - stupid rookie mistake... I was missing the requests module on my pc. from ssh it seems not to be available for some reason. "pip install requests" saved my day :-)
Looking forward to the custom component - I have not yet looked in that direction...
try this:
https://github.com/jamiewalters/python-verisure-climate
still very rough, first hass component, will keep improving it in the coming days. since hass defaults to v 1.3.7 of vsure I add it beside the component and reference it locally.
Hi @jamiewalters Thanks a lot for this. I was posting a feature request on the forum to ask if someone could update the Home Assistant component. Will check this out tonight :)
Let me know how it works, I am only aware of it being tested on two HeatPumps, I am not certain all the options are the same for every pump but let me know, so it can up updated.
@jamiewalters It works like a sharm! Thanks a lot. But it is only showing one of two pumps. Anything I can do to fix that? Is it also possible to get powerconsumption?
Let me look at the code again, never been tested in multiple pumps as I only have one :/ Can you open an issue at my repo?
@jamiewalters Thanks for looking at it. As mention in the "issue" it is missing two settings on my heatpump, which is econavi and quiet mode. It is not that important tho. More important to get both the heatpumps into hass :)
If any help it is this heatpump: Panasonic HZ9 RKE-1
Try the latest commit - J
The python lib supports setting these, just never figured out how to add them to home assistant.
It works! Thanks a lot
I hope someone can also integreate power consumption and also the two missing modes. You can also just adjust swing mode vertically but not horizontally.
I did the support for adjusting swing mode, I didn't have any horizontal adjustments to test with so I couldn't add support for horizontal, maybe you can send me an example of your overview data from the python lib. I will look into the power consumption. The modes are in the python lib, I just dont know where they would fit into the climate component, Ill look into this.
Hi again. Much appreciated. Where do you want me to send\upload the overview data for the python lib?
Open an issue here: https://github.com/jamiewalters/python-verisure-climate and share the file, scrub all sensitive data, I only need to see what they heatPumps config looks like