Shelly Binding

There are various builds of the binding out there? Are you referring to the version coming with the OH 3.4 release? This also include a NPE fix for devices without an external add-on switch.

Hi, the shelly binding is working great, and the shelly manager is very helpful, thanks for all the hard work put into it.

I am experiencing a strange issue with my shelly TRVs, where intermittently the current profile is not updated correctly. I have about 17 TRVs installed, and I am changing the profile by sending the command to a group, where all of them are contained. When changing the profile from 1 to 2, it works reliable on all devices, but when I am changing back from 2 to 1 after a few days, some devices fail to update their profile.

Interestingly, the item state is updated, so in OpenHAB it looks like the profile has been changed correctly, but when you log into the device directly, you can see that the old profile is still active.

I already checked the logs, but couldn’t find anything unusual, all shellys get an ItemCommandEvent, then an ItemStatePredictedEvent and the ItemStateChangedEvent afterwards. Devices which update the profile correctly fire an additional ItemStateChangedEvent, when the target temperature has been changed.

2022-12-18 12:00:00.299 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'gHaupthaus_Profil' received command 1.0
2022-12-18 12:00:00.317 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HaupthausSaal2_Profil' received command 1.0
2022-12-18 12:00:00.330 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HaupthausSaal1_Profil' received command 1.0
2022-12-18 12:00:00.345 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HaupthausSaal4_Profil' received command 1.0
2022-12-18 12:00:00.354 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HaupthausSaal3_Profil' received command 1.0
2022-12-18 12:00:00.363 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HaupthausWCLinks_Profil' received command 1.0
2022-12-18 12:00:00.371 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HaupthausWCRechts_Profil' received command 1.0
2022-12-18 12:00:00.401 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HaupthausHimmelbettzimmer_Profil' received command 1.0
2022-12-18 12:00:00.410 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HaupthausKinderzimmer_Profil' received command 1.0
2022-12-18 12:00:00.448 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HaupthausWeltliteraturzimmer2_Profil' received command 1.0
2022-12-18 12:00:00.457 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HaupthausKrimizimmer_Profil' received command 1.0
2022-12-18 12:00:00.514 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HaupthausWeltliteraturzimmer_Profil' received command 1.0
2022-12-18 12:00:00.528 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HaupthausSimmelzimmer_Profil' received command 1.0
2022-12-18 12:00:00.541 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HaupthausBadRechts_Profil' received command 1.0
2022-12-18 12:00:00.549 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'HaupthausBadLinks_Profil' received command 1.0
2022-12-18 12:00:00.550 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HaupthausSaal2_Profil' predicted to become 1.0
2022-12-18 12:00:00.582 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HaupthausSaal1_Profil' predicted to become 1.0
2022-12-18 12:00:00.593 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HaupthausSaal4_Profil' predicted to become 1.0
2022-12-18 12:00:00.602 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HaupthausSaal3_Profil' predicted to become 1.0
2022-12-18 12:00:00.611 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HaupthausWCLinks_Profil' predicted to become 1.0
2022-12-18 12:00:00.619 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HaupthausWCRechts_Profil' predicted to become 1.0
2022-12-18 12:00:00.628 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HaupthausHimmelbettzimmer_Profil' predicted to become 1.0
2022-12-18 12:00:00.685 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HaupthausKinderzimmer_Profil' predicted to become 1.0
2022-12-18 12:00:00.694 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HaupthausWeltliteraturzimmer2_Profil' predicted to become 1.0
2022-12-18 12:00:00.703 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HaupthausKrimizimmer_Profil' predicted to become 1.0
2022-12-18 12:00:00.714 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HaupthausWeltliteraturzimmer_Profil' predicted to become 1.0
2022-12-18 12:00:00.723 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HaupthausSimmelzimmer_Profil' predicted to become 1.0
2022-12-18 12:00:00.732 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HaupthausBadRechts_Profil' predicted to become 1.0
2022-12-18 12:00:00.747 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'HaupthausBadLinks_Profil' predicted to become 1.0
2022-12-18 12:00:00.756 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausSaal2_Profil' changed from 2.0 to 1.0
2022-12-18 12:00:00.760 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausSaal1_Profil' changed from 2.0 to 1.0
2022-12-18 12:00:00.762 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausSaal4_Profil' changed from 2.0 to 1.0
2022-12-18 12:00:00.763 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausSaal3_Profil' changed from 2.0 to 1.0
2022-12-18 12:00:00.765 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausWCLinks_Profil' changed from 2.0 to 1.0
2022-12-18 12:00:00.766 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausWCRechts_Profil' changed from 2.0 to 1.0
2022-12-18 12:00:00.767 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausHimmelbettzimmer_Profil' changed from 2.0 to 1.0
2022-12-18 12:00:00.768 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausKinderzimmer_Profil' changed from 2.0 to 1.0
2022-12-18 12:00:00.770 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausWeltliteraturzimmer2_Profil' changed from 2.0 to 1.0
2022-12-18 12:00:00.771 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausKrimizimmer_Profil' changed from 2.0 to 1.0
2022-12-18 12:00:00.773 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausWeltliteraturzimmer_Profil' changed from 2.0 to 1.0
2022-12-18 12:00:00.774 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausSimmelzimmer_Profil' changed from 2.0 to 1.0
2022-12-18 12:00:00.775 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausBadRechts_Profil' changed from 2.0 to 1.0
2022-12-18 12:00:00.782 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausBadLinks_Profil' changed from 2.0 to 1.0
2022-12-18 12:00:00.941 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausBadRechts_Zieltemperatur' changed from 19 °C to 5 °C
2022-12-18 12:00:00.942 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausBadRechts_Temperatur' changed from 21.5 °C to 21.4 °C
2022-12-18 12:00:01.025 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausHimmelbettzimmer_Zieltemperatur' changed from 17 °C to 5 °C
2022-12-18 12:00:01.136 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausSaal2_Zieltemperatur' changed from 21 °C to 5 °C
2022-12-18 12:00:01.139 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausSaal2_Temperatur' changed from 21 °C to 20.9 °C
2022-12-18 12:00:01.349 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausKinderzimmer_Zieltemperatur' changed from 17 °C to 5 °C
2022-12-18 12:00:01.526 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausSaal3_Zieltemperatur' changed from 21 °C to 5 °C
2022-12-18 12:00:01.557 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausBadLinks_Zieltemperatur' changed from 19 °C to 5 °C
2022-12-18 12:00:01.558 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausBadLinks_Temperatur' changed from 19.6 °C to 19.5 °C
2022-12-18 12:00:02.011 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausWCRechts_Zieltemperatur' changed from 19 °C to 5 °C
2022-12-18 12:00:02.013 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausWCRechts_Temperatur' changed from 18.5 °C to 18.4 °C
2022-12-18 12:00:03.199 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausWeltliteraturzimmer_Zieltemperatur' changed from 17 °C to 5 °C
2022-12-18 12:00:03.241 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausWeltliteraturzimmer2_Zieltemperatur' changed from 17 °C to 10 °C
2022-12-18 12:00:03.254 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausWeltliteraturzimmer2_Temperatur' changed from 17.3 °C to 17.2 °C
2022-12-18 12:00:03.259 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausKrimizimmer_Zieltemperatur' changed from 17 °C to 5 °C
2022-12-18 12:00:03.261 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausKrimizimmer_Temperatur' changed from 17.8 °C to 17.6 °C
2022-12-18 12:00:03.619 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausSaal1_Zieltemperatur' changed from 21 °C to 5 °C
2022-12-18 12:00:03.621 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HaupthausSaal1_Temperatur' changed from 20.8 °C to 20.7 °C

You can see in the log, that Saal4, Simmelzimmer and WCLinks got lost, they didn’t apply the profile update and didn’t update the target temperature.

Is there any additional logging/tracing I can activate to find out what is going wrong? How it is possible, that ItemStateChangedEvent is fired for the profile, although it was not changed on the device? This should never happen, right?

Turn on trace with:

openhab-cli console

enter password(default=habopen)

log:set trace org.openhab.binding.shelly

to return to default enter

log:set default org.openhab.binding.shelly

I start using Shelly Plus H&T V0.12. Setup does work, also data transfer ok while in setup mode,
But not for “Small wake-up” (Shelly): After the device goes to sleep mode and 5 min after this, if the set thresholds were reached, the device measures and updates the display and send data to the cloud/MQTT/outbound socket with the status.
This does not work for me. I never receive current data, thresholds are met for sure.

Hi, is there anything known with shelly 2.5 as rollershutter on OH 3.4 stable? Somehow randomly the position control jumps to either 0 or 100 if I select values between, but just randomly!?
I even do not know how to trace the root cause. I have a virtual second item and a rule to invert the position (0 open, 100 closed) but this was working since a year with zero issues.

Attached al log where you see I tried to change from 89 (almost closed) to 81 with the item ShellyEGGaesteWCRolloRollerpos. The item ShellyEGGaesteWCRolloRollerposInverted is controlling the binding and translates via rule.

Group            gShellyEGGaesteWCRollo                                 "Rollo"                                              <blinds>         (gGaesteWC)                                   ["Blinds"]
Rollershutter    ShellyEGGaesteWCRolloGoogle                            "Gäste WC Rollo"                                     <blinds>         (gShellyEGGaesteWCRollo)                                                 {ga="Blinds" , channel="shelly:shelly25-roller:e8db84aa8062:roller#control"}
Rollershutter    ShellyEGGaesteWCRolloControl                           "Steuerung"                                          <blinds>         (gShellyEGGaesteWCRollo)                      ["Control","Opening"]      {channel="shelly:shelly25-roller:e8db84aa8062:roller#control",autoupdate="false"}
Dimmer           ShellyEGGaesteWCRolloRollerposInverted                 "Position Inverted [%d %%]"                          <blinds>         (gShellyEGGaesteWCRollo)                                                 {channel="shelly:shelly25-roller:e8db84aa8062:roller#rollerpos",autoupdate="false"}
Dimmer           ShellyEGGaesteWCRolloRollerpos                         "Verdunklung [%d %%]"                                <blinds>         (gShellyEGGaesteWCRollo)                      ["Setpoint","Opening"]     {listWidget="oh-slider-item"[min=0,max=100,step=1,scale=true, releaseOnly=true,iconUseState=true, scaleSteps=10,label=true]}
Switch           ShellyEGGaesteWCRolloClosed                            "(Teil-)geschlossen"                                 <blinds>         (gShellyEGGaesteWCRollo)                      ["OpenState","Opening"]    {listWidget="oh-label-item", stateDescription=""[options="ON=Unten,OFF=Oben"],widgetOrder="0"}

Rules

// Rollo GaesteWC
rule "Rollo GaesteWC Wert einlesen"
when
    Item ShellyEGGaesteWCRolloRollerposInverted changed
then
    // Status einlesen
    if (ShellyEGGaesteWCRolloRollerposInverted.state <99) {
        ShellyEGGaesteWCRolloClosed.postUpdate(ON)
    } else {
        ShellyEGGaesteWCRolloClosed.postUpdate(OFF)
    }
    */
    // Filter auf sinnvollen Wertebereich
    if (ShellyEGGaesteWCRolloRollerposInverted.state >= 0 && ShellyEGGaesteWCRolloRollerposInverted.state <=100) {
        ShellyEGGaesteWCRolloRollerpos.postUpdate(100.0 - (ShellyEGGaesteWCRolloRollerposInverted.state as Number))
    }
end
rule "Rollo GaesteWC Ansteuerung"
when
    Item ShellyEGGaesteWCRolloRollerpos changed
then
    // Filter auf sinnvollen Wertebereich
    if (ShellyEGGaesteWCRolloRollerpos.state >= 0 && ShellyEGGaesteWCRolloRollerpos.state <=100) {
        ShellyEGGaesteWCRolloRollerposInverted.sendCommand(100.0 - (ShellyEGGaesteWCRolloRollerpos.state as Number))
    }
end
2022-12-23 20:23:58.666 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'ShellyEGGaesteWCRolloRollerpos' received command 81
2022-12-23 20:23:58.670 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyEGGaesteWCRolloRollerpos' changed from 89.0 to 81
2022-12-23 20:23:58.678 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'ShellyEGGaesteWCRolloRollerposInverted' received command 19.0
2022-12-23 20:23:58.680 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'ShellyEGGaesteWCRolloRollerposInverted' predicted to become 19.0
2022-12-23 20:23:58.684 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyEGGaesteWCRolloRollerposInverted' changed from 11 to 19.0
2022-12-23 20:23:59.138 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyEGGaesteWCRolloRollerposInverted' changed from 19.0 to 81
2022-12-23 20:23:59.142 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyEGGaesteWCRolloGoogle' changed from 89 to 81
2022-12-23 20:23:59.144 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyEGGaesteWCRolloControl' changed from 89 to 81
2022-12-23 20:23:59.148 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyEGGaesteWCRolloRollerposInverted' changed from 81 to 19
2022-12-23 20:23:59.274 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyEGGaesteWCRolloRollerposInverted' changed from 19 to 0
2022-12-23 20:23:59.280 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyEGGaesteWCRolloGoogle' changed from 81 to 0
2022-12-23 20:23:59.282 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyEGGaesteWCRolloControl' changed from 81 to 0
2022-12-23 20:23:59.287 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyEGGaesteWCRolloRollerposInverted' changed from 0 to 100
2022-12-23 20:23:59.294 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyEGGaesteWCRolloClosed' changed from ON to OFF
2022-12-23 20:23:59.301 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'ShellyEGGaesteWCRolloRollerpos' changed from 81.0 to 0.0
2022-12-23 20:23:59.307 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'ShellyEGGaesteWCRolloRollerposInverted' received command 100.0
2022-12-23 20:23:59.309 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'ShellyEGGaesteWCRolloRollerposInverted' predicted to become 100.0

Any idea?

Thanks and enjoy holidays :wink:

1 Like

I have the same problem: I’ve made a post about it here

I think it is related to a recent change in the binding code, but I’m not sure why the change was made…

Thanks for the hint. Is this a bug or a feature they want?

I think they were fixing something else (probably this: [shelly] Roller position doesn't get updated on open/close position · Issue #13515 · openhab/openhab-addons · GitHub) and this is an unintended side effect.

OK, so we wait until a fix is available?

Good morning,

I have been starting to use the Shelly Binding to integrate wireless Shelly Plug S, 1PM Plus and Button 1/2 components with our wired BTicino home automation system. First, a big thanks to the developers here, so far everything is working fine and I am quite happy with how the integration works!

There is one question I’d have: for the Button 1/2 I have been trying to use the “was updated” trigger on the “Last Event” channel, however this does not work. If the previous event was a short push, and I do another short push, the trigger does not fire, despite that “was updated” is also supposed to fire when the value does not change.

Is my expectation wrong here, or is this a bug?

I am now using the “Event Count” channel for triggering, which works fine, but am still wondering why it does not work with the “Last Event” channel.

I have reported the following bug already. Unfortunately this (obviously known bug) is still present with OH3.4.0:
Shelly actions (status change e.g. ON or OFF) arrive with a time lag of up to 30 seconds in openHAB (tested with Shelly 1PM and Shelly2.5) . According to my logs they only go through to change the status in OH with the heartbeat polling. As my shellys trigger several actions (e.g. lighting functions/scenes), OH has become useless ever since version 3.3.0. The shelly action function has worked perfectly fine for several years with previous OH versions. I would be very grateful if this bug could be resolved eventually. Thank you.

Hi, I’m planning to upgrade openhab from 3.2.0 to 3.4.0 release.
Which binding version should I use?
I’ve lost the overview through all versions here :grin:

Use the official version included in OH 3.4.0 and not a SNAPSHOT version. If SNAPSHOT was used before, please uninstall it first.

I’m getting this error since upgrading to OH3.4:
Handler ShellyRelayHandler tried updating the thing status although the handler was already disposed.

Does setting the log level to ERROR solve the issue or does readding all Shelly devices help?

Thx, good idea.
I did the upgrade with build in binding.

I had this too. After rebooting the openhab machine no errors in the log…

The error log doesn’t solve the problem, it only shows more detailled information.
In my case after deinstalling the binding, cleaning cache and reinstalling those messages disappered. Maybe I re-created the things too.

Removing seems not to work. Now my Shelly device says “REMOVING”, but nothing happens and it is still there.

It seems that I can only remove an online Shelly device. If it is offline I need to do a force remove.

No, REMOVING indicates that the biding serving the thing is not active. Just click Remove again and the thing gets hard deleted.