I’m not sure what I’m meant to do here, I get linked to a feedback form and don’t see anything else. Is this a bug?
I don’t think that’s possible with Homey to reliably detect that a command got received correctly. It highly depends on how the app developer implemented the capability changes.
In some cases, the capability listener throws when an error occurs (e.g. HTTP request to the device failed). When this happens, the error will get returned. But the error can also get catched by a catch block that only logs the error and then does nothing, which means it looks like the capability change got accepted, until the next poll or change where the app changes it back.
Also, for example a WebSocket-based connection where the Homey app sends a message to the manufacturer’s server, that will always return correctly when the message got sent. But that doesn’t mean that the device itself is online, it can just fail a few seconds later and then the app changes it back to the previous state.
Devices can also be marked is offline with setUnavailable(), optionally with a custom (translated) message that will show in the Homey mobile app and Web App. These are also readable from the Homey API.
Response from API:
You can see
available is set to false, and there is also the custom message.
In my own apps, I usually mark the device as unavailable if it’s reported as offline on the manufacturer’s server, or if the app can’t connect to the manufacturer’s server. Often with a custom message like “The (manufacturer name) server is unreachable, please check your internet connection.” or when the device itself is offline “The device is unreachable. Is it powered up and connected to the internet?”. But not all app developers do this, there are also many apps that don’t mark devices as unavailable, it’s not a requirement to publish to the Homey App Store at least.
So there are many ways that something can fail, sometimes even silently. However, there is 1 way to determine when an action failed later on: with the homey.insights.readonly scope, you can get the logs for the device.
(the many Turned on/off in this case were just tests with the app since I was developing the app)
And that contains the sources as well, it can be the mobile app, web app, a Flow or Google/Alexa, which also show the user who controlled the device. There is also the Homey app, in that case the Homey app that the device is connected through switched the device, this usually happens when an action got triggered from an external source (using the manufacturer’s own mobile app or physically on the device using a button, etc.). If the device gets switched back off by the Homey app shortly after turning it on, it’s probably because the request failed. But this does not work for all actions (dimming, setting color, setting temperature, etc. are not logged there).
Also, Flow starts can’t be verified, those don’t return any errors when you start them the regular way. You can also run it in “test” mode, there you can see everything, but for Advanced Flows this deliberately slows down the Flow since it’s meant to show in the web editor where you can then “follow” the Flow. And I don’t think that’s available in the homey.flow.start scope either.