I have a multi-button in the entrance to my bedroom, which has no local load but turns on the two bedside lights. One is the load on another MB, one is the load on a simple switch. All I wanted to achieve was to get the on/off buttons in the hall to reflect the status of the two bedside switches, such that entering the room and turning on with the hall on button, followed by turning off each bedside light in turn would result in the hall switch going off once both lights were off. Conversely, turning on either bedside light should turn on the hall on button.
I almost have it working but it was pretty involved and the remaining bug is infuriating!
So, right now we have:-
PowerLinc group 10 is Bed1 & Bed2
PowerLinc group 16 is just the #1 button of Hall
Trigger 'hall on' triggers group 'MBed on' when Hall on button is pressed & 'hall off' triggers 'MBed off' when Hall off button is pressed.
Trigger 'bed1 on' does group 'Bed1 on', 'bed1 off' does 'Bed1 off' when the Bed1 MB on/off buttons are pressed
Trigger 'bed2 on' does group 'Bed2 on' etc.
Action group 'MBed on' sends on to group 10 & then executes group 'update'
'MBed off' send off to group 10 and calls 'update'
'Bed1 on' directly turns on the load for Bed1 MB & then calls 'update', 'Bed1 off' does the obvious.
'Bed2 on' & 'Bed2 off' do the same for Bed2 switch.
'update' is the interesting bit since it does a simple applescript that should logically OR the state of Bed1 & Bed2, sending on to group16 if either Bed1 or Bed2 are on, or sends off otherwise. Turning on either light individually, or using the hall switch should result in the hall on led going on. Once both lights are off then so should the hall on LED (and of course the off LED should turn on). The applescript is -
- Code: Select all
delay 3
set c to (on state of device "MBedBridgetControlSwitch")
set b to (on state of device "MBedTimControlMB")
if (c or b) then
send insteon group instnTurnOn using name "MBed lights indicator"
else
send insteon group instnTurnOff using name "MBed lights indicator"
end if
{the delay seems to make no actual difference and is there because I though there might be sync issues causing problems}
What actually happens is a bit confusing. So far as I can tell it all works when operated from the Indigo app (executing actions or triggers manually) or from the control page. BUT if I press the physical hall 'on' button the bed lights go on.. .and the hall 'on' LED goes out! If I press the hall 'off' button the lights go out and the 'on' LED goes on! To make it still more confusing, pressing the bedside switches to turn a light off makes the hall LED correct itself. Debugging is proving difficult without an actual debugger. Advice - or even pointers to good advice- on how to get more information out of the system would be welcomed. An actual solution would be even nicer!