Ok, I tested it and everything worked for me, I wonder if you have a different state backwards - or maybe my test is flawed, but I did this:
Created a device to match yours:
- Code: Select all
<State id="doorStatus">
<ValueType>String</ValueType>
<TriggerLabel>Current device state</TriggerLabel>
<ControlPageLabel>Current device state</ControlPageLabel>
</State>
<State id="doorStatus.closed">
<ValueType>Boolean</ValueType>
<TriggerLabel>Current device state</TriggerLabel>
<ControlPageLabel>Current device state</ControlPageLabel>
</State>
With an action to toggle the doorClosed.closed state:
- Code: Select all
def TEST (self, devAction):
dev = indigo.devices[devAction.deviceId]
if dev.states["doorStatus.closed"]:
dev.updateStateOnServer ("doorStatus.closed", False)
else:
dev.updateStateOnServer ("doorStatus.closed", True)
indigo.server.log(unicode(dev.states))
Then I created that device in Indigo and linked a new security module to it:
- Device list
- Screen Shot 2016-06-18 at 11.37.47 AM.png (23.39 KiB) Viewed 4834 times
- Security Manager Device
- Screen Shot 2016-06-18 at 11.38.13 AM.png (82.07 KiB) Viewed 4834 times
I created a button on my control page to run the toggle action. When I toggle it on (true):
- Toggle Action On
- Screen Shot 2016-06-18 at 11.39.04 AM.png (14.77 KiB) Viewed 4834 times
- Toggle On States
- Screen Shot 2016-06-18 at 11.39.36 AM.png (16.42 KiB) Viewed 4834 times
And when I toggle it off (false):
- Toggle Off Device
- Screen Shot 2016-06-18 at 11.40.30 AM.png (14.73 KiB) Viewed 4834 times
- Toggle Off States
- Screen Shot 2016-06-18 at 11.40.58 AM.png (15.54 KiB) Viewed 4834 times
Does that seem like a legit test?