add publish heating profiles
This commit is contained in:
		
							parent
							
								
									a9a879dc7c
								
							
						
					
					
						commit
						5118791779
					
				@ -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):
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user