I am using the valve accessory, which only has 'setActive' for turning the valve on and off. The problem is, I need to send a different command for on and off, such as:
I thought I would be able to do this using an if function, but I do not know how to get whether it's an on or off command from the HomeKit switch to use in the if function.
I managed to work this out
if (message == true) return JSON.stringify({'cmd': 6, 'device_id': 'xxxxxxx', 'duration': 600}); return JSON.stringify({'cmd': 7, 'device_id': 'xxxxxxx'})
I am using the valve accessory, which only has 'setActive' for turning the valve on and off. The problem is, I need to send a different command for on and off, such as:
The 'getActive' valves are true and false.
I thought I would be able to do this using an if function, but I do not know how to get whether it's an on or off command from the HomeKit switch to use in the if function.
Any help would be appreciated.