OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Do something on station start and stop?

Tagged: ,

  • This topic has 3 replies, 3 voices, and was last updated 9 years ago by Ray.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #38568

    Pat
    Participant

    I’ve been reading over the API documentation and it’s great. I’m thinking of hooking this into my SmartThings setup. To complete part of that integration, is it possible to “do something” when a station starts and stops? For example, if zone 1 starts, I’d like to send an HTTP POST so that my SmartThings hub is aware that the zone is on. Likewise for when it stops.

    I suppose I could poll the API every 5, 10, 30 seconds to get station status? But “subscribing” to events would be much cleaner – if there’s a way?

    Thoughts?

    #38579

    DaveC
    Participant

    There are no unsolicited event notifications, yet. I’d like to see them and have asked. In some other posts Samer has indicated they are considering them, if not already working them. I don’t have any info on what the mechanism would look like. I would think that the supplied apps would benefit from such a mechanism, too.

    Until then I’m trying to balance overhead vs currency of display. I poll for general info every 15s (settable) and trigger additional requests whenever there is an action coming from my app so that displays updates quickly. Polling for specific info occurs more or less frequently depending on the type of info and the state of the controller.

    #38580

    Pat
    Participant

    I suppose I could poll the API every 5 seconds for zone status. That’s what the phone app appears to be doing, too.

    #38656

    Ray
    Keymaster

    Yes the app polls the controller (i.e. gets json data) every few seconds to stay in sync with the current status.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums Hardware Questions OpenSprinkler Pi (OSPi) Do something on station start and stop?