This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
The Homey Community has been moved to https://community.athom.com.
This forum is now read-only for archive purposes.
Power Strip - socket class - multiple onoff
gn0st1c
Member
in Developers
i plan to code a driver for a power strip with individually controlled 4 outlets.
reading the documentation, socket class seemed logical but it only has one onoff capability. i looked at examples, search the forum but could not find an answer.
any tips on coding multiple onoffs?
reading the documentation, socket class seemed logical but it only has one onoff capability. i looked at examples, search the forum but could not find an answer.
any tips on coding multiple onoffs?
Comments
i just got my homey yesterday
to learn the platform i decided to use my esp8266 devices with homeyduino.
my issue was already marked as bug on github.
- create a single device that has multiple `onoff` capabilities (`onoff.0`, `onoff.1`, `onoff.2`, ..., see the documentation, specifically "Using the same capability more than once").
- or create a new device for each outlet, so adding your device, with 4 outlets, would create 4 Homey devices (during pairing, you can add an entry for each "device" in the array that's created in `Driver#onPairListDevices`).
I've seen both solutions being implemented in apps, so from what I know, there isn't really one accepted solution.https://github.com/athombv/homey-arduino-library/issues/41
Got the same problem, hope they solve it soon.
there is no mention of this limitation in the documents; https://apps.developer.athom.com/tutorial-Drivers-Reference.html
i was using the socket class and was wondering why my measure_temperature was not showing. changing the class to sensor fixed that. (for sonoff THxx)
for multiple relays, i'm using relay1_set, relay2_set .. actions and relay1_state, relay2_state .. conditions. (again for socket class, even if you add a second onoff, it doesn't show up on device)
and for one of my "wifi plugs" which has RGB leds that you can set, i had to use light class.
i'm sure at one point they'll remove several of these restrictions so we can get rid of these work arounds.
this is good news: