Shelly Binding

I’ll rephrase:

I have pinned the button directly on the dimmer2 and the triggers of the dimmer2 do not work.
do you mean the physical actions don’t work (when you are pushing a physical button?
(when they are not in detached mode they just function)

now you are trying to put the inputs of the dimmer on detatched mode, and controll the following actions purely trough openhab, correct?

Yes

When I set one button mode I see the trigger in the log. When I set to detached I don’t see any more triggers in the log

which build?

Dev 2.5.13
I am waiting for Markus answer. Maybe there’s really a mistake

There are no button events in detached mode

1 Like

is this behavior in all shelly devices?
how can I use the short/long press without acting directly to the shelly? I want to “rule” these triggers :slight_smile:
I had this working with a Shelly1 in my Garage. Button in detached mode and triggers working.
Greets

If you put the SWx into detached mode the device can’t detect button events in this case you have to use the inout channel as tigger. This applies for all device types and has been implemented for a long time.

pre-requisite: 2 Shellys
1st Shelly: Momentary switch is connected
→ the device triggers button events, you can’t use input channel status, because it’s momentary
→ you could have a rule getting triggered by SHORT_PRESSED, DOUBLE_PRESSED etc., which controls Shellys
2nd Shelly: SWx is in detached mode
→ you use rule trigger from Shelly 1st to control output of 2nd Shelly

I update the DEV builds with new features for Shelly Manager (apply to firmware 1.10)

  • Adapt setting CoIoT Mode (Peer/Multicast) to 1.10, device restart after applying new mode
  • New Icon for Device Status Refresh
  • New Action Item for Reset Statistics - per device and globally
  • New Action Item to trigger the firmware check - per device and globally
  • New action: Trigger check for firmware update
  • New action: Enable/Disable WiFi Roadming
  • New action: Reconnect WiFi (battery sensor devices only)
  • New action: Enable/Disable WiFi Recovery Mode
  • New action: Enable/Disable Device Debug Mode, Get Log/Log1 (use only when requested by Allterco support)

The new actions will be included in the menu depending on device type and installed firmware version.

Button 1 users: Allterco has fixed some type of CoIoT protocol issue, which impacted detection of events. This should improve the situation (event counter now survives a device sleep/wake-up).

Shelly 1/1PM, Shelly 2, Shelly 2.5, Shelly Plug/PlugS, Shelly EM, Shelly 3EM: There is a new WiFi Recovery Mode, which forcees a restart on WiFi connectivity issues. Shelly Manager can be used to enable/disable this feature.

Devices now support roaming between access points. The device will select the strongest one and reconnects - this also improves Mesh compatibility. Use Shelly Manager to enable/disable this feature.

You could now clear the STA/AP list of battery powered sensor devices. Use Shelly Manager to force a WiFi reconnect incl. a scan of available networks.

Any feedback from users welcome who already upgraded to 1.10.

Shelly 1 has no power meter
Shelly 1L even, but has the option to set some static consumption (as kind of virtual meter)
Shelly 2.5 and Plug-S have a power meter and binding supports reading the values
Not sure about Dimmer 2, but I guess it hasn’t a power meter

Please provide a /status output from Plug-S and 2.5 reporting total=0
and make sure you are on the DEV build

Thank you for your reply Markus!

Sorry, mentioning of Shelly 1 was of course not correct here… The Dimmer 2 reports the current power consumption just fine so it does have a power meter.

All devices were currently turned off while I requested the status but they were online for a couple of days/weeks and thus should be reporting something. I downloaded the latest DEV build about two days ago.

This is the output for a Plug-S:

{"wifi_sta":{"connected":true,"ssid":"amft-home","ip":"10.9.0.30","rssi":-76},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"","unixtime":0,"serial":2803,"has_update":true,"mac":"E09806B4CDA5","cfg_changed_cnt":0,"actions_stats":{"skipped":0},"relays":[{"ison":true,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"source":"input"}],"meters":[{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":0,"counters":[0.000, 0.000, 0.000],"total":0}],"temperature":31.71,"overtemperature":false,"tmp":{"tC":31.71,"tF":89.08, "is_valid":true},"update":{"status":"pending","has_update":true,"new_version":"20210318-141150/v1.10.0-geba262d","old_version":"20210115-103659/v1.9.4@e2732e05"},"ram_total":51040,"ram_free":38192,"fs_size":233681,"fs_free":161895,"uptime":174938}

Shelly 2.5:

{"wifi_sta":{"connected":true,"ssid":"amft-home","ip":"10.9.0.20","rssi":-51},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"","unixtime":0,"serial":3257,"has_update":false,"mac":"68C63AF91AFD","cfg_changed_cnt":0,"actions_stats":{"skipped":0},"rollers":[{"state":"stop","source":"http","power":0.00,"is_valid":true,"safety_switch":false,"overtemperature":false,"stop_reason":"normal","last_direction":"open","current_pos":100,"calibrating":false,"positioning":true}],"meters":[{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":0,"counters":[0.000, 0.000, 0.000],"total":0},{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":0,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":1,"event":"","event_cnt":0},{"input":0,"event":"","event_cnt":0}],"temperature":52.28,"overtemperature":false,"tmp":{"tC":52.28,"tF":126.11, "is_valid":true},"temperature_status":"Normal","update":{"status":"unknown","has_update":false,"new_version":"","old_version":"20210115-103025/v1.9.4@e2732e05"},"ram_total":49368,"ram_free":33924,"fs_size":233681,"fs_free":119727,"voltage":229.89,"uptime":251065}

Dimmer 2:

{"wifi_sta":{"connected":true,"ssid":"amft-home","ip":"10.9.0.10","rssi":-53},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"","unixtime":0,"serial":25494,"has_update":false,"mac":"D8BFC019F402","cfg_changed_cnt":0,"actions_stats":{"skipped":0},"lights":[{"ison":false,"source":"http","has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"mode":"white","brightness":100}],"meters":[{"power":0.00,"overpower":0.00,"is_valid":true, "timestamp":0,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":1,"event":"L","event_cnt":53},{"input":0,"event":"","event_cnt":0}],"tmp":{"tC":43.74,"tF":110.74, "is_valid":true},"calibrated":true,"calib_progress":0,"calib_status":0,"calib_running":0,"wire_mode":1,"overtemperature":false,"loaderror":0,"overpower":false,"debug":0,"update":{"status":"unknown","has_update":false,"new_version":"","old_version":"20210211-130125/v1.9.5-DM2_autocheck@a99a156a"},"ram_total":48704,"ram_free":36048,"fs_size":233681,"fs_free":111193,"uptime":1902424}

I see “unixtime”:0
is it possible, that the devices are not connected to the Internet / doesn’t synchronized the time?
At least once the device needs to be synchronized, the devices uses the timestamp to compute the consumption

Oh my… Thank you Markus…

I got rid of my Fritzbox recently and forgot that I used it as NTP server for my Shellys.

Now that was an unexpected result :smiley:

Maybe I misunderstand you, but detached mode does not mean that the input is physically detached. It just does not automatically do an action on the outputs. But input events are still being sent to openhab.
I have a few shelly1 working in detached mode without any problems.

I am running latest milestone version of OH3 and want to switch to dev build of shelly binding.
Could somebody give me a hint if this is recommended in terms of stability and functionality (like shelly manager)?
I was only able to find an installation help for OH2 here
does this relate also to OH3 and do I have to delete all my things?

thanks for your advice

DEV build ist up-to-date, stable and in use by many users, because bindig for
2.5 doesn’t receive updates anymore
3.0 is lacking support of new devices, bugs etc.

The DEV builds 2.5.13-SNAPSHOT and 3.1.0-SNAPSHOT are the only ones supported by me and receiving bug fixes /feature requests.

Maybe other users could give their view?

The How-to-Install is liked below


Latest DEV builds: 2.5.13 - 3.1.0 - README - Installation - Avdanced Users - Shelly Manager - Bugs/Features - Firmware Index - Firmware Archive - API Doc
Note: The DEV build is always newer than the version in the official Distro or the Milestone builds (SNAPSHOTs); OH Distro 2.5 will not receive updates anymore, so you have to switch to DEV build when running OH 2.5, see installation notes.

The binding knows the following button types:
public static final String SHELLY_BTNT_MOMENTARY = “momentary”;

SHELLY_BTNT_MOM_ON_RELEASE = “momentary_on_release”;
SHELLY_BTNT_ONE_BUTTON = “one_button”;
SHELLY_BTNT_TWO_BUTTON = “dual_button”;
SHELLY_BTNT_TOGGLE = “toggle”;
SHELLY_BTNT_EDGE = “edge”;
SHELLY_BTNT_DETACHED = “detached”;

and filters button events for
SHELLY_BTNT_MOMENTARY
SHELLY_BTNT_MOM_ON_RELEASE
SHELLY_BTNT_ONE_BUTTON
SHELLY_BTNT_TWO_BUTTON

so SHELLY_BTNT_DETACHED will not trigger an event. In fact I don’t know which type of button/switch is attached. Having a regular switch makes no sense, because it would just created a LONG_PUSH event when the button goes into the ON-position.

How do you get Shelly 1 working if not handled properly by the binding. The logic is the same for all relay devices.

Please provide a TRACE log, I want to see what comes in and how this is processed/filtered by the binding.

WEIRD…
It has always been working fine with the following rule trigger:

when
Channel "shelly:shelly1:doorbell:relay#button" triggered

This works for shelly1 as well as for shelly ix3.
In the log file there was the following:
[INFO ] [openhab.event.ChannelTriggeredEvent ] - shelly:shelly1...:relay#button triggered LONG_PRESSED
(out of the top of my head)

SInce today (where I have updated my device to latest firmware 1.10.x this does not work anymore.

Please send a /settings output

you could do a downgrade to 1.9.x

Maybe that’s why my shelly 1 stopped working in the garage.
I need to check again