[SOLVED] Timeout for hubAction Command

Is there a way to add a timeout to a hubAction command.

I have a couple devices (WeMo Mini Outlets) that for some reason randomly end up in a state where they are not offline, just stop responding. When the hubAction command is sent to it, it hangs waiting for the device to respond and in turn causes the hub to stop processing any schedules. To fix it I unplug the device and then reboot the hub. Plugging it back in fixes it again, but they randomly do it again. I'm probably going to replace these 3 devices with other outlets but I'm hoping this won't happen with other devices I have.

Is there a way to add a timeout to that hubAction command so that if the device doesn't respond in a certain time it will just fail and continue instead of hang while waiting? Or is there a way to do an asynchronous hubAction command so the device doesn't wait on the response.

@patrick I see in the latest update (119) there was a fix "Added timeout for HTTP calls to prevent app from hanging."

Sounds like the same thing I was having with hubAction and my WeMo outlet drivers. Was this timeout also added to the hubaction routine?

Yes, anything sending any HTTP request hubaction, httpPOST, async, etc. now has a timeout attached to it to free up the thread and not wait indefinitely.

1 Like