Shelly binding - how to have a switch items with 2 different channels


I’m trying to move from MQTT to Shelly binding to manage my shellies. For most of them it is a no brainer but for some I’m a bit stuck. I know I miss something but not sure why…

With MQTT, I was able to have state and command of a switch item connected to different MQTT topics. This was configured in the channel of the thing that I would link the switch item to, as below:

Thing topic shelly1telerupteur "Shelly 1 - Télérupteur" @ "2nd floor" {
        Type switch : power0     "Power"                    [ stateTopic="shellies/shelly1telerupteurcouloir2nd/input/0", transformationPattern="", commandTopic="shellies/shelly1telerupteurcouloir2nd/relay/0/command", on="on", off="on" ]

I’m not too sure how I would be able to do the the equivalent with Shelly Binding? It by connecting the same item to 2 channels? An example would be very welcome.

I hope my question makes sense… Thanks,

For me, it does not make sense.
Could you please elaborate a bit more what you want to achieve.

The other way of saying it is, I think, that I’m trying to have a switch that is acting on a channel of the thing when activated from openhab and reflecting the status of another channel to display its state.

From a shelly binding point of view, I need the relay#output to be activated when I click on the switch from openhab, but I need it to reflect ON or OFF based on the relay#input…

Does it make more sense this way?

That is certainly possible
both channels will receive any commands sent to the Item
both channels will pass any incoming updates to the Item
you need to consider exactly what both channels do in terms of “read” and “write” for predictable effects.

Still does not make sense for me.
Depending on your shelly config, input and output have the same state. If input is configured as momentary switch, it‘s state is absolutely irrelevant for the UI.
IMHO you only need the output channel when using the binding.

I use a shelly 1 to drive a module like this one:

Following this setup:

I know there is an option to replace the “telerupteur” with the shelly 1 entirely but my current setup is this one, it works welll with the shelly piloted viw MQTT. And I am trying to get it to work with Shelly Binding instead of MQTT.

Update : for this setup, I have changed the electrical setup and got rid of the “telerupteur” device entirely and kept only the shelly… This means, for this case at least, I don’t need to get the 2 channels on a single item…

1 Like