Security Manager Plugin
- FlyingDiver
- Posts: 7830
- Joined: Sat Jun 07, 2014 10:36 am
- Location: Southwest Florida, USA
Re: Security Manager Plugin
I agree, the first one should work. The second won't, because there are states other than "Open" that are insecure. "Stopped" means the door is stopped, neither open nor closed, for example.
This is what I have for this group. I've tested the door lock alone, and it works.
This is what I have for this group. I've tested the door lock alone, and it works.
- Attachments
-
- Screen Shot 2016-06-18 at 11.56.25 AM 6-18.png (317.1 KiB) Viewed 5661 times
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
- Colorado4Wheeler
- Posts: 2794
- Joined: Mon Jul 20, 2009 10:48 am
- Location: Colorado
Re: Security Manager Plugin
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:
With an action to toggle the doorClosed.closed state:
Then I created that device in Indigo and linked a new security module to it:
I created a button on my control page to run the toggle action. When I toggle it on (true):
And when I toggle it off (false):
Does that seem like a legit test?
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>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))My Modest Contributions to Indigo:
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here
- Colorado4Wheeler
- Posts: 2794
- Joined: Mon Jul 20, 2009 10:48 am
- Location: Colorado
Re: Security Manager Plugin
Another thought, try setting up the way you think it should work and then reload the plugin, perhaps the states aren't updating properly when you first create the device. This is one of the things I corrected in later libraries that I need to apply to this plugin just to be safe.
My Modest Contributions to Indigo:
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here
- FlyingDiver
- Posts: 7830
- Joined: Sat Jun 07, 2014 10:36 am
- Location: Southwest Florida, USA
Re: Security Manager Plugin
I think I did that, but I'll try again to be sure.Another thought, try setting up the way you think it should work and then reload the plugin, perhaps the states aren't updating properly when you first create the device. This is one of the things I corrected in later libraries that I need to apply to this plugin just to be safe.
Can you run your test again, but with this as the status definition for the device?
Code: Select all
<State id="doorStatus">
<ValueType>
<List>
<Option value="open">Open</Option>
<Option value="closed">Closed</Option>
<Option value="stopped">Stopped</Option>
<Option value="opening">Opening</Option>
<Option value="closing">Closing</Option>
</List>
</ValueType>
</State>
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
- Colorado4Wheeler
- Posts: 2794
- Joined: Mon Jul 20, 2009 10:48 am
- Location: Colorado
Re: Security Manager Plugin
I'll try that after lunch and see if it comes out differently. One way or the other we'll get you working this weekend 
My Modest Contributions to Indigo:
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here
- FlyingDiver
- Posts: 7830
- Joined: Sat Jun 07, 2014 10:36 am
- Location: Southwest Florida, USA
Re: Security Manager Plugin
It's also quite possible the MyQ plugin isn't setting states properly. All I see in the states inspector panel is "doorState=Closed", which SHOULD mean that doorState.closed=true. According to how I was told enumerated states work.
I'm considering switching the device type to relay rather than custom and just adding doorState as an additional state. More code logic needed to set the onOffState properly, but the bonus would be that there would be On/Off (Open/Close) buttons on the device panel.
I'm considering switching the device type to relay rather than custom and just adding doorState as an additional state. More code logic needed to set the onOffState properly, but the bonus would be that there would be On/Off (Open/Close) buttons on the device panel.
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
- Colorado4Wheeler
- Posts: 2794
- Joined: Mon Jul 20, 2009 10:48 am
- Location: Colorado
Re: Security Manager Plugin
Ok, I just did that and everything still works hunky dorey.
Code: Select all
<State id="doorStatus">
<ValueType>
<List>
<Option value="open">Open</Option>
<Option value="closed">Closed</Option>
<Option value="stopped">Stopped</Option>
<Option value="opening">Opening</Option>
<Option value="closing">Closing</Option>
</List>
</ValueType>
<TriggerLabel>Current device state</TriggerLabel>
<ControlPageLabel>Current device state</ControlPageLabel>
</State>Code: Select all
def TEST (self, devAction):
dev = indigo.devices[devAction.deviceId]
if dev.states["doorStatus"] == "open":
dev.updateStateOnServer ("doorStatus", "closed")
else:
dev.updateStateOnServer ("doorStatus", "open")
indigo.server.log(unicode(dev.states))My Modest Contributions to Indigo:
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here
- Colorado4Wheeler
- Posts: 2794
- Joined: Mon Jul 20, 2009 10:48 am
- Location: Colorado
Re: Security Manager Plugin
FD, did you figure this out?
My Modest Contributions to Indigo:
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here
- FlyingDiver
- Posts: 7830
- Joined: Sat Jun 07, 2014 10:36 am
- Location: Southwest Florida, USA
Re: Security Manager Plugin
Yeah, late this afternoon when I was working on the MyQ plugin. Case mismatch. At least, that's what I think it was. Of course, now it's a relay device and I can just use the On/Off state instead.Colorado4Wheeler wrote:FD, did you figure this out?
joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
my plugins: http://forums.indigodomo.com/viewforum.php?f=177
Re: Security Manager Plugin
This may be my new favorite plugin.
Security wise, there is a lot of stuff I track at my house.... motion sensors, doors, windows, etc. I have triggers and variables that track how many times the states of these devices change during the day (it resents all my "counters" at night). If I change house modes or leave the house, all the counters are zeroed out and indigo sends me a text to let me know. (hey, you left the house, all security counters set to zero). When my geofence detects me coming home, I get a roll up of all the counters.... but I have to scroll through a long ass text to see if anything is greater than zero and evaluate it.
My goal with your plugin is to create a counter for it that sets to zero whenever all devices are "Secure". Any change from any device to "insecure" would increase the counter by 1. On return to my house, if the counter is still zero, a simple text "Still Secure" or it could even trigger a separate light on the patio or something so when my wife or I approach the house, we can tell at a glance that our house has remained secured in our absence.
Thank you for writing this and I can't wait till I have more free time to play with it some more.
Security wise, there is a lot of stuff I track at my house.... motion sensors, doors, windows, etc. I have triggers and variables that track how many times the states of these devices change during the day (it resents all my "counters" at night). If I change house modes or leave the house, all the counters are zeroed out and indigo sends me a text to let me know. (hey, you left the house, all security counters set to zero). When my geofence detects me coming home, I get a roll up of all the counters.... but I have to scroll through a long ass text to see if anything is greater than zero and evaluate it.
My goal with your plugin is to create a counter for it that sets to zero whenever all devices are "Secure". Any change from any device to "insecure" would increase the counter by 1. On return to my house, if the counter is still zero, a simple text "Still Secure" or it could even trigger a separate light on the patio or something so when my wife or I approach the house, we can tell at a glance that our house has remained secured in our absence.
Thank you for writing this and I can't wait till I have more free time to play with it some more.
Bill
My Plugin: My People
My Plugin: My People
- Colorado4Wheeler
- Posts: 2794
- Joined: Mon Jul 20, 2009 10:48 am
- Location: Colorado
Re: Security Manager Plugin
Thank you for the kudos, it's always nice to hear success stories! The reasons you like it are pretty much the reasons I wrote it, I needed that kind of functionality in my own house and had a series of triggers and actions and scripts to accomplish it, this makes things easier for me and I'm glad it makes them easier for you too!whmoorejr wrote:This may be my new favorite plugin.
My Modest Contributions to Indigo:
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here
HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy
Check Them Out Here