Since Alexa and openhab treat scenes differently I think this has to be “hacked” through a work around…I’m trying to accomplish the following:
say to alexa: "Alexa set Living Room Scene to 20%"
Openhap2 would then set 2 dimmers to 20% and turn on a switch
then I could say to alexa: "Alexa turn Living Room Scene off"
Openhab2 would then set 2 dimmers to 0% and turn the switch off
I’ve read a few posts on this, Examples of Scenes, being 1 but that is about a switch item not the dimmer item I need. I also looked at this one (Scenes in OH) which would work with the openhap app but Alexa would know what to do with that I don’t think.
I think the pseudo code for this is something like:
either
- assign the dimmers and switch to a dimmer group named “Living Room Scene”
- or just create a dimmer item named "Living Room Scene"
when a call is made to change the state of the group or dimmer item then in the rules I would capture the percentage variable (e.g. 20%, 40%, etc) and with that variable I would set the dimmer to it, and have an if statement where >0% set switch to on, else set switch to off
But I’m not sure exactly how to write all this, namely to get the % spoken to alexa. An alternative I guess is use a switch item for each scene (e.g. “Dinner Scene”, “Breakfast Scene”, “Guests Scene”) and when those were turned on I could set the dimmer percentages but I kind of like the approach where I can on the fly set the scene of dimmers to a percent and turn on switches.
Anyone have some ideas? Or perhaps there is a better/more proper way to handle this?