Updated to 0.4.25 which includes a host of new features and options, my favorite of which is triggering. By invoking the script with the -t flag, a scan operation will only occur in response to receiving an MQTT message posted to /$mqtt_topicpath/scan
.
If -t1
is used, then a message trigger will be required for every scan.
If -t2
is used, a message trigger will be required only when at least one owner is home. Otherwise, periodic scanning will be used. Connect the trigger to a door sensor (e.g., front door, garage door, etc.), and the system will begin scanning for an owner’s departure when the door is used. This will dramatically reduce the number of scan operations performed when at least one owner is home.
For example, in node-red:
Other options include:
-d for printing debug messages
-c for only messaging changes in state of a particular owner or guest device
-b binary messaging only - only print confidences of 100 or 0.
So, if we ran 0.4.25 with the following options:
bash presence.sh -c -b -t2
Then the script would automatically scan (according to behavior_preferences) when all owners are away and will not message the broker at all (since nothing changes when all owners are away). Once an owner arrives home, scanning switches from periodic to triggered. The trigger can be coupled to the front door so that when a second owner comes home and uses the front door, a scan is initiated to detect the user. Only the new user’s status change would be reported.
In addition, the message of the triggering mqtt message can include a duration parameter that will define how long scanning should repeat after it is triggered. The default is 120 seconds.
I know this is a lot; please let me know if anyone experiences issues or does not understand one or more of the new options.