There shouldn't be much difference in using idx or name. The names and idx's are stored in a array anyway.
I do find it strange that a rflink can't sent directly, I don't see that behavior with zwave.
My rfxcom is only used for Somfy and some simple remotes.
I also don't use groups or scenes in Domoticz as I create them directly in my script, gives more flexibility on how to handle the group in different cases.
Code: Select all
function Interplafsalontv(){
global $a,$s,$i;
if($s['PlafonnierSalon']=='Off'){
if($s['firstlightofgroup']=='Off')sw($i['firstlightofgroup'],'On');
if($s['fsecondlightofgroup']=='Off')sw($i['fsecondlightofgroup'],'On');
if($s['fsecondlightofgroup']=='Off')sw($i['fsecondlightofgroup'],'On');
}else{
if($s['firstlightofgroup']!='Off')sw($i['firstlightofgroup'],'Off');
if($s['fsecondlightofgroup']!='Off')sw($i['fsecondlightofgroup'],'Off');
if($s['fsecondlightofgroup']!='Off')sw($i['fsecondlightofgroup'],'Off');
}
}
Another advantage of this is that only the commands that are nescesary are sent. When you switch a group/scene in domoticz all commands are sent.
With this, if for some reason one of the devices is already on the command won't be sent again wich saves again some time.
With this you can also create more intellegent scenes:
Code: Select all
function Interplafsalontv(){
global $a,$s,$i;
if($s['PlafonnierSalon']=='Off'){
if($s['firstlightofgroup']=='Off')sw($i['firstlightofgroup'],'On');
if($s['fsecondlightofgroup']=='Off'&&time>strtotime('18:00')sw($i['fsecondlightofgroup'],'On');
if($s['fsecondlightofgroup']=='Off'&&$s['lightmeter']<200)sw($i['fsecondlightofgroup'],'On');
}else{
if($s['firstlightofgroup']!='Off')sw($i['firstlightofgroup'],'Off');
if($s['fsecondlightofgroup']!='Off')sw($i['fsecondlightofgroup'],'Off');
if($s['fsecondlightofgroup']!='Off')sw($i['fsecondlightofgroup'],'Off');
}
}
Second light will only go on if hour of day is later than 18:00, thirth light only if a luxmeter is lower than 200.
Let your imagination go
