My roomba DTH relies on polling your local server every x minutes (you can set the interval in the app)
As a user pointed out, I need to implement a health check to show the device as offline if the server or robot is unresponsive.
Here’s the problem. I tried inputting a bogus IP address that doesn’t exist for my server, and found that the sendHubCommand still ran my polling, and did not return any sort of error.
Here is what I’ve tried and the result:
Without an error I can’t make an if statement.
The documentation on sendHubCommand isn’t super clear. What should I be doing in order to check the connectivity? How can I make it return an error?
My alternative solution is to ping the server and robot with every polling interval and if either doesn’t respond with 200 to do sendEvent(name: ‘healthStatus’, value: ‘offline’)
Any better ideas? That seems needlessly complicated and ridiculous.