Linking Items to a channel of a Thing

things
linkeditems
Tags: #<Tag:0x00007f0e8ff0afb0> #<Tag:0x00007f0e8ff0ae70>

(Jeroen) #1

I’ve a question about the Tradfri lights. I’ve made a things file, see below:

Bridge tradfri:gateway:xxxxxxxxxxxx "TRÅDFRI Gateway" [ host="192.168.xxx.xxx", code="xxxxxxxxxxxxxxxx" ] {
    Thing 0830 myRemoteControl1 [ id=65538 ]
    Thing 0100 myDimmableBulb1  "Licht Eetkamer rechts"[ id=65540 ]    
    Thing 0220 myColorTempBulb1 [ id=65540 ]
    Thing 0210 myColorBulb1 [ id=65540 ]
    Thing 0100 myDimmableBulb2 "Licht Eetkamer links" [ id=65539 ]    
    Thing 0220 myColorTempBulb2 [ id=65539 ]
    Thing 0210 myColorBulb2 [ id=65539 ]
    Thing 0830 myRemoteControl2 [ id=65536 ]
    Thing 0100 myDimmableBul3 "Schemerlampen1" [ id=65537 ]    
    Thing 0220 myColorTempBulb3 [ id=65537 ]
    Thing 0210 myColorBulb3 [ id=65537 ]
	Thing 0100 myDimmableBul4 "Schemerlampen2" [ id=65541 ]    
    Thing 0220 myColorTempBulb4 [ id=65541 ]
    Thing 0210 myColorBulb4 [ id=65541 ]
	Thing 0100 myDimmableBul5 "Schemerlampen3" [ id=65542 ]    
    Thing 0220 myColorTempBulb5 [ id=65542 ]
    Thing 0210 myColorBulb5 [ id=65542 ]
	Thing 0100 myDimmableBul6 "Schemerlampen4" [ id=65543 ]    
    Thing 0220 myColorTempBulb6 [ id=65543 ]
    Thing 0210 myColorBulb6 [ id=65543 ]
	Thing 0100 myDimmableBul7 "Schemerlampen5" [ id=65544 ]    
    Thing 0220 myColorTempBulb7 [ id=65544 ]
    Thing 0210 myColorBulb7 [ id=65544 ]
	Thing 0100 myDimmableBul8 "Schemerlampen6" [ id=65545 ]    
    Thing 0220 myColorTempBulb8 [ id=65545 ]
    Thing 0210 myColorBulb8 [ id=65545 ]
	Thing 0100 myDimmableBul9 "Schemerlampen7" [ id=65546 ]    
    Thing 0220 myColorTempBulb9 [ id=65546 ]
    Thing 0210 myColorBulb9 [ id=65546 ]
	Thing 0100 myDimmableBul10 "Schemerlampen8" [ id=65547 ]    
    Thing 0220 myColorTempBulb10 [ id=65547 ]
    Thing 0210 myColorBulb10 [ id=65547 ]
	Thing 0100 myDimmableBul11 "Schemerlampen9" [ id=65548 ]    
    Thing 0220 myColorTempBulb11 [ id=65548 ]
    Thing 0210 myColorBulb11 [ id=65548 ]
	Thing 0100 myDimmableBul12 "Schemerlampen10" [ id=65549 ]    
    Thing 0220 myColorTempBulb12 [ id=65549 ]
    Thing 0210 myColorBulb12 [ id=65549 ]
}

and the following items-file:

Group gLights (gLights_all)
Group gLights_beneden (gLights_all)
Group gLights_boven (gLights_all)
Group gLights2 (gLights_all)
Group gLights20
Group gLights21 
Group gLights22 
Group gLights3 (gLights_all)
Group gLights30
Group gLights31 
Group gLights32 
Group gLights9 (gLights_all)
Group gLights10 (gLichts_all)
Group:Switch:OR(ON,OFF) gLights7 "Schemerlampen voor" <light> (gLights3)
Group:Switch:OR(ON,OFF) gLights8 "Schemerlampen achter" <light> (gLights3)
Group:Switch:OR(ON, OFF) gLights_all "Alle Lichten [(%s)]" <light> (All)
Switch	Licht_Eetkamer_Rechts 				"Licht Eetkamer rechts" 		(gLights2) 								{ channel="tradfri:0100:xxxxxxxxxxxxxx:myDimmableBulb1:brightness" }
Dimmer 	Licht_Eetkamer_Rechts_Brightness 	"Licht Eetkamer rechts"			(gLights20) 							{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb1:brightness" }
Dimmer 	Licht_Eetkamer_Rechts_ColorTemperature 								(gLights21) 							{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb1:color_temperature" }
Color 	Licht_Eetkamer_Rechts_ColorLight 									(gLights22) 							{ channel="tradfri:0210:xxxxxxxxxxxxxx:myColorBulb1:color" }
Number 	RemoteControlBatteryLevel1 			"Battery [%d %%]" 														{ channel="tradfri:0830:xxxxxxxxxxxxxx:myRemoteControl1:battery_level" } 
Switch 	RemoteControlBatteryLow1 			"Batterij remote eetkamer"		(notifications)							{ channel="tradfri:0830:xxxxxxxxxxxxxx:myRemoteControl1:battery_low" }
Switch 	Licht_Eetkamer_Links 				"Licht Eetkamer links" 			(gLights2) 								{ channel="tradfri:0100:xxxxxxxxxxxxxx:myDimmableBulb2:brightness" }
Dimmer 	Licht_Eetkamer_Links_Brightness 	"Licht Eetkamer links" 			(gLights20) 							{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb2:brightness" }
Dimmer 	Licht_Eetkamer_Links_ColorTemperature 								(gLights21) 							{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb2:color_temperature" }
Color 	Licht_Eetkamer_Links_ColorLight 									(gLights22) 							{ channel="tradfri:0210:xxxxxxxxxxxxxx:myColorBulb2:color" }
Number 	RemoteControlBatteryLevel2 			"Battery [%d %%]" 														{ channel="tradfri:0830:xxxxxxxxxxxxxx:myRemoteControl2:battery_level" } 
Switch 	RemoteControlBatteryLow2 			"Batterij remote schemerlampen"	(notifications)							{ channel="tradfri:0830:xxxxxxxxxxxxxx:myRemoteControl2:battery_low" }
Switch 	Licht_Schemerlampen 				"Schemerlampen1" 				(gLights8) 								{ channel="tradfri:0100:xxxxxxxxxxxxxx:myDimmableBulb3:brightness" }
Dimmer 	Licht_Schemerlampen_Brightness 		"Schemerlampen1" 				(gLights10) 							{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb3:brightness" }
Dimmer 	Licht_Schemerlampen_ColorTemperature 								(gLights31) 		    				{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb3:color_temperature" }
Color 	Licht_Schemerlampen_ColorLight 										(gLights32) 							{ channel="tradfri:0210:xxxxxxxxxxxxxx:myColorBulb3:color" }
Switch 	Licht_Schemerlampen1 				"Schemerlampen2" 				(gLights7) 								{ channel="tradfri:0100:xxxxxxxxxxxxxx:myDimmableBulb4:brightness" }
Dimmer 	Licht_Schemerlampen1_Brightness 	"Schemerlampen2" 				(gLights9) 								{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb4:brightness" }
Dimmer 	Licht_Schemerlampen1_ColorTemperature 								(gLights31) 		    				{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb4:color_temperature" }
Color 	Licht_Schemerlampen1_ColorLight 									(gLights32) 							{ channel="tradfri:0210:xxxxxxxxxxxxxx:myColorBulb4:color" }
Switch 	Licht_Schemerlampen2 				"Schemerlampen3" 				(gLights7) 								{ channel="tradfri:0100:xxxxxxxxxxxxxx:myDimmableBulb5:brightness" }
Dimmer 	Licht_Schemerlampen2_Brightness 	"Schemerlampen3" 				(gLights9) 								{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb5:brightness" }
Dimmer 	Licht_Schemerlampen2_ColorTemperature 								(gLights31) 		    				{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb5:color_temperature" }
Color 	Licht_Schemerlampen2_ColorLight 									(gLights32) 							{ channel="tradfri:0210:xxxxxxxxxxxxxx:myColorBulb5:color" }
Switch 	Licht_Schemerlampen3 				"Schemerlampen4" 				(gLights7) 								{ channel="tradfri:0100:xxxxxxxxxxxxxx:myDimmableBulb6:brightness" }
Dimmer 	Licht_Schemerlampen3_Brightness 	"Schemerlampen4" 				(gLights9) 								{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb6:brightness" }
Dimmer 	Licht_Schemerlampen3_ColorTemperature 								(gLights31) 		    				{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb6:color_temperature" }
Color 	Licht_Schemerlampen3_ColorLight 									(gLights32) 							{ channel="tradfri:0210:xxxxxxxxxxxxxx:myColorBulb6:color" }
Switch 	Licht_Schemerlampen4 				"Schemerlampen5" 				(gLights7) 								{ channel="tradfri:0100:xxxxxxxxxxxxxx:myDimmableBulb7:brightness" }
Dimmer 	Licht_Schemerlampen4_Brightness 	"Schemerlampen5" 				(gLights9) 								{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb7:brightness" }
Dimmer 	Licht_Schemerlampen4_ColorTemperature 								(gLights31) 		    				{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb7:color_temperature" }
Color 	Licht_Schemerlampen4_ColorLight 									(gLights32) 							{ channel="tradfri:0210:xxxxxxxxxxxxxx:myColorBulb7:color" }
Switch 	Licht_Schemerlampen5 				"Schemerlampen6" 				(gLights8) 								{ channel="tradfri:0100:xxxxxxxxxxxxxx:myDimmableBulb8:brightness" }
Dimmer 	Licht_Schemerlampen5_Brightness 	"Schemerlampen6" 				(gLights10) 							{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb8:brightness" }
Dimmer 	Licht_Schemerlampen5_ColorTemperature 								(gLights31) 		    				{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb8:color_temperature" }
Color 	Licht_Schemerlampen5_ColorLight 									(gLights32) 							{ channel="tradfri:0210:xxxxxxxxxxxxxx:myColorBulb8:color" }
Switch 	Licht_Schemerlampen6 				"Schemerlampen7" 				(gLights7) 								{ channel="tradfri:0100:xxxxxxxxxxxxxx:myDimmableBulb9:brightness" }
Dimmer 	Licht_Schemerlampen6_Brightness 	"Schemerlampen7" 				(gLights9) 								{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb9:brightness" }
Dimmer 	Licht_Schemerlampen6_ColorTemperature 								(gLights31) 		    				{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb9:color_temperature" }
Color 	Licht_Schemerlampen6_ColorLight 									(gLights32) 							{ channel="tradfri:0210:xxxxxxxxxxxxxx:myColorBulb9:color" }
Switch 	Licht_Schemerlampen7 				"Schemerlampen8" 				(gLights7) 								{ channel="tradfri:0100:xxxxxxxxxxxxxx:myDimmableBulb10:brightness" }
Dimmer 	Licht_Schemerlampen7_Brightness 	"Schemerlampen8" 				(gLights9) 								{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb10:brightness" }
Dimmer 	Licht_Schemerlampen7_ColorTemperature 								(gLights31) 		    				{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb10:color_temperature" }
Color 	Licht_Schemerlampen7_ColorLight 									(gLights32) 							{ channel="tradfri:0210:xxxxxxxxxxxxxx:myColorBulb10:color" }
Switch 	Licht_Schemerlampen8 				"Schemerlampen9" 				(gLights7) 								{ channel="tradfri:0100:xxxxxxxxxxxxxx:myDimmableBulb11:brightness" }
Dimmer 	Licht_Schemerlampen8_Brightness 	"Schemerlampen9" 				(gLights9) 								{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb11:brightness" }
Dimmer 	Licht_Schemerlampen8_ColorTemperature 								(gLights31) 		    				{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb11:color_temperature" }
Color 	Licht_Schemerlampen8_ColorLight 									(gLights32) 							{ channel="tradfri:0210:xxxxxxxxxxxxxx:myColorBulb11:color" }
Switch 	Licht_Schemerlampen9 				"Schemerlampen10" 				(gLights7) 								{ channel="tradfri:0100:xxxxxxxxxxxxxx:myDimmableBulb12:brightness" }
Dimmer 	Licht_Schemerlampen9_Brightness 	"Schemerlampen10" 				(gLights9) 								{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb12:brightness" }
Dimmer 	Licht_Schemerlampen9_ColorTemperature 								(gLights31) 		    				{ channel="tradfri:0220:xxxxxxxxxxxxxx:myColorTempBulb12:color_temperature" }
Color 	Licht_Schemerlampen9_ColorLight 									(gLights32) 							{ channel="tradfri:0210:xxxxxxxxxxxxxx:myColorBulb12:color" }
Switch 	Licht_Kamer 						"Licht Kamer" 			<light> (gLights_beneden)			 			{ channel="rfxcom:lighting2:usb0:14160886_1:command" }
Switch 	Licht_Keuken 						"Licht Keuken" 			<light>	(gLights_beneden) 						{ channel="rfxcom:lighting4:usb0:262145:command" }
Switch 	Licht_Boven 						"Licht Onze Slaapkamer" <light> (gLights_boven) 						{ channel="rfxcom:lighting2:usb0:14166714_5:command" }
Switch 	Licht_Douche 						"Licht Douche" 			<light>	(gLights_beneden) 						{ channel="rfxcom:lighting2:usb0:14159582_4:command" }

but in PaperUI is see everything seperated like this:

I was expecting to have one Thing with everything linked to a diferent channel like this one:


(Matthias) #2

This is due to your thing definition. Only one thing per device should do the trick.


(Jeroen) #3

@ptweety you mean to make a different thing-file for every bulb?


(Matthias) #4

No, what I tried to say is: you should not tripple your things in the one things file. Instead of:

Thing 0100 myDimmableBulb1 "Licht Eetkamer rechts"[ id=65540 ]
Thing 0220 myColorTempBulb1 [ id=65540 ]
Thing 0210 myColorBulb1 [ id=65540 ]

Just do:

Thing 0220 myDimmableBulb1 [ id=65540 ]

or do the discovery via PaperUI and completely drop all the lines after defining your bridge:

Bridge tradfri:gateway:xxxxxxxxxxxx "TRÅDFRI Gateway" [ host="192.168.xxx.xxx", code="xxxxxxxxxxxxxxxx" ]