somm15 / PyViCare

Python Library to access Viessmann ViCare API
Apache License 2.0
129 stars 84 forks source link

Natural cooling #363

Open jchapuis opened 3 months ago

jchapuis commented 3 months ago

A proposal to surface the endpoint

https://api.viessmann.com/iot/v2/features/installations/{installation_id}/gateways/{gateway_id}/devices/0/features/heating.circuits.1.operating.modes.cooling

Afaik this returns a boolean flag that allows to determine whether natural cooling is currently running, which can be helpful to automate opening up valves

CFenner commented 3 months ago

There is already the getActiveProgram which you can already use to compare yourself.

https://github.com/somm15/PyViCare/blob/6c5b023ca6c8bb2d38141dd1746dc1705ec84ce8/PyViCare/PyViCareHeatingDevice.py#L591-L593

One could also add a generic function like this to handle it for all programs:

https://github.com/somm15/PyViCare/blob/6c5b023ca6c8bb2d38141dd1746dc1705ec84ce8/PyViCare/PyViCareHeatingDevice.py#L459-L464

jchapuis commented 3 months ago

thanks! actually, these endpoints do not seem to deliver enough details. What I'm looking for are not settings but whether the circulation pump is currently pumping heat down into the ground, so that I can open up all the floor heating valves.

"uri": "https://api.viessmann.com/iot/v2/features/installations/{}/gateways/{}/devices/0/features/heating.circuits.1.operating.programs.active",
        "properties": {
            "value": {
                "type": "string",
                "value": "reduced"
            }
        },
 "uri": "https://api.viessmann.com/iot/v2/features/installations/{}/gateways/{}/devices/0/features/heating.circuits.1.operating.modes.active",
        "properties": {
            "value": {
                "type": "string",
                "value": "dhwAndHeatingCooling"
            }
        },
CFenner commented 3 months ago

Sorry, I mixed up program and mode. But there is also a function getActiveMode.

Maybe your problem can be solved with comparing temperature.supply and temperature.return sensor values?

jchapuis commented 3 months ago

Sorry, I mixed up program and mode. But there is also a function getActiveMode.

Maybe your problem can be solved with comparing temperature.supply and temperature.return sensor values?

good hint! i could also compound this with the circulation pump running, as natural cooling only uses the pump. However, since the API seems to have this flag to indicate cooling operation currently running, would have been nice to surface this. I have yet to observe API values during real operations as summer hasn't arrived yet, so I'll report back when this happens. I could also work on a PR to surface that flag, if that would be a welcome addition.