Shelly Binding

having serious problems right now with 1.10. need to downgrade a few devices now.

channel triggering not working anymore
ix3 needs 55 seconds (!) until event is visible in openhab

Hey Markus,
please see below settings and status output where you can see that event “L” is raised.
one information: I think starting with FW 1.9.4 the “L” for long_pressed and “S” for short_pressed was omitted

SETTINGS

{
"device": {
"type": "SHSW-1",
"mac": "xxx",
"hostname": "shelly1-xxx",
"num_outputs": 1
},
"wifi_ap": {
"enabled": false,
"ssid": "shelly1-xxx",
"key": ""
},
"wifi_sta": {
"enabled": true,
"ssid": "xxx",
"ipv4_method": "dhcp",
"ip": null,
"gw": null,
"mask": null,
"dns": null
},
"wifi_sta1": {
"enabled": false,
"ssid": null,
"ipv4_method": "dhcp",
"ip": null,
"gw": null,
"mask": null,
"dns": null
},
"mqtt": {
"enable": false,
"server": "192.168.33.3:1883",
"user": "",
"id": "shelly1-xxx",
"reconnect_timeout_max": 60,
"reconnect_timeout_min": 2,
"clean_session": true,
"keep_alive": 60,
"max_qos": 0,
"retain": false,
"update_period": 30
},
"coiot": {
"update_period": 15
},
"sntp": {
"server": "192.168.178.1",
"enabled": true
},
"login": {
"enabled": true,
"unprotected": false,
"username": "admin"
},
"pin_code": "",
"name": "Garagentor",
"fw": "20201228-092119/v1.9.3@ad2bb4e3",
"factory_reset_from_switch": true,
"discoverable": true,
"build_info": {
"build_id": "20201228-092119/v1.9.3@ad2bb4e3",
"build_timestamp": "2020-12-28T09:21:19Z",
"build_version": "1.0"
},
"cloud": {
"enabled": false,
"connected": false
},
"timezone": "UTC",
"lat": 500,
"lng": 500,
"tzautodetect": false,
"tz_utc_offset": 0,
"tz_dst": false,
"tz_dst_auto": true,
"time": "18:50",
"unixtime": 1616525429,
"ext_switch_enable": false,
"ext_switch_reverse": false,
"ext_switch": {
"0": {
"relay_num": -1
}
},
"actions": {
"active": false,
"names": [
"btn_on_url",
"btn_off_url",
"longpush_url",
"shortpush_url",
"out_on_url",
"out_off_url",
"lp_on_url",
"lp_off_url",
"ext_temp_over_url",
"ext_temp_under_url",
"ext_temp_over_url",
"ext_temp_under_url",
"ext_temp_over_url",
"ext_temp_under_url",
"ext_hum_over_url",
"ext_hum_under_url"
]
},
"hwinfo": {
"hw_revision": "prod-191217",
"batch_id": 1
},
"mode": "relay",
"longpush_time": 800,
"relays": [
{
"name": null,
"appliance_type": "General",
"ison": false,
"has_timer": false,
"default_state": "switch",
"btn_type": "detached",
"btn_reverse": 0,
"auto_on": 0,
"auto_off": 2,
"power": 0,
"schedule": false,
"schedule_rules": []
}
],
"ext_sensors": {},
"ext_temperature": {},
"ext_humidity": {},
"wifirecovery_reboot_enabled": true
}

STATUS

{
"wifi_sta": {
"connected": true,
"ssid": "xxx",
"ip": "192.168.178.69",
"rssi": -79
},
"cloud": {
"enabled": false,
"connected": false
},
"mqtt": {
"connected": false
},
"time": "18:46",
"unixtime": 1616525200,
"serial": 2426,
"has_update": true,
"mac": "xxx",
"cfg_changed_cnt": 15904,
"actions_stats": {
"skipped": 0
},
"relays": [
{
"ison": false,
"has_timer": false,
"timer_started": 0,
"timer_duration": 0,
"timer_remaining": 0,
"source": "timer"
}
],
"meters": [
{
"power": 0,
"is_valid": true
}
],
"inputs": [
{
"input": 0,
"event": "L",
"event_cnt": 4
}
],
"ext_sensors": {},
"ext_temperature": {},
"ext_humidity": {},
"update": {
"status": "pending",
"has_update": true,
"new_version": "20210318-135942/v1.10.0-geba262d",
"old_version": "20201228-092119/v1.9.3@ad2bb4e3"
},
"ram_total": 50696,
"ram_free": 38164,
"fs_size": 233681,
"fs_free": 145831,
"uptime": 58565
}

? you show 1.9.4 and and event=L

I updated the DEV build

  • button events are also processed in detached mode
  • work around for inconsistent version strings (…v.1.10-Dimmer2… instead of v1.10.0…)

re button events in detached mode:

Various devices signal an event when the physical button is pressed.
This could be a switch connected to the SW input of the relay or the Button 1.

The following trigger types are sent:

Event Type Description
SHORT_PRESSED The button was pressed once for a short time (lastEvent=S)
DOUBLE_PRESSED The button was pressed twice with short delay (lastEvent=SS)
TRIPLE_PRESSED The button was pressed three times with short delay (lastEvent=SSS)
LONG_PRESSED The button was pressed for a longer time (lastEvent=L)
SHORT_LONG_PRESSED A short followed by a long button push (lastEvent=SL)
LONG_SHORT_PRESSED A long followed by a short button push (lastEvent=LS)

Check the channel definitions for the various devices to see if the device supports those events.
You could use the Shelly App to set the timing for those events.

If you want to use those events triggering a rule:

  • If a physical switch is connected to the Shelly use the input channel(input or input1/input2) to trigger a rule
  • For a momentary button use the button trigger channel as trigger, channels lastEvent and eventCount will provide details on the event
1 Like

We are finishing hardening for this release. I’m not aware of other pending issues.
Does someone want to address things before I start pushing for the PR?

Thx for the update.
shelly Dimmer2 works in detached mode now.
trigger for switch1 is button1.

shelly:shellydimmer2:40f5202d8c21:relay#button1 triggered SHORT_PRESSED

Sorry Markus,
I do not understand, what you want to say. It is fw 1.9.3 and „L“ stands for long pressed event. as said, believe me, I had triggered events in detached mode

just as an idea for usage of shelly with button in detached mode:
I attached a reed contact to shelly1‘s input switch so that I get the status of the garage door (open/close) and the output is triggering the garage door (up/down). no need to install 2 shellys

Oliver, try the new dev build :wink:

Congratulations on the new Shelly Manager. Great to have such an overview.

I would still have the following wishes:

  1. Update all devices at once. This also for battery devices, which are not always online.
  2. Apply settings to all devices (single/multicast, enable AP roaming, etc.).
  3. Rename of Devices (Name on Shelly itself).

Thank you for your super binding.

1 Like

grrr. I have never upgraded to snapshot release. now all my bindings are gone. is this normal behaviour?

what are you doing?
there is no need to ugrade the OH base?
just the binding, do what‘s described in the instructions

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.

ok, then I misinterpreted this. I thought it is mandatory to upgrade to OH 3.1.0 SNAPSHOT first

nope, the DEV build is independent from the underlying OH version
So, OH 3.0.1 with binding 3.1-SNAPSHOT is fine

Can someone give me some pointers (or a link) on how to update the Shelly binding in OH3? I’ve seen the instructions here but am unsure if I need to install the Californium 2.0 liibraries as that guide is for OH2.5 not OH3. I don’t recall needing to install them when I installed the binding within OH3 so don’t understand why I’d need to install them to update the binding.

Is there a way to update the binding from inside OH3 UI? Can I just drop the appropriate .jar file in the addons folder? Do I need to remove the existing binding that was installed from within the OH3 interface?

Also, does the latest version of the binding support the new Shelly Motion that came out in February?

Thanks in advance,

Ben.

I tried yesterday to install dev bindig. Struggling a bit like the poster above. Cannot find out how to set permissions correctly.

One more question. isn’t there a way just to replace existing binding with dev binding without deleting all shelly items?

@Thinqer yes you will need the two additional files.

First you remove the old binding via the Openhab UI. Than you follow the steps mentioned on the linked page. Those are also valid for OH3

  • Stop OH
  • copy californium-core-2.0.0.jar to OH’s addons folder
  • copy element-connector-2.0.0.jar to OH’s addons folder
  • Start OH, wait until fully initialized(!)
  • copy org.openhab.binding.shelly-2.5.8-SNAPSHOT.jar to OH’s addons folder

You cannot upgrade thru the Openhab UI.
and yes the newest version supports the Shelly Motion.

This is not valid for openHAB 3 !!!

sorry, of course you have to use 3.1.0 Snapshot. I thought that was obvious.

1 Like

I updated READMEbeta