I would like to create a group switch that is something like 'Upstairs Lights", but still be able to toggle the individual. So for example, I could have:
Upstairs Hallway Lights: On
Master Bedroom Light: Off
But if I toggle the ‘Upstairs Lights’ switch they will both turn off or on. In other words, I don’t want the individual switches to change the state of the ‘grouped’ switch.
Is this possible? If so, how? Thanks!! I’m getting myhead wrapped around this thing, so if you point me in the right direction, I can probably figure it out.
So I exposed the group in the config of the cloud connector, but it isn’t showing in the items on myopenhab. I do remember last time I added stuff it took a while, so I’ll let it go for a bit and see if it shows.
I don’t do myopenhab, but I think you need some change in Item state to trigger the “upload”.
Groups are special Items, so far as state goes. You cannot directly update a Group state, it can only be assigned by some aggregating function - something like SUM that takes all the member states into account. And that’s only going to work when you give the Group a type, a flavour if you like, so that it can look a bit like a regular Item.
Example (in xxx.items file form, you can do similar things in PaperUI) Group:Number:SUM someGroup "My group" ...
For a Group of switches, this is fairly typical Group:Switch:OR(ON,OFF) ...
I understand the first part (and suspected that may be why I don’t see it in MyOpenHAB), but I didn’t follow what I actually need to do. Below is the actual content that is relevant from my items file:
So I removed the existing Upstairs group (not sure if that was right), and added the Group:switch…
I then added “Default item=Upstairs label=“upstairs master”” to my sitemap, but it didn’t actually create a master switch, it just created another group, with 3 switches inside.
Currently I have a webserver running at my house, and I am using the REST API to do what I want, but I’m just concerned that it may be a security risk. But at least it is working right now.
As Johannes says, use a Switch widget in your sitemap, not let it default (to a Group widget, naturally enough). Sitemap does what you tell it to.
It’s not obvious that sitemap lets you choose any widget to display/control any Item (although not all combinations make sense)
Displaying your Group Item in a Text widget for example will show you the status without the switching control knob.
You can give your Group an <icon>, just like the real switches.
Thanks everyone! I got it to work! Really appreciate the help! Learned a lot in the process as well.
Now using ifttt.com, and my Google Home, I can say things like “OK, Google, turn off the downstairs lights”, and they all turn off.
The only weird thing is that sometime the basic UI doesn’t update 100% correctly. probably 50% of the time, the dimmers will not go to 0 or 100%, they will settle someplace in the middle. I have already changed some of the settings in the actual dimmer switch to alleviate this same problem seen when I manually update the dimmer level (by pressing the hardware), but it still has issues in the above scenario. If I repeat the command, then it fixes it though, so not a huge deal, or if I wait for a while between command (which is probably likely in the real world), then there is no issue.