Refresh multiple device states at once


(Daniel McDougall) #1

Hello all, I’m tapping into my alarms systems website and using the httppost response to get the details of my devices

for each device I’m refreshing individually and using an if to get that particular devices state.

I’m using pollster to make this a little faster.

thing is that means I’m:
logging in,
getting the state,
logging out

10 times (for each device) every 5 minutes. which seems excessive when i can get all the states from calling it once.

so how do i use that response and hand out those states to each device.

i hope that makes sense i always feel I’m terrible at explaining myself


( I hate Mondays) #2

You need a Smart App that manages those devices. Either creates them as child devices, or accesses them through a Settings input. What alarm system are we talking about?


(Daniel McDougall) #3

the yale smartphone alarm system.

is there an example of a smart app that does this i can use as a basis to work back from. I’m no developer but i muddle through.


( I hate Mondays) #4

Not sure about that. I have an app here that does what you want, albeit on different services. Are you logging in to a public facing server to read the devices, or is it in your local network?

You’ll find in that app:

  • httpGet/httpPost to perform your login (it logs in to MyQ and AT&T, you’ll need to figure out your details)
  • sendEvent - uses that to send events to the child devices it generated (as part of device discovery) - device.sendEvent(name, value) - that’s how you update the devices.

Set a cron schedule to every 5 minutes and login, get the info, use sendEvent on your devices. This is pretty much the workflow.

Good luck, let us know if you get stuck, this community here is great at providing such support.