Repository: somm15/PyViCare

Issue:
Possibility to read/set dhw circulation
Hey everyone,

is the above mentioned function working? I have setup PyViCare a few months ago, but this parameter shows 'True' all the time. My circulation is configured to be active only 5am-10pm.
By the way, is there also a way to influence the circulationpump? I would like to activate it only if someone is at home (respectively deactivate when no one is in the house).
I use a Viessmann heatpump Vitocal 200-S with Vitoconnect (in case that matters). The other readings (e.g. temperature, compressor,...) are fine.

Regards,
Anduril

Discussion:

Patch:
diff --git a/PyViCare/PyViCareDevice.py b/PyViCare/PyViCareDevice.py
index 86a9898..f7254d6 100644
--- a/PyViCare/PyViCareDevice.py
+++ b/PyViCare/PyViCareDevice.py
@@ -339,6 +339,13 @@ class Device:
     def activateOneTimeCharge(self):
         return self.service.setProperty("heating.dhw.oneTimeCharge","activate","{}")
 
+    def setDomesticHotWaterCirculationSchedule(self,schedule):
+        return self.service.setProperty("heating.dhw.pumps.circulation.schedule", "setSchedule","{\"newSchedule\":"+str(schedule)+"}")
+
+    @handleNotSupported
+    def getDomesticHotWaterCirculationSchedule(self):
+        return self.service.getProperty("heating.dhw.pumps.circulation.schedule")["commands"]["setSchedule"]["params"]["newSchedule"]["constraints"]["modes"]
+      
     @handleNotSupported
     def getAvailableCircuits(self):
         return self.service.getProperty("heating.circuits")["properties"]["enabled"]["value"]


Test patch:
diff --git a/tests/test_Vitodens200W.py b/tests/test_Vitodens200W.py
index 3a358c0..ffd3857 100644
--- a/tests/test_Vitodens200W.py
+++ b/tests/test_Vitodens200W.py
@@ -41,3 +41,8 @@ class Vitodens200W(unittest.TestCase):
 
     def test_getDomesticHotWaterOutletTemperature(self):
         self.assertEqual(self.device.getDomesticHotWaterOutletTemperature(), 58)
+
+    def test_getDomesticHotWaterCirculationSchedule(self):
+        self.assertEqual(self.device.getDomesticHotWaterCirculationSchedule(), ['on'])
+
+