How to report back to Alexa when a command has not been executed?

Hi everyone!

I'm developing a driver and sometimes, depending on a variety of conditions, it may reject a command.

My driver reports with a custom attribute when a command is rejected, so, with RM it's not difficult to intercept this rejection - just check the custom attribute.

However, I'm experiencing problems with Alexa: she doesn't understand that the command was not executed. After some 30 seconds after the command is set, it replies with a "Sorry, the device does not answer".

I've checked if I could return a value from the method that executes the command, but there is no return value available (void).

I don't want - for now - that she answers the user with the reason why the command has been rejected - just answering that the command was rejected would be enough, since the user may want to use RM and Follow Me to send a personalised message to Alexa explaining why the command was rejected, based on the custom attribute's value.

I've found that there's a way of telling Alexa about an error ( Alexa.ErrorResponse Interface), maybe using the NOT_SUPPORTED_IN_CURRENT_MODE (but, strangely and if I didn't get it wrong, it is not possible to send back a personalised message). However it's available only inside an Alexa skill (Hubitat Alexa skill) and I don't know how to trigger it from HE.

So, this is my question: how to report back to Alexa when a command has not been executed?

Thanks in advance for any help!

I believe Hubitat's Alexa skill just waits for the value of the attribute associated with the command that you sent (e.g., the switch attribute for an on() command) to change to the expected state, then gives that "timeout error" if it doesn't change within the allotted time. In any case, short of making the driver works how this app expects it do, I don't think it's any behavior you'd be able to adjust on the driver side (but if it's "rejecting" the command, isn't the device indeed not responding to it? :slight_smile: ).

1 Like

That's exactly what I think is happening too.

Actually it is.

However, I'd like to make the operation more "friendly", avoiding forcing the user to wait to the timeout to be triggered. If the driver could somehow notify the skill an by proxy Alexa, even if not a very clear message on why the command was rejected but at least with a promptly response, it would provide a better user experience,

I know ... it's not a perfect world. Sometimes we need to accept things as they are, but doesn't mean we cannot try to make it better ... :smiley:

Thanks for the comments!

Marco