diff --git a/readHomematicIP.py b/readHomematicIP.py index 580d5ec..9777f33 100755 --- a/readHomematicIP.py +++ b/readHomematicIP.py @@ -46,22 +46,21 @@ def write_wallmountedthermostatpro(room, device): def heating_profile(group): - print(group) - topic = 'heatingProfiles/' - # heatingGroup=homematicip.group.HeatingGroup(group) - # heatingGroup.__init__(home) - print("Heating Profiles") - print("Group Label: " + group.label) - print("Group Type: " + group.groupType) + print("Room: " + group.label) + room = group.label + topic = 'weathersensors/' + room + 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) + client.publish(topic + "/availability", "ON") + client.publish(topic + "/activeProfile", group.activeProfile.name) + client.publish(topic + "/" + profile.index, profile.name) + print(profile.index + ": " + profile.name) + if profile.name == "Home Office": - print("Profile Index" + profile.index) - print(group) + #print("Profile Index" + profile.index) + #print(group) group.set_active_profile(profile.index) @@ -69,8 +68,8 @@ def main(): global home home.get_current_state() for group in home.groups: - # if group.groupType=="HEATING": - # heating_profile(group) + if group.groupType=="HEATING": + heating_profile(group) if group.groupType == "META": for device in group.devices: if isinstance(device, ShutterContact):