From 6679f2b22b321660e15692445c58d6714a4dc3fb Mon Sep 17 00:00:00 2001 From: robert Date: Mon, 20 Dec 2021 19:39:17 +0100 Subject: [PATCH] add heating profiles --- readHomematicIP.py | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-) diff --git a/readHomematicIP.py b/readHomematicIP.py index baa7032..48c3cf6 100755 --- a/readHomematicIP.py +++ b/readHomematicIP.py @@ -6,7 +6,7 @@ import os import homematicip from homematicip.home import Home from homematicip.device import ShutterContact,HeatingThermostat,PlugableSwitchMeasuring,WallMountedThermostatPro - +from homematicip.group import HeatingCoolingProfile,HeatingGroup # Import MQTT client. import paho.mqtt.publish as publish import paho.mqtt.client as paho @@ -25,7 +25,7 @@ client = paho.Client(protocol=paho.MQTTv31) # * set a random string (max 23 cha # client.username_pw_set(mqtt_username, mqtt_password) # MQTT server credentials client.connect(mqtt_broker, 1883, 60) # MQTT server address -# Homematic IP +# Homematic IP config = homematicip.find_and_load_config_file() home = Home() @@ -67,10 +67,31 @@ def write_wallmountedthermostatpro(room,device): print({"Room":room, "Device Name":device.label, "Last Status Update" : device.lastStatusUpdate, "Actual Temperature":device.actualTemperature, "Set Point Temperature":device.setPointTemperature,"Humidity":device.humidity}) +def heating_profile(group): + #heatingGroup=homematicip.group.HeatingGroup(group) + #heatingGroup.__init__(home) + print("Heating Profiles") + print("Group Label: " + group.label) + print("Group Type: " + group.groupType) + print("Active Heating Profile: " + group.activeProfile.name) + for profile in group.profiles: + if profile.name != "": + print("Group Profile Name: " + profile.name) + #print("Profile ID: " + profile.id) + #print("Profile Index: " + profile.index) + if profile.name == "Home Office": + print("Profile Index" + profile.index) + print(group) + heatingGroup=HeatingGroup(group) +# print(heatingGroup.profiles[0]) + group.set_active_profile(profile.index) + def main(): global home home.get_current_state() for group in home.groups: +# if group.groupType=="HEATING": +# heating_profile(group) if group.groupType=="META": for device in group.devices: if isinstance(device,ShutterContact):