Controlling a Device with more than two states
Posted: Tue Jan 12, 2021 1:43 pm
I've been experimenting with SUPLA since yesterday on an ESP8266 board and have managed to use one of the demo sketches to control two relays, each showing as switches in the SUPLA app, and much to my delight have added both of these switches to my google home devices and can control them using my smart speaker. So far, so good!
However, my finished project will have five relays, and I only want one to be on at any one time. If possible, I'd like my project to show as one device in google home, with the ability to set 5 different states I.E. 'Set device to state 1' ( where relay one is on, and all others are off) as opposed to five separate devices with two states (on or off).
From what I've been able to tell so far, SUPLA currently does not support such a device. Can anyone tell me if that is correct? I've not been able to find a definitive device list with the relevant capabilities in the SUPLA app or when connected to google home.
Assuming that I'm right, my idea is to create something like a dummy 'dimmable' light device, where my sketch captures the dimming level sent from the SUPLA server and uses it to switch on the appropriate relays (perhaps at 100% brightness, the sketch turns on relay one, and the others off, and at 80% it turns on relay 2, and all others off etc.)
I would then set up routines in google home so that when I ask 'Set device to state 1' it sends a command to set the brightness of the light to 100%
I'd love it if someone could tell me if this is possible, and if so point me to any example sketches or other resources where I may be able to learn how to get info sent from SUPLA server to the device and use it in my sketch.
Thanks!
However, my finished project will have five relays, and I only want one to be on at any one time. If possible, I'd like my project to show as one device in google home, with the ability to set 5 different states I.E. 'Set device to state 1' ( where relay one is on, and all others are off) as opposed to five separate devices with two states (on or off).
From what I've been able to tell so far, SUPLA currently does not support such a device. Can anyone tell me if that is correct? I've not been able to find a definitive device list with the relevant capabilities in the SUPLA app or when connected to google home.
Assuming that I'm right, my idea is to create something like a dummy 'dimmable' light device, where my sketch captures the dimming level sent from the SUPLA server and uses it to switch on the appropriate relays (perhaps at 100% brightness, the sketch turns on relay one, and the others off, and at 80% it turns on relay 2, and all others off etc.)
I would then set up routines in google home so that when I ask 'Set device to state 1' it sends a command to set the brightness of the light to 100%
I'd love it if someone could tell me if this is possible, and if so point me to any example sketches or other resources where I may be able to learn how to get info sent from SUPLA server to the device and use it in my sketch.
Thanks!