Skip to content

Instantly share code, notes, and snippets.

@cslauritsen
Created November 7, 2018 17:45
Show Gist options
  • Save cslauritsen/08eb8df6bb83decf9025a5e1e2f90e50 to your computer and use it in GitHub Desktop.
Save cslauritsen/08eb8df6bb83decf9025a5e1e2f90e50 to your computer and use it in GitHub Desktop.
Rules for Wasp-in-a-Box algorithm
rule "Norman leaves"
when
Item PresenceNormanGeofence changed to OFF
then
if (PresenceNormanWasp.state == ON)
{
sendCommand(PresenceNormanGeofence, ON)
}
end
rule "Norman presence detected"
when
Item PresenceNorman_PhoneWifi changed to ON
then
if (PresenceNormanGeofence.state != ON) // just in case
{
sendCommand(PresenceNormanGeofence, ON)
}
if (PresenceNormanWasp.state != ON)
{
sendCommand(PresenceNormanWasp, ON)
}
end
@cslauritsen
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment