Hi Jonathan, Thanks for that!
I tried this exact same thing yesterday without success ( I also tried different variations )
result:
Unable to determine open function code in [switch_1:[type:Boolean], countdown_1:[unit:s, min:0, max:86400, scale:0, step:1, type:Integer], tr_timecon:[unit:s, min:10, max:120, scale:0, step:1, type:Integer], countdown_alarm:[unit:s, min:0, max:86400, scale:0, step:1, type:Integer], door_control_1:[range:[open, close], type:Enum], voice_control_1:[type:Boolean], door_state_1:[range:[unclosed_time, close_time_alarm, none], type:Enum]]
based on the available functions:
- functions: {"switch_1":{"type":"Boolean"},"countdown_1":{"unit":"s","min":0,"max":86400,"scale":0,"step":1,"type":"Integer"},"tr_timecon":{"unit":"s","min":10,"max":120,"scale":0,"step":1,"type":"Integer"},"countdown_alarm":{"unit":"s","min":0,"max":86400,"scale":0,"step":1,"type":"Integer"},"door_control_1":{"range":["open","close"],"type":"Enum"},"voice_control_1":{"type":"Boolean"},"door_state_1":{"range":["unclosed_time","close_time_alarm","none"],"type":"Enum"}}
and the status of the component when I manually press the physical button on the device ( it is just plugged in on my desk ):
Current States
- door : closed
- switch : on
I would imagine that "switch"/"switch_1" is the one to activate.
I did not find any specifc instructions on the parent driver ( maybe it needs to be added, idk)
soooo
I tried multiple things, and utimately, this worked - but not perfectly:
// Component command to open device
void open() {
if (device.currentValue('door') != 'open') {
//parent?.componentOff(device)
parent?.componentOn(device)
// pauseExecution(200)
// parent?.componentOff(device)
//parent?.componentRefresh(device)
}
}
// Component command to close device
void close() {
if (device.currentValue('door') != 'closed') {
parent?.componentOff(device)
parent?.componentOn(device)
//pauseExecution(85)
//parent?.componentRefresh(device)
//parent?.componentOff(device)
}
}
that is the only way it physically worked (it needs the off before ON when requesting a close commend -- go figure )
as you can see, i tried ( lines added as comments will be removed) to set the device switch status to off ( to reflect reality ) without success, in hubitat, the device status for "Switch" always stay as "on" for open command, and OFF for close command, so i suspect that the functione is not perfectly the right one...
now... the physical switch returns automatically to OFF after 1 second, which is as expected for a garage door activation, I simply need to find a way to either update from physical, or program it to off
physically pressing the button on the device shows "on" for one second in the Hubitat device status, then back to "off" --> that is the expected behavior.
hope this helps