Changing the built-in Vera behaviour for SetCurrentSetpoint on TRVs

I’ve spent a lot of time recently working on some code to better handle TRVs on UI5 (not dared try UI7 yet).
Those of you who have Danfoss or StellaZ TRVs will know the problem - when you change a setpoint either via UI5 or via LUA luup.call_action("urn:upnp-org:serviceId:TemperatureSetpoint1_Heat", "SetCurrentSetpoint",10,dev_id)
The vera will try to transmit the new SetPoint straight away - the device will of course be asleep but the Vera will do 5 retries before deciding to wait for a wakeup - in my case that takes over 30 seconds and no other z-wave commands will get through during that time - so lights won’t turn on, sensor reports get stuck etc. It’s just plain wrong!

What I’ve done is developed some code that basically watches for a wakeup and then does the SetPoint change (using the call above). And I’m having great success with it - it’s miles better than the standard behaviour.
But - I’m conscious that it’s still a hack! the ideal way to fix this problem once and for all is to change the standard UI5 behaviour such that when it sees an SP change it waits for a wakeup and doesn’t even try to send the new SP straight away and I’m looking for a way to do that.

I’ve crawled over as much built in code as I could find - even SCP’d almost every file off the Vera so I can search - but I’m stumped.

Does anyone know of any way I can get to the underlying code for luup.call_action("urn:upnp-org:serviceId:TemperatureSetpoint1_Heat", "SetCurrentSetpoint",10,dev_id) and either change it or copy it?

Failing that is there a way from LUA code to catch a wakeup really quickly and react to it? I’m using variable_watch on LastWakeup which does work but to do that the underlying engine must have spotted the wakeup, then changed the value of LastWakeup and then checked for and called any variable_watches registered - can I somehow get in at that lower level?

I’d appreciate any clues or pointers.

Thanks.

I’m guessing there’s no easy answer to this - I’ve had some suggestions - thanks for those.

I’m currently pondering the following idea

If I replace the implementation file for a TRV with one of my own then whenever the TRV wakes up would it fire the LUA code in the block? If so then I’d know when that code was fired the TRV was awake and I could talk to it.

(leaving aside any issues of having to parse what comes in for now)

If I replace the implementation file for a TRV with one of my own then whenever the TRV wakes up would it fire the LUA code in the block? If so then I'd know when that code was fired the TRV was awake and I could talk to it.

A Z-Wave device doesn’t have an Implementation file. The processing is handled deep in Vera’s core code. I haven’t tried it but setting an Implementation file on a Z-Wave device is not likely to do what you want and may have very interesting consequences…