Shelly Binding

I try it again with more infomation an

item

Number:Time AutoOfftime_UG_Werkstatt  "Auto off timer [%.0f s]" (gTimerKeller) {channel="shelly:shelly25-relay:c45e73:relay1#autoOff"}

rule

AutoOfftime_UG_Werkstatt.postUpdate( 40 )

log ẁith 15 sec postlog

2020-09-08 08:12:00.691 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73: CoIoT Message from /192.168.177.18:5683 (MID=61633): {"G":[[0,9103,8],[0,1101,0],[0,1201,0],[0,2101,0],[0,2102,""],[0,2103,0],[0,2201,0],[0,2202,""],[0,2203,0],[0,4101,0.00],[0,4103,44],[0,6102,0],[0,4201,0.00],[0,4203,0],[0,6202,0],[0,3104,52.87],[0,6101,0],[0,9101,"relay"]]}
2020-09-08 08:12:00.698 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73: CoIoT Sensor data {"G":[[0,9103,8],[0,1101,0],[0,1201,0],[0,2101,0],[0,2102,""],[0,2103,0],[0,2201,0],[0,2202,""],[0,2203,0],[0,4101,0.00],[0,4103,44],[0,6102,0],[0,4201,0.00],[0,4203,0],[0,6202,0],[0,3104,52.87],[0,6101,0],[0,9101,"relay"]]} (serial=24834)
2020-09-08 08:12:00.702 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73: 18 CoAP sensor updates received
2020-09-08 08:12:00.706 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[0]: id=9103, Value=8.0 (cfgChanged, Type=EVC, Range=U16, Link=4: device)
2020-09-08 08:12:00.708 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[1]: id=1101, Value=0.0 (output, Type=S, Range=0/1, Link=1: relay_0)
2020-09-08 08:12:00.709 [TRACE] [y.internal.handler.ShellyBaseHandler] - shelly25-relay-c4c4f9: Updating status
2020-09-08 08:12:00.711 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shelly25-relay-c4c4f9: HTTP GET for http://192.168.177.10/status
2020-09-08 08:12:00.712 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[2]: id=1201, Value=0.0 (output, Type=S, Range=0/1, Link=2: relay_1)
2020-09-08 08:12:00.715 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[3]: id=2101, Value=0.0 (input, Type=S, Range=0/1, Link=1: relay_0)
2020-09-08 08:12:00.718 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[4]: id=2102, Value=-1.0 (inputEvent, Type=EV, Range=S/L;, Link=1: relay_0)
2020-09-08 08:12:00.722 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[5]: id=2103, Value=0.0 (inputEventCnt, Type=EVC, Range=U16, Link=1: relay_0)
2020-09-08 08:12:00.724 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[6]: id=2201, Value=0.0 (input, Type=S, Range=0/1, Link=2: relay_1)
2020-09-08 08:12:00.727 [TRACE] [y.internal.handler.ShellyBaseHandler] - shelly25-relay-c45e73: Updating status
2020-09-08 08:12:00.728 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[7]: id=2202, Value=-1.0 (inputEvent, Type=EV, Range=S/L;, Link=2: relay_1)
2020-09-08 08:12:00.730 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shelly25-relay-c45e73: HTTP GET for http://192.168.177.18/status
2020-09-08 08:12:00.732 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[8]: id=2203, Value=0.0 (inputEventCnt, Type=EVC, Range=U16, Link=2: relay_1)
2020-09-08 08:12:00.737 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[9]: id=4101, Value=0.0 (power, Type=P, Range=0/2300;-1, Link=1: relay_0)
2020-09-08 08:12:00.740 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[10]: id=4103, Value=44.0 (energy, Type=E, Range=U32;-1, Link=1: relay_0)
2020-09-08 08:12:00.744 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[11]: id=6102, Value=0.0 (overpower, Type=A, Range=0/1;-1, Link=1: relay_0)
2020-09-08 08:12:00.748 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[12]: id=4201, Value=0.0 (power, Type=P, Range=0/2300;-1, Link=2: relay_1)
2020-09-08 08:12:00.752 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[13]: id=4203, Value=0.0 (energy, Type=E, Range=U32;-1, Link=2: relay_1)
2020-09-08 08:12:00.755 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[14]: id=6202, Value=0.0 (overpower, Type=A, Range=0/1;-1, Link=2: relay_1)
2020-09-08 08:12:00.759 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[15]: id=3104, Value=52.87 (deviceTemp, Type=T, Range=-40/300;999, Link=4: device)
2020-09-08 08:12:00.762 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[16]: id=6101, Value=0.0 (overtemp, Type=A, Range=0/1;-1, Link=4: device)
2020-09-08 08:12:00.765 [TRACE] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73:  Sensor value[17]: id=9101, Value=relay (mode, Type=S, Range=relay/roller, Link=4: device)
2020-09-08 08:12:02.208 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shelly25-relay-c45e73: HTTP Response 200: {"wifi_sta":{"connected":true,"ssid":"MosHome","ip":"192.168.177.18","rssi":-64},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"08:12","unixtime":1599552721,"serial":609,"has_update":false,"mac":"ECFABCC45E73","cfg_changed_cnt":8,"actions_stats":{"skipped":0},"relays":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"overtemperature":false,"is_valid":true,"source":"timer"},{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"overtemperature":false,"is_valid":true,"source":"input"}],"meters":[{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":1599552721,"counters":[0.000, 0.000, 0.000],"total":44},{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":1599552721,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":0,"event":"","event_cnt":0},{"input":0,"event":"","event_cnt":0}],"temperature":52.87,"overtemperature":false,"tmp":{"tC":52.87,"tF":127.16, "is_valid":true},"update":{"status":"idle","has_update":false,"new_version":"20200827-065456/v1.8.3@4a8bc427","old_version":"20200827-065456/v1.8.3@4a8bc427"},"ram_total":49504,"ram_free":36796,"fs_size":233681,"fs_free":147086,"voltage":231.38,"uptime":35321}
2020-09-08 08:12:02.215 [TRACE] [.internal.handler.ShellyRelayHandler] - shelly25-relay-c45e73: Updating 2 relay(s)
2020-09-08 08:12:02.222 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shelly25-relay-c45e73: HTTP GET for http://192.168.177.18/status/relay/0
2020-09-08 08:12:02.412 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shelly25-relay-c45e73: HTTP Response 200: {"wifi_sta":{"connected":true,"ssid":"MosHome","ip":"192.168.177.18","rssi":-69},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"08:12","unixtime":1599552722,"serial":609,"has_update":false,"mac":"ECFABCC45E73","cfg_changed_cnt":8,"actions_stats":{"skipped":0},"relays":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"overtemperature":false,"is_valid":true,"source":"timer"},{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"overtemperature":false,"is_valid":true,"source":"input"}],"meters":[{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":1599552722,"counters":[0.000, 0.000, 0.000],"total":44},{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":1599552722,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":0,"event":"","event_cnt":0},{"input":0,"event":"","event_cnt":0}],"temperature":52.87,"overtemperature":false,"tmp":{"tC":52.87,"tF":127.16, "is_valid":true},"update":{"status":"idle","has_update":false,"new_version":"20200827-065456/v1.8.3@4a8bc427","old_version":"20200827-065456/v1.8.3@4a8bc427"},"ram_total":49504,"ram_free":36792,"fs_size":233681,"fs_free":147086,"voltage":231.46,"uptime":35322}
2020-09-08 08:12:02.422 [TRACE] [y.internal.handler.ShellyBaseHandler] - shelly25-relay-c45e73: Updating 2 standard meter(s)
2020-09-08 08:12:02.434 [TRACE] [y.internal.handler.ShellyBaseHandler] - shelly25-relay-c45e73: 0 more updates requested

2020-09-08 08:12:05.319 [vent.ItemStateChangedEvent] - AutoOfftime_UG_Werkstatt changed from 28.0 s to 40.0 s

2020-09-08 08:12:15.689 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73: CoIoT Message from /192.168.177.18:5683 (MID=61634): {"G":[[0,9103,8],[0,1101,0],[0,1201,0],[0,2101,0],[0,2102,""],[0,2103,0],[0,2201,0],[0,2202,""],[0,2203,0],[0,4101,0.00],[0,4103,44],[0,6102,0],[0,4201,0.00],[0,4203,0],[0,6202,0],[0,3104,52.87],[0,6101,0],[0,9101,"relay"]]}
2020-09-08 08:12:15.693 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73: Serial 24834 was already processed, ignore update




2.5.8 does bot support firmware 1.7 properly. You beed to switch to the DEV build or wair for the 2.5.9 release (in about 2 weeks)

Latest DEV build - README - Installation - Firmware Index - Firmware Archive - API Doc

This is a bug, I created Issue 8431
It’s fixed in the updated DEV build

The problem is that you declared the item type correctly as Number:Time, but the binding expected a regular Number. Both formats are now supported.

Please verify the fix and provide feedback

Hi @markus7017 . I have some Shelly RGBWs in use and I would like to have an option about the “change-speed” from one brightness to another. for example, 100% to 10%… I want to do that slowly.
I can do this with rules and just hammer a lot of changes to the binding… but that is not desirable for some reasons. Do you think this is something your binding would be able to implement?

Nope, this might be a firmware feature, nithing for the binding

too bad, i asked them twice but looks like it cannot be done .

i have try the new dev build but still not working with Number:Time also not with only Number

2020-09-08 18:14:27.202 [TRACE] [y.internal.handler.ShellyBaseHandler] - shelly25-relay-c45e73: Updating status
2020-09-08 18:14:27.205 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shelly25-relay-c45e73: HTTP GET for http://192.168.177.18/status
2020-09-08 18:14:27.394 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shelly25-relay-c45e73: HTTP Response 200: {"wifi_sta":{"connected":true,"ssid":"MosHome","ip":"192.168.177.18","rssi":-68},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"18:14","unixtime":1599588868,"serial":1297,"has_update":false,"mac":"ECFABCC45E73","cfg_changed_cnt":14,"actions_stats":{"skipped":0},"relays":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"overtemperature":false,"is_valid":true,"source":"http"},{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"overtemperature":false,"is_valid":true,"source":"timer"}],"meters":[{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":1599588868,"counters":[0.000, 0.000, 0.000],"total":2097},{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":1599588868,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":0,"event":"","event_cnt":0},{"input":0,"event":"","event_cnt":0}],"temperature":54.38,"overtemperature":false,"tmp":{"tC":54.38,"tF":129.88, "is_valid":true},"update":{"status":"idle","has_update":false,"new_version":"20200827-065456/v1.8.3@4a8bc427","old_version":"20200827-065456/v1.8.3@4a8bc427"},"ram_total":49504,"ram_free":36452,"fs_size":233681,"fs_free":147337,"voltage":230.78,"uptime":71466}
2020-09-08 18:14:27.404 [TRACE] [.internal.handler.ShellyRelayHandler] - shelly25-relay-c45e73: Updating 2 relay(s)
2020-09-08 18:14:27.408 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shelly25-relay-c45e73: HTTP GET for http://192.168.177.18/status/relay/0
2020-09-08 18:14:27.594 [TRACE] [ng.shelly.internal.api.ShellyHttpApi] - shelly25-relay-c45e73: HTTP Response 200: {"wifi_sta":{"connected":true,"ssid":"MosHome","ip":"192.168.177.18","rssi":-68},"cloud":{"enabled":false,"connected":false},"mqtt":{"connected":false},"time":"18:14","unixtime":1599588868,"serial":1297,"has_update":false,"mac":"ECFABCC45E73","cfg_changed_cnt":14,"actions_stats":{"skipped":0},"relays":[{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"overtemperature":false,"is_valid":true,"source":"http"},{"ison":false,"has_timer":false,"timer_started":0,"timer_duration":0,"timer_remaining":0,"overpower":false,"overtemperature":false,"is_valid":true,"source":"timer"}],"meters":[{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":1599588868,"counters":[0.000, 0.000, 0.000],"total":2097},{"power":0.00,"overpower":0.00,"is_valid":true,"timestamp":1599588868,"counters":[0.000, 0.000, 0.000],"total":0}],"inputs":[{"input":0,"event":"","event_cnt":0},{"input":0,"event":"","event_cnt":0}],"temperature":54.38,"overtemperature":false,"tmp":{"tC":54.38,"tF":129.88, "is_valid":true},"update":{"status":"idle","has_update":false,"new_version":"20200827-065456/v1.8.3@4a8bc427","old_version":"20200827-065456/v1.8.3@4a8bc427"},"ram_total":49504,"ram_free":36256,"fs_size":233681,"fs_free":147337,"voltage":230.86,"uptime":71466}
2020-09-08 18:14:27.603 [TRACE] [y.internal.handler.ShellyBaseHandler] - shelly25-relay-c45e73: Updating 2 standard meter(s)
2020-09-08 18:14:29.297 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73: CoIoT Message from /192.168.177.18:5683 (MID=64176): {"G":[[0,9103,14],[0,1101,0],[0,1201,0],[0,2101,0],[0,2102,""],[0,2103,0],[0,2201,0],[0,2202,""],[0,2203,0],[0,4101,0.00],[0,4103,2097],[0,6102,0],[0,4201,0.00],[0,4203,0],[0,6202,0],[0,3104,54.38],[0,6101,0],[0,9101,"relay"]]}
2020-09-08 18:14:29.301 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73: Serial 4357 was already processed, ignore update
2020-09-08 18:14:30.918 [vent.ItemStateChangedEvent] - AutoOfftime_UG_Werkstatt changed from 60.0 s to 40.0 s
2020-09-08 18:14:44.299 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shelly25-relay-c45e73: CoIoT Message from /192.168.177.18:5683 (MID=64177): {"G":[[0,9103,14],[0,1101,0],[0,1201,0],[0,2101,0],[0,2102,""],[0,2103,0],[0,2201,0],[0,2202,""],[0,2203,0],[0,4101,0.00],[0,4103,2097],[0,6102,0],[0,4201,0.00],[0,4203,0],[0,6202,0],[0,3104,54.38],[0,6101,0],[0,9101,"relay"]]}

Did you tried to change the value in PaperUI:Control?

No with a rule, but i see with PaperUI:Control it works

it looks like does the value are changed but not send to shelly. At Control if i change the value after press Hacken tha value changed at shelly

Edit: I found the solution, for change you have to do it with sendCommand and not postUpdate

AutoOfftime_UG_Werkstatt.sendCommand( 3600 )

hi markus
after installing the latest dev version as described in the readme, I still face the same problem. I can´t “see” or read the state of the input. If I turn off or on, one of the four lamps (RGBW ind ehite mode) via openhab, everything works instantly. If I use the app or the browser, I dont get an update of the status in openhab (with few exceptions). The same with the Input. In detached mode, which would be needed for my rule, I dont get any input state.

BR
Daniel

ok now the input channel works too. Justs needs more than one second, which is ok for my use case.

BG

make sure to use firmware 1.8.3 - Alterco fixed latency of Coap status updates

I’m now on the latest DEV build with the latest firmware, but the issue is still the same.
I have updated like the readme (delete things/binding, copy dev etc…).

But when the dw2 is in sleep mode, the updates doesn’t works, only sometimes ?

In the shelly app and the browser the states workes fine.

Greets Stephan

@Stephan-Prem @Huaba ok, then

  • make sure you use the latest DEV build with firmware 1.8.3
  • and performed the calibration
  • enable DEBUG log on the OH console
  • provide a precise description of the problem
  • and the log output (enough lines) so I could check what’s going on

maybe we could fix this and it could go into the pending PR.

Same behavior with my DW2.
Also on latest DEV-Binding. Calibration was performed.
But my DW2 don’t show me a possible firmware update to 1.8.3. Only the 1.8.2 and an “beta” firmware.

Will provide a debug log and an description - maybe today (i’ll try to find time)

Thx for your work!

I have following item defined

Switch UG_Waschkueche_Taster "Waschküche Taster" (gTasterKeller) {channel="shelly:shelly1:8caab50558d3:relay#input"}

My expectation was does any push on the button set the item to on. but at the moment only the LONG_PRESSED set the item

If you want ON/OFF you need to set the button mode to Edge mode, otherwise check the button types in the Shelly App to find one matching your user case. The input channel reflects the state of the input at the relay and this depends on the selected button mode.

If i understood it right now, also a SHORT_PRESSED who switch the relay on, will set this input channel ?
At the moment only a LONG_PRESSED set it

No, those are independent

the xxx_PRESSED triggers are geberated depending on device type and button mode
In general only in momentary, momentary_release or detached mode
you receive SHORT_/DOUBLE_/TRIPLE/_LONG_PRESSED events

If the button is in edge mode (regular switch, not momentary) you‘ll not see any xxx_PRESSED triggers

The input channel represents the state on of relay input, not the output. What do you have connected to the input? Why are you expecting the input channel to change when you press the button (which is controlled by the button)?