hubAction callback not working

using Telnet, I'm issuing a hubAction with a callback definied in the options map. But that function is not being called for the callback, rather the generic parse function (used for different actions) is being called.

hubitat.device.HubAction(s, hubitat.device.Protocol.TELNET, [callback: parseProgramming])

Am I missing something?

callback does not work for telnet (also zigbee and zwave) since they are implemented as asynchronous. We do not send telnet messages and wait for a response to process since it is a persistent connection, instead we have a listener that will take messages as they come in on the telnet connection and hand them off to parse.

1 Like

Oh :disappointed_relieved:

I was trying to set specific callback methods depending on the type of telnet message I sent, which didn't work and then I came across this post. To confirm, if you use telnet everything will comeback to parse, the callback option in the hubAction is ignored.

Correct?

And I'm presuming the timeout option in the hub command is ignored for the same reason?

What are you hoping to use that timeout option for?

I think we have talked about my thermostat driver before that uses telnet. At the moment I use pauseExecution(1) 5 times to check if parse() has received a response. After 5 seconds of waiting it assumes no response is coming and resends the command. I was hoping the HubAction timeout would automatically wake up parse after 5 seconds to give it the error message.

Makes sense. I think your guess that it isn't supported in this case is likely true (someone from Hubitat could confirm).

I have used that timeout setting successfully in other cases where there is an underlying keep-alive for the persisted connection, like with websocket ping-pong operations.