python-verisure icon indicating copy to clipboard operation
python-verisure copied to clipboard

HeatPumps

Open jamiewalters opened this issue 7 years ago • 68 comments

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?

jamiewalters avatar Sep 28 '17 06:09 jamiewalters

Hi, Is it possible to do this from the app?

persandstrom avatar Sep 28 '17 11:09 persandstrom

Exactly, you can control all the functions of the heatpump from the apps.

jamiewalters avatar Sep 28 '17 11:09 jamiewalters

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.

persandstrom avatar Sep 28 '17 17:09 persandstrom

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?

jamiewalters avatar Oct 08 '17 09:10 jamiewalters

Great! If you create a pull request I can take a look at it.

persandstrom avatar Oct 08 '17 14:10 persandstrom

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?

taugusti avatar Jan 27 '18 17:01 taugusti

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

jamiewalters avatar Jan 29 '18 15:01 jamiewalters

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.

taugusti avatar Jan 29 '18 16:01 taugusti

https://github.com/jamiewalters/python-verisure

jamiewalters avatar Sep 14 '18 17:09 jamiewalters

Fantastic - I will try it out right away- thanks @jamiewalters !

taugusti avatar Sep 14 '18 18:09 taugusti

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.

jamiewalters avatar Sep 14 '18 19:09 jamiewalters

I am working on a HASS climate component to go with this, let me know if you are interested in testing it.

jamiewalters avatar Sep 16 '18 08:09 jamiewalters

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!

taugusti avatar Sep 16 '18 12:09 taugusti

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

jamiewalters avatar Sep 16 '18 12:09 jamiewalters

Hmm - I need to look into it again. Did you install any extra libraries? It would be great to see your config - thanks!

taugusti avatar Sep 16 '18 12:09 taugusti

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...

taugusti avatar Sep 16 '18 15:09 taugusti

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.

jamiewalters avatar Sep 16 '18 18:09 jamiewalters

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 :)

follox avatar Sep 24 '18 14:09 follox

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 avatar Sep 24 '18 16:09 jamiewalters

@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?

follox avatar Sep 24 '18 17:09 follox

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 avatar Sep 24 '18 18:09 jamiewalters

@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 :)

follox avatar Sep 24 '18 18:09 follox

If any help it is this heatpump: Panasonic HZ9 RKE-1

follox avatar Sep 24 '18 18:09 follox

Try the latest commit - J

jamiewalters avatar Sep 24 '18 19:09 jamiewalters

The python lib supports setting these, just never figured out how to add them to home assistant.

jamiewalters avatar Sep 24 '18 19:09 jamiewalters

It works! Thanks a lot

follox avatar Sep 24 '18 19:09 follox

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.

follox avatar Sep 24 '18 19:09 follox

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.

jamiewalters avatar Sep 24 '18 19:09 jamiewalters

Hi again. Much appreciated. Where do you want me to send\upload the overview data for the python lib?

follox avatar Sep 25 '18 06:09 follox

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

jamiewalters avatar Sep 25 '18 10:09 jamiewalters