Page 1 of 1

Feature Request: Extra custom state for occupancy

PostPosted: Fri May 06, 2022 3:19 pm
by durosity
Hey

Would it be possible to add an extra custom state for 'Occupancy' being either true or false, and this be set by adding an extra setting in the device config to compare against how long the lastchanged timer is. Eg If the defined timeout is 10 mins and the last change timer is 7 mins then the occupancy custom state would show as true. If the last change time was 11 mins then it would show as false.

I can currently do this using a combination of variables, virtual devices and action groups.. but frankly it's a lot of faf and something like this built into the plugin would be a heck of a lot easier. (And yes I appreciate that it's not true occupancy detection, but it's a good enough approximation and works well enough for my needs)

Check out my amazing mockups. I bet you thought they were the real thing!

Re: Feature Request: Extra custom state for occupancy

PostPosted: Sat May 07, 2022 8:00 am
by FlyingDiver
You could do that with Occupatum now, I think.


Sent from my iPhone using Tapatalk

Re: Feature Request: Extra custom state for occupancy

PostPosted: Sat May 07, 2022 7:00 pm
by Monstergerm
Hi FlyingDiver,
Occupatum sounds like a great plugin for this purpose. However, in its current form it only shows as available devices: Insteon motions sensors, Insteon water leak sensors and Ping Sensors (from Ping plugin).

Can you make your plugin also support DSC Motion sensors?

Also, I noticed the Occupatum plugin is already programmed to run only under Python 3. I got it to run with the current Python version 2.7 and Indigo 2021.2.0 by changing the Server API version back to 2.0 and by making changes to log string formatting.

Re: Feature Request: Extra custom state for occupancy

PostPosted: Sat May 07, 2022 9:02 pm
by FlyingDiver
You should have downloaded the current plugin store release, not the pre-release Python3 version.

You probably also need to use the Masquerade plugin to make on/off sensor devices from the DSC sensor states.


Sent from my iPhone using Tapatalk

Re: Feature Request: Extra custom state for occupancy

PostPosted: Sat May 07, 2022 11:50 pm
by durosity
Ah I wasn’t aware of this plugin! I shall have a look!


Sent from my iPhone using Tapatalk Pro

Re: Feature Request: Extra custom state for occupancy

PostPosted: Sat May 07, 2022 11:52 pm
by durosity
FlyingDiver wrote:
You probably also need to use the Masquerade plugin to make on/off sensor devices from the DSC sensor states.


Is there any way of getting it to run directly from the indigo state? I’ve got about 50 zones, so 50 masquerade devices then 50 Occupasuun is quite a lot!

Re: Feature Request: Extra custom state for occupancy

PostPosted: Sun May 08, 2022 8:40 am
by FlyingDiver
durosity wrote:
Is there any way of getting it to run directly from the indigo state? I’ve got about 50 zones, so 50 masquerade devices then 50 Occupasuun is quite a lot!


50 DSC zones? I would think that only the motion sensor zones would make sense for occupancy sensors. And you only need one Occupatum device for each “area”, which can aggregate multiple sensors as needed. I would be shocked if you actually needed more than a dozen or so.

In any case, Occupatum only works with on/off sensors, and Masquerade was specifically written to create those as needed. I’m not going to duplicate that code into multiple plugins.

Re: Feature Request: Extra custom state for occupancy

PostPosted: Sun May 08, 2022 2:32 pm
by durosity
FlyingDiver wrote:
durosity wrote:
. I would be shocked if you actually needed more than a dozen or so. .


Valid point, I shall have a play and see if I can make a usable setup! Thanks for the idea!

Re: Feature Request: Extra custom state for occupancy

PostPosted: Sun May 08, 2022 5:10 pm
by durosity
FlyingDiver wrote:
You probably also need to use the Masquerade plugin to make on/off sensor devices from the DSC sensor states.


I've run into the same issue as Monstergerm, however I've set up a Masquerade device to mirror a DSC zone (which works and shows on/off depending on if the zone is open/closed) but that device doesn't appear as an option in Occupatum.

I've tried all 3 'Sensor Types' in the Masquerade config but to no avail.

Here's a device output of the DSC Zone in case it helps;

Code: Select all
batteryLevel : None
buttonGroupCount : 0
configured : True
description : DSC Zone 30 - Wired
deviceTypeId : alarmZone
displayStateId : state
displayStateImageSel : Closed
displayStateValRaw : closed
displayStateValUi : closed
enabled : True
energyAccumBaseTime : None
energyAccumTimeDelta : None
energyAccumTotal : None
energyCurLevel : None
errorState :
folderId : 1730343820
globalProps : MetaProps : (dict)
     com.frightideas.indigoplugin.dscAlarm : (dict)
          occupancyGroup : 0 (integer)
          var : None (empty)
          zoneLogChanges : true (bool)
          zoneNumber : 30 (string)
          zonePartition : 1 (string)
          zoneType : zoneTypeWindow (string)
id : 1776005501
lastChanged : 2022-05-09 00:09:04
lastSuccessfulComm : 2022-05-09 00:09:04
model : Alarm Zone
name : Ensuite - Window Sensor
ownerProps : com.frightideas.indigoplugin.dscAlarm : (dict)
     occupancyGroup : 0 (integer)
     var : None (empty)
     zoneLogChanges : true (bool)
     zoneNumber : 30 (string)
     zonePartition : 1 (string)
     zoneType : zoneTypeWindow (string)
pluginId : com.frightideas.indigoplugin.dscAlarm
pluginProps : emptyDict : (dict)
protocol : Plugin
remoteDisplay : True
sharedProps : com.indigodomo.indigoserver : (dict)
states : States : (dict)
     LastChangedShort : 21m (string)
     LastChangedTimer : 21 (integer)
     bypass : nobypass (string)
     bypass.bypassed : false (bool)
     bypass.nobypass : true (bool)
     state : closed (string)
     state.closed : true (bool)
     state.open : false (bool)
     state.tripped : false (bool)
subModel :
subType :
supportsAllLightsOnOff : False
supportsAllOff : False
supportsStatusRequest : False
version : None

Re: Feature Request: Extra custom state for occupancy

PostPosted: Sun May 08, 2022 10:09 pm
by FlyingDiver
Hmmm. I think that might be a bug in Occupatum. Can you open a GitHub issue for that? I’ll take a look when I get home. We’re on the road from Haifa to Jerusalem today.

Re: Feature Request: Extra custom state for occupancy

PostPosted: Wed May 11, 2022 7:55 pm
by Monstergerm
I was not aware of the Occupatum plugin at all. Great plugin for handling occupancy issues.

Since many of us have DSC alarm systems with motion sensors I thought about integrating them in the Occupatum plugin. I made some minor changes to support DSC Alarm Motion Sensor zones and added a few other minor updates. So no need to first Masquerade those motion zone devices. Just make sure that the DSC motion sensor device in the DSC plugin is using the "Motion" attribute.

Of note: I made the changes first to v0.0.4 plugin under Python 2.7 and tested this version. Thanks to Durosity for also testing the plugin. I then transferred those changes to v2022.0.0 under Python 3 but did not test this version since I have not yet installed the latest Indigo app. This version was uploaded to Github for review.