EDIT : the issue seems broader, and also applies to any Item type that is not an exact match with the channel type, and for both the default and follow profile.
It seems that I cannot CREATE a link to a group item with the “follow profile” anymore. (disclaimer : From the GUI. I cannot tell with config files, and don’t know if it’s even possible).
I emphasize CREATE, because my existing configuration still works.
My use case:
I want a lamp to receive an ON command when all the ceiling lights are ON.
My previous realization :
I use a group with the celing lights inside, with an aggregator function “all ON then ON else OFF”.
From the lamp thing switch channel, I linked to the group and used the follow profile.
It still works.
But my issue now:
As I want to add another lamp to the system, I now realize that even if I can still link a switch channel to the group, I cannot use the follow profile. It is greyed out.
Interesting enough : when I edit the existing “link to group with follow profile”, the follow profile is not listed as a choice, and so no profile is “selected” (but I’m pretty sure it’s still here).
Workaround:
I can use a “script” profile with the “Item State To Thing Transformation” to achieve the same (but not very user friendly)
My question:
Is it a bug, or is it the normal behaviour (meaning that the follow profile for group added here has been retired) ?
There must have been some change in MainUI to disable the use of the follow profile for links to Groups or links of this type. I’m not sure when or why that happened. File an issue on MainUI I think becuase it sounds like this is supposed to work.
Thank you for the confirmation and the informations.
Indeed, it seems a GUI issue, as I just tried (and succeed) with a direct POST to the backend with the “follow” profile.
Hum, I’m wondering if there is not something broader than my initial assumption.
I cannot link a Dimmer channel to a Switch item with the Default profile (or follow).
I think, but I’m not 100% sure, that I had been able to, on previous openHAB version. Am I wrong ?
And I can confirm that it is a GUI limitation.
When bypassing the validation, I can link a Dimmer channel to a Switch Item and use it just fine.
Then, it’s broader than just the group related issue I found at first.
I can state the current behaviour like this:
“When linking an item/group to a channel, the GUI refuse to use Default of Follow profile, if the item is not EXACTLY the exact same type of the channel’s.”
Is this the wanted behaviour ? Whatever the response,
either the GUI is too restrictive
or the API is too lax
(I think the issue is the first one, that the GUI should accept, as it works fine)
I’m pretty certain you cannot and never have been able to link a Dimmer Channel to a Switch Item. Dimmer Channels publish PercentType updates and Switch Items can’t handle that.
And there really is no reason to do this though, You can treat your Dimmer Item as if it were a Switch Item. Linking Channel to a Swith Item and a Dimmer Item is redundant. Just link it to a Dimmer Item and where you want to have a Switch, pretend the Dimmer Item is a Switch and it will work like a Switch.
To remove ay doubts, I just tested with openHAB3, and we could link a Dimmer channel to a Switch.
There is IMHO some use cases, for example:
a dimmer (or color), but you don’t want to use the dimmable (or color) function, just to be able to light on or off with a single click, no slide (for example for a kid)
the use case in the first post, but also with different types (follow profil to another item or group, and they can be from other types but still compatible conceptually, for example a color bulb change ↔ and you want to on/off switch another bulb)
Default/follow profile are not greyed out, despite being a dimmer to switch link:
I also tested with openHAB 4.3, but this time with configuration .items files, and it also works: Switch LightSwitch "Light Switch test link" {channel="hue:group:0017886f5c11:1:brightness"}
(the hue channel is a dimmer)
I can then light on or off the hue bulb with the switch item through the dimmer channel.
I now think those “edge cases” are at the discretion of the binding developer.
For example, I checked the code for the hue binding, and it explicitely has case to deal when a color channel receives different command, such as ON/OFF
So, the GUI behaviour is not consistent with previous version or the openHAB runtime backend. I will update the github issue with these informations, and I of course welcome anyone to tell what they think about this.
So link to a Dimmer Item and put it on the sitemap or MainUI with a toggle widget. You shouldn’t change the type of the Item only because you want to interaact with it in a different way.
A Dimmer Item should also work in the first case. For all purposes, a Dimmer Item is a Switch, but a Switch is not a Dimmer. You can always use a Dimmer as it if was a Switch. You cannot always use a Switch as if it’s a Dimmer.
Likewise, a Color Item can be used and presented as if it were a Dimmer or a Switch. You don’t need a separate Dimmer or Switch Item for this.
OH 3 had almost no validity checking for this sort of thing. Just because it was allowed there doesn’t really tell us anything.
But if you change the state of the bulb outside of commanding this Item does the Switch update or does it error with “27 is not a valid state for a Switch”? That’s the key. You can command or update a Dimmer with ON/OFF, but you cannot command or update a Switch with a PercentType and a Dimmer Channel is always going to update using a PrecentType.
Yes it works. Don’t know how however
Setup and tests done:
a switch item linked to a dimmer (brightness) hue channel
a dimmer item linked to the same dimmer (brightness) hue channel
→ Updating the dimmer item to a non zero value set the switch item to on (and light the bulb)
→ Updating the dimmer item to zero set the switch item to off (and turn off the bulb)
→ Updating the switch item to ON set the dimmer to 100 (and light the bulb)
→ updating the switch item to OFF set the dimmer to 0 (and turn off the bulb)
→ Switching off the bulb with a physical hue remote set the the dimmer to 0 and the switch to OFF
→ Switching on the bulb with a physical hue remote set the the dimmer to some non zero value and the switch to on
So link to a Dimmer Item and put it on the sitemap or MainUI with a toggle widget
I actually have been linking Switch Items to Dimmer Channels for years (possibly as far back as OH2, but I don’t exactly recall). I do it for a couple of different organizational reasons. It has always worked just fine for me. It seems that any non-zero dimmer command is interpreted as ON appropriately.