OmniThing
OmniThing copied to clipboard
Speed of actioning an ST operation
I have 24 devices configured using commands. I have optimised my code so that they return in < 1second providing the status of the device being controlled. This means that the entire polling loop is taking up to 30 seconds. I have the polling interval at 180 seconds with a 5 second gap between each device.
But, the devices are being polled for their status continuously in a loop. So its can take up to 1 minute (2x30 seconds) for an on/off action to be actioned by omnithing and up to 2 minutes for the status to appear in the ST app. I also have everything set to multithread switched on.
- Is it possible to decouple the actioning of ST commands from the status updates?
- is it possible to return the result of the command back to ST immediately?
- why is my config running the polling loop continuously rather than every 3 minutes?
That's an interesting problem. I haven't tried adding more than a couple commands at a time. The contact sensor actually has a constantPoll option that you can disable if you only want to poll on your triggers. I assume you're using the Switch device type though. I'll add a new input type that will run another input in a background thread. That shouldn't take long for me to implement.
A hacky, temporary solution you could use is have a separate script running on your machine that loops polling all the data you need. It can then write the outputs to files on your filesystem. The omnithing commands can just read those files then which should be really fast.
I'll try to add the asynchronous input type tonight or tomorrow.
Good idea, ST is not the only thing that could use the current status values so using a status file would be useful elsewhere.