diff --git a/changeHomematicIP.py b/changeHomematicIP.py index d44fef2..73e7dfd 100644 --- a/changeHomematicIP.py +++ b/changeHomematicIP.py @@ -27,7 +27,9 @@ home.init(config.access_point) topic = 'weathersensors/' room = 'Leonie' -client.subscribe(topic + room + "/setHeatingProfile") +#client.subscribe(topic + room + "/setHeatingProfile") +client.subscribe(topic + room + "/activeProfile") + def on_message(client, userdata, msg): # The callback for when a PUBLISH message is received from the server. @@ -40,14 +42,15 @@ def on_message(client, userdata, msg): # The callback for when a PUBLISH messag if profile.name != "": client.publish(topic + room + "/activeProfile", group.activeProfile.name) client.publish(topic + room + "/heatingProfiles/" + profile.index, profile.name) - print(profile.index + ": " + profile.name) - print(profile.name) - print(msg.payload.decode("utf-8")) + #print(profile.index + ": " + profile.name) + #print(profile.name) + #print(msg.payload.decode("utf-8")) if profile.name == msg.payload.decode("utf-8"): + print("msg: " + msg.payload.decode("utf-8")) print("Profile Index: " + profile.index) - print(group) + #print(group) group.set_active_profile(profile.index) - print("%s %s" % (msg.topic, msg.payload.decode("utf-8"))) + #print("%s %s" % (msg.topic, msg.payload.decode("utf-8"))) def heating_profile(group): diff --git a/readHomematicIP.py b/readHomematicIP.py index 2a928dc..fc8e221 100755 --- a/readHomematicIP.py +++ b/readHomematicIP.py @@ -45,25 +45,6 @@ def write_wallmountedthermostatpro(room, device): "Humidity": device.humidity}) -def heating_profile(group): - 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 != "": - client.publish(topic + "/availability", "ON") - client.publish(topic + "/activeProfile", group.activeProfile.name) - client.publish(topic + "/heatingProfiles/" + profile.index, profile.name) - print(profile.index + ": " + profile.name) - - if profile.name == "Normal": - # print("Profile Index" + profile.index) - # print(group) - group.set_active_profile(profile.index) - - def main(): global home home.get_current_state()