Skip to content

Instantly share code, notes, and snippets.

@jcollie
Created May 5, 2016 22:45
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save jcollie/f46de277e9339880cd6ec47cad4ec4e2 to your computer and use it in GitHub Desktop.
Save jcollie/f46de277e9339880cd6ec47cad4ec4e2 to your computer and use it in GitHub Desktop.
Ring.com integration with openHAB via IFTTT and my.openHAB
curl -X POST -H "Content-Type: text/plain" -d ON http://localhost:8080/rest/items/ring_front_door_motion
curl -X POST -H "Content-Type: text/plain" -d ON http://localhost:8080/rest/items/ring_front_door_ring
Group MyOpenHAB
Strategies {
default = everyUpdate
}
Items {
// persist all items every hour and on every change
MyOpenHAB* : strategy = everyUpdate
}
Switch ring_front_door_motion "Ring Front Door Motion" (MyOpenHAB) {}
Switch ring_front_door_ring "Ring Front Door Ring" (MyOpenHAB) {}
rule ring_startup
when
System started
then
sendCommand(ring_front_door_motion, OFF)
sendCommand(ring_front_door_ring, OFF)
end
rule ring_front_door_motion
when
Item ring_front_door_motion changed to ON
then
createTimer(now.plusSeconds(30)) [|
sendCommand(ring_front_door_motion, OFF)
]
end
rule ring_front_door_ring
when
Item ring_front_door_ring changed to ON
then
createTimer(now.plusSeconds(30)) [|
sendCommand(ring_front_door_ring, OFF)
]
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment