Shelly Dimmer2 Trigger Event

Hi,

I installed a Shelly Dimer 2 few days ago and I am failing to get the trigger event when I press button.
I have 2 pushbuttons connected to S1 and S2 input each. The shelly configuration is as “Dual Button Mode”:

My thing is:

Thing shelly:shellydimmer2:LightOffice "Light Office" @ "Office" [deviceIp="192.168.4.218", userId="xxxx", password="xxxx",eventsButton=true, eventsPush=true]

I have only one item:
Dimmer LightOffice "Light Office [%d]" <light> (grpLightBulbs, grpLightOffice) ["Switch"] {channel="shelly:shellydimmer2:LightOffice:relay#brightness", ga="Light"}

When I try the rules below nothing happens. However I have configured also MQTT connection in the shelly and using MQTT explorer I can see different event is triggered.

Am I doing something wrong in my config?
Is it possible to get the events without going the MQTT route?

rule    "!test shelly trigger 2 SHORT_PRESSED"
	when
		Channel "shelly:shellydimmer2:LightOffice:relay#button2" triggered SHORT_PRESSED
	then
                logInfo( "test","2 SHORT_PRESSED")
end			

rule    "!test shelly trigger 2 LONG_PRESSED"
	when
		Channel "shelly:shellydimmer2:LightOffice:relay#button2" triggered LONG_PRESSED
	then
                logInfo( "test","2 Long_PRESSED")
end	

rule    "!test shelly trigger 1 SHORT_PRESSED"
	when
		Channel "shelly:shellydimmer1:LightOffice:relay#button1" triggered SHORT_PRESSED
	then
                logInfo( "test","1 SHORT_PRESSED")
end			

rule    "!test shelly trigger 1 LONG_PRESSED"
	when
		Channel "shelly:shellydimmer2:LightOffice:relay#button1" triggered LONG_PRESSED
                shelly:shellydimmer2:LightOffice:relay#button1
	then
                logInfo( "test","1 LONG_PRESSED")
end

image

Before that, look in your events.log
Any incoming events theshelly binding makes will be shown there, so you can check for typos etc.

Look at your Thing in MainUI (even though you configure it from file), see if it has the trigger channels you expect.

1 Like

Hi @rossko57, the trigger channel exists, it is in the docs and I can see it via UI.
I went the MQTT route to save me some debug time and works well so far. the main reason is because I have by mistake disabled all logging below the warn level for all OH so I do not know if it is possible to restore it. (I know how to restore the logs one by one via the karaf console but too much work :wink: to restore them all that way).

Could you make a test with this rule?


rule "Test"
when
	Channel "shelly:shellydimmer2:LightOffice:relay#button1" triggered or
	Channel "shelly:shellydimmer2:LightOffice:relay#button2" triggered
then
	 logInfo( "Test","Event: {}", receivedEvent)
end

is CoIoT activated and the other event options deactivated in the thing configuration?

Hi @Oliver2,
Here is the log, seems the trigger is well received, but I see some java exception

2022-01-25 19:04:03.757 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 18 CoAP sensor updates received

2022-01-25 19:04:03.760 [DEBUG] [ly.internal.coap.ShellyCoIoTVersion2] - shellydimmer2-3c6105e405c7: Updating meter:currentWatts with 28.82

2022-01-25 19:04:03.769 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#brightness$Switch updated with OFF (type class org.openhab.core.library.types.OnOffType).

2022-01-25 19:04:03.776 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#brightness$Value updated with 0 % (type class org.openhab.core.library.types.QuantityType).

2022-01-25 19:04:03.778 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 2 channels updated from CoIoT status, serial=64769

2022-01-25 19:04:04.307 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel device#heartBeat updated with 2022-01-25T19:04:04.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:04.315 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel device#uptime updated with 231574 s (type class org.openhab.core.library.types.QuantityType).

2022-01-25 19:04:04.320 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellydimmer2-3c6105e405c7: Unable to refresh status: Unable to update status

java.lang.IllegalArgumentException: Timestamp value 0 is invalid

	at org.openhab.binding.shelly.internal.util.ShellyUtils.getTimestamp(ShellyUtils.java:292) ~[?:?]

	at org.openhab.binding.shelly.internal.handler.ShellyComponents.updateMeters(ShellyComponents.java:137) ~[?:?]

	at org.openhab.binding.shelly.internal.handler.ShellyBaseHandler.refreshStatus(ShellyBaseHandler.java:421) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]

	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

	at java.lang.Thread.run(Thread.java:829) [?:?]

2022-01-25 19:04:05.279 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: CoIoT Message from /192.168.4.218:5683 (MID=56447): {"G":[[0,9103,0],[0,1101,0],[0,5101,100],[0,2101,0],[0,2102,""],[0,2103,7],[0,2201,0],[0,2202,"S"],[0,2203,8],[0,4101,0.00],[0,4103,0],[0,6102,0],[0,6109,0.00],[0,6104,0],[0,3104,46.40],[0,3105,115.52],[0,6101,0],[0,9101,"white"]]}

2022-01-25 19:04:05.280 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel device#heartBeat updated with 2022-01-25T19:04:05.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:05.281 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: CoIoT Sensor data {"G":[[0,9103,0],[0,1101,0],[0,5101,100],[0,2101,0],[0,2102,""],[0,2103,7],[0,2201,0],[0,2202,"S"],[0,2203,8],[0,4101,0.00],[0,4103,0],[0,6102,0],[0,6109,0.00],[0,6104,0],[0,3104,46.40],[0,3105,115.52],[0,6101,0],[0,9101,"white"]]} (serial=65025)

2022-01-25 19:04:05.282 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 18 CoAP sensor updates received

2022-01-25 19:04:05.284 [DEBUG] [ly.internal.coap.ShellyCoIoTVersion2] - shellydimmer2-3c6105e405c7: Updating meter:currentWatts with 0.0

2022-01-25 19:04:05.285 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel meter#currentWatts updated with 0 W (type class org.openhab.core.library.types.QuantityType).

2022-01-25 19:04:05.287 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel meter#lastUpdate updated with 2022-01-25T19:04:05.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:05.288 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 2 channels updated from CoIoT status, serial=65025

2022-01-25 19:04:05.826 [INFO ] [org.openhab.core.model.script.Test  ] - Event: SHORT_PRESSED

2022-01-25 19:04:05.827 [INFO ] [org.openhab.core.model.script.test  ] - 2 SHORT_PRESSED

2022-01-25 19:04:05.828 [INFO ] [ipt.lights:Light Office Override OFF] - Light Office Timer Override OFF. Automatic switch OFF timer active

2022-01-25 19:04:06.875 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: CoIoT Message from /192.168.4.218:5683 (MID=56448): {"G":[[0,9103,0],[0,1101,1],[0,5101,100],[0,2101,0],[0,2102,""],[0,2103,7],[0,2201,0],[0,2202,"S"],[0,2203,10],[0,4101,0.00],[0,4103,0],[0,6102,0],[0,6109,0.00],[0,6104,0],[0,3104,46.40],[0,3105,115.52],[0,6101,0],[0,9101,"white"]]}

2022-01-25 19:04:06.879 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel device#heartBeat updated with 2022-01-25T19:04:06.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:06.883 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: CoIoT Sensor data {"G":[[0,9103,0],[0,1101,1],[0,5101,100],[0,2101,0],[0,2102,""],[0,2103,7],[0,2201,0],[0,2202,"S"],[0,2203,10],[0,4101,0.00],[0,4103,0],[0,6102,0],[0,6109,0.00],[0,6104,0],[0,3104,46.40],[0,3105,115.52],[0,6101,0],[0,9101,"white"]]} (serial=65281)

2022-01-25 19:04:06.887 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 18 CoAP sensor updates received

2022-01-25 19:04:06.890 [DEBUG] [ly.internal.coap.ShellyCoIoTProtocol] - shellydimmer2-3c6105e405c7: Trigger event S

2022-01-25 19:04:06.892 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellydimmer2-3c6105e405c7: Update button state with S/SHORT_PRESSED

2022-01-25 19:04:06.894 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellydimmer2-3c6105e405c7: Send event relay#button2 to channel SHORT_PRESSED

2022-01-25 19:04:06.895 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#lastUpdate updated with 2022-01-25T19:04:06.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:06.897 [DEBUG] [ly.internal.coap.ShellyCoIoTVersion2] - shellydimmer2-3c6105e405c7: Updating meter:currentWatts with 0.0

2022-01-25 19:04:06.897 [INFO ] [org.openhab.core.model.script.Test  ] - Event: SHORT_PRESSED

2022-01-25 19:04:06.899 [INFO ] [org.openhab.core.model.script.test  ] - 2 SHORT_PRESSED

2022-01-25 19:04:06.901 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel meter#lastUpdate updated with 2022-01-25T19:04:06.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:06.904 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#brightness$Switch updated with ON (type class org.openhab.core.library.types.OnOffType).

2022-01-25 19:04:06.909 [INFO ] [ipt.lights:Light Office Override OFF] - Light Office Timer Override OFF. Automatic switch OFF timer active

2022-01-25 19:04:06.907 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#brightness$Value updated with 100 % (type class org.openhab.core.library.types.QuantityType).

2022-01-25 19:04:06.911 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#eventCount2 updated with 10 (type class org.openhab.core.library.types.DecimalType).

2022-01-25 19:04:06.913 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 4 channels updated from CoIoT status, serial=65281

2022-01-25 19:04:07.352 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel device#heartBeat updated with 2022-01-25T19:04:07.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:07.364 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel device#uptime updated with 231577 s (type class org.openhab.core.library.types.QuantityType).

2022-01-25 19:04:07.369 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellydimmer2-3c6105e405c7: Unable to refresh status: Unable to update status

java.lang.IllegalArgumentException: Timestamp value 0 is invalid

	at org.openhab.binding.shelly.internal.util.ShellyUtils.getTimestamp(ShellyUtils.java:292) ~[?:?]

	at org.openhab.binding.shelly.internal.handler.ShellyComponents.updateMeters(ShellyComponents.java:137) ~[?:?]

	at org.openhab.binding.shelly.internal.handler.ShellyBaseHandler.refreshStatus(ShellyBaseHandler.java:421) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]

	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

	at java.lang.Thread.run(Thread.java:829) [?:?]

2022-01-25 19:04:09.281 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: CoIoT Message from /192.168.4.218:5683 (MID=56449): {"G":[[0,9103,0],[0,1101,1],[0,5101,100],[0,2101,0],[0,2102,""],[0,2103,7],[0,2201,0],[0,2202,"S"],[0,2203,10],[0,4101,28.42],[0,4103,0],[0,6102,0],[0,6109,0.00],[0,6104,0],[0,3104,46.32],[0,3105,115.37],[0,6101,0],[0,9101,"white"]]}

2022-01-25 19:04:09.283 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel device#heartBeat updated with 2022-01-25T19:04:09.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:09.284 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: CoIoT Sensor data {"G":[[0,9103,0],[0,1101,1],[0,5101,100],[0,2101,0],[0,2102,""],[0,2103,7],[0,2201,0],[0,2202,"S"],[0,2203,10],[0,4101,28.42],[0,4103,0],[0,6102,0],[0,6109,0.00],[0,6104,0],[0,3104,46.32],[0,3105,115.37],[0,6101,0],[0,9101,"white"]]} (serial=2)

2022-01-25 19:04:09.286 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 18 CoAP sensor updates received

2022-01-25 19:04:09.287 [DEBUG] [ly.internal.coap.ShellyCoIoTVersion2] - shellydimmer2-3c6105e405c7: Updating meter:currentWatts with 28.42

2022-01-25 19:04:09.290 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel meter#currentWatts updated with 28.42 W (type class org.openhab.core.library.types.QuantityType).

2022-01-25 19:04:09.292 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel meter#lastUpdate updated with 2022-01-25T19:04:09.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:09.294 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 2 channels updated from CoIoT status, serial=2

2022-01-25 19:04:09.667 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: CoIoT Message from /192.168.4.218:5683 (MID=56450): {"G":[[0,9103,0],[0,1101,1],[0,5101,100],[0,2101,0],[0,2102,""],[0,2103,7],[0,2201,1],[0,2202,"S"],[0,2203,10],[0,4101,28.42],[0,4103,0],[0,6102,0],[0,6109,0.00],[0,6104,0],[0,3104,46.32],[0,3105,115.37],[0,6101,0],[0,9101,"white"]]}

2022-01-25 19:04:09.668 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: CoIoT Sensor data {"G":[[0,9103,0],[0,1101,1],[0,5101,100],[0,2101,0],[0,2102,""],[0,2103,7],[0,2201,1],[0,2202,"S"],[0,2203,10],[0,4101,28.42],[0,4103,0],[0,6102,0],[0,6109,0.00],[0,6104,0],[0,3104,46.32],[0,3105,115.37],[0,6101,0],[0,9101,"white"]]} (serial=258)

2022-01-25 19:04:09.669 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 18 CoAP sensor updates received

2022-01-25 19:04:09.670 [DEBUG] [ly.internal.coap.ShellyCoIoTVersion2] - shellydimmer2-3c6105e405c7: Updating meter:currentWatts with 28.42

2022-01-25 19:04:09.674 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#input2 updated with ON (type class org.openhab.core.library.types.OnOffType).

2022-01-25 19:04:09.675 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 1 channels updated from CoIoT status, serial=258

2022-01-25 19:04:10.404 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel device#heartBeat updated with 2022-01-25T19:04:10.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:10.412 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel device#uptime updated with 231580 s (type class org.openhab.core.library.types.QuantityType).

2022-01-25 19:04:10.420 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#lastEvent2 updated with L (type class org.openhab.core.library.types.StringType).

2022-01-25 19:04:10.421 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#eventCount2 updated with 11 (type class org.openhab.core.library.types.DecimalType).

2022-01-25 19:04:10.425 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellydimmer2-3c6105e405c7: Unable to refresh status: Unable to update status

java.lang.IllegalArgumentException: Timestamp value 0 is invalid

	at org.openhab.binding.shelly.internal.util.ShellyUtils.getTimestamp(ShellyUtils.java:292) ~[?:?]

	at org.openhab.binding.shelly.internal.handler.ShellyComponents.updateMeters(ShellyComponents.java:137) ~[?:?]

	at org.openhab.binding.shelly.internal.handler.ShellyBaseHandler.refreshStatus(ShellyBaseHandler.java:421) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]

	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

	at java.lang.Thread.run(Thread.java:829) [?:?]

2022-01-25 19:04:10.470 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: CoIoT Message from /192.168.4.218:5683 (MID=56451): {"G":[[0,9103,0],[0,1101,1],[0,5101,100],[0,2101,0],[0,2102,""],[0,2103,7],[0,2201,1],[0,2202,"L"],[0,2203,11],[0,4101,28.42],[0,4103,0],[0,6102,0],[0,6109,0.00],[0,6104,0],[0,3104,46.32],[0,3105,115.37],[0,6101,0],[0,9101,"white"]]}

2022-01-25 19:04:10.472 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: CoIoT Sensor data {"G":[[0,9103,0],[0,1101,1],[0,5101,100],[0,2101,0],[0,2102,""],[0,2103,7],[0,2201,1],[0,2202,"L"],[0,2203,11],[0,4101,28.42],[0,4103,0],[0,6102,0],[0,6109,0.00],[0,6104,0],[0,3104,46.32],[0,3105,115.37],[0,6101,0],[0,9101,"white"]]} (serial=514)

2022-01-25 19:04:10.473 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 18 CoAP sensor updates received

2022-01-25 19:04:10.474 [DEBUG] [ly.internal.coap.ShellyCoIoTProtocol] - shellydimmer2-3c6105e405c7: Trigger event L

2022-01-25 19:04:10.476 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellydimmer2-3c6105e405c7: Update button state with L/LONG_PRESSED

2022-01-25 19:04:10.477 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellydimmer2-3c6105e405c7: Send event relay#button2 to channel LONG_PRESSED

2022-01-25 19:04:10.480 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#lastUpdate updated with 2022-01-25T19:04:10.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:10.482 [DEBUG] [ly.internal.coap.ShellyCoIoTVersion2] - shellydimmer2-3c6105e405c7: Updating meter:currentWatts with 28.42

2022-01-25 19:04:10.482 [INFO ] [org.openhab.core.model.script.Test  ] - Event: LONG_PRESSED

2022-01-25 19:04:10.482 [INFO ] [org.openhab.core.model.script.test  ] - 2 Long_PRESSED

2022-01-25 19:04:10.487 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel meter#lastUpdate updated with 2022-01-25T19:04:10.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:10.490 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 1 channels updated from CoIoT status, serial=514

2022-01-25 19:04:11.693 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: CoIoT Message from /192.168.4.218:5683 (MID=56452): {"G":[[0,9103,0],[0,1101,1],[0,5101,73],[0,2101,0],[0,2102,""],[0,2103,7],[0,2201,0],[0,2202,"L"],[0,2203,11],[0,4101,28.52],[0,4103,0],[0,6102,0],[0,6109,0.00],[0,6104,0],[0,3104,46.32],[0,3105,115.37],[0,6101,0],[0,9101,"white"]]}

2022-01-25 19:04:11.695 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel device#heartBeat updated with 2022-01-25T19:04:11.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:11.697 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: CoIoT Sensor data {"G":[[0,9103,0],[0,1101,1],[0,5101,73],[0,2101,0],[0,2102,""],[0,2103,7],[0,2201,0],[0,2202,"L"],[0,2203,11],[0,4101,28.52],[0,4103,0],[0,6102,0],[0,6109,0.00],[0,6104,0],[0,3104,46.32],[0,3105,115.37],[0,6101,0],[0,9101,"white"]]} (serial=770)

2022-01-25 19:04:11.699 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 18 CoAP sensor updates received

2022-01-25 19:04:11.702 [DEBUG] [ly.internal.coap.ShellyCoIoTVersion2] - shellydimmer2-3c6105e405c7: Updating meter:currentWatts with 28.52

2022-01-25 19:04:11.705 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel meter#currentWatts updated with 28.52 W (type class org.openhab.core.library.types.QuantityType).

2022-01-25 19:04:11.707 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel meter#lastUpdate updated with 2022-01-25T19:04:11.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:11.712 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#brightness$Value updated with 73 % (type class org.openhab.core.library.types.QuantityType).

2022-01-25 19:04:11.716 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#input2 updated with OFF (type class org.openhab.core.library.types.OnOffType).

2022-01-25 19:04:11.718 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 4 channels updated from CoIoT status, serial=770

2022-01-25 19:04:11.719 [INFO ] [ipt.lights:Light Office Override OFF] - Light Office Timer Override OFF. Automatic switch OFF timer active

2022-01-25 19:04:13.152 [INFO ] [ghts:Light Office Override On Switch] - Light Office Timer Override. No Automatic switch OFF 

2022-01-25 19:04:13.459 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel device#heartBeat updated with 2022-01-25T19:04:13.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:13.473 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel device#uptime updated with 231583 s (type class org.openhab.core.library.types.QuantityType).

2022-01-25 19:04:13.479 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#input2 updated with ON (type class org.openhab.core.library.types.OnOffType).

2022-01-25 19:04:13.481 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#lastEvent2 updated with S (type class org.openhab.core.library.types.StringType).

2022-01-25 19:04:13.483 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#eventCount2 updated with 12 (type class org.openhab.core.library.types.DecimalType).

2022-01-25 19:04:13.484 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel meter#currentWatts updated with 20.27 W (type class org.openhab.core.library.types.QuantityType).

2022-01-25 19:04:13.486 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellydimmer2-3c6105e405c7: Unable to refresh status: Unable to update status

java.lang.IllegalArgumentException: Timestamp value 0 is invalid

	at org.openhab.binding.shelly.internal.util.ShellyUtils.getTimestamp(ShellyUtils.java:292) ~[?:?]

	at org.openhab.binding.shelly.internal.handler.ShellyComponents.updateMeters(ShellyComponents.java:137) ~[?:?]

	at org.openhab.binding.shelly.internal.handler.ShellyBaseHandler.refreshStatus(ShellyBaseHandler.java:421) ~[?:?]

	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]

	at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:305) [?:?]

	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:305) [?:?]

	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]

	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]

	at java.lang.Thread.run(Thread.java:829) [?:?]

2022-01-25 19:04:13.914 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: CoIoT Message from /192.168.4.218:5683 (MID=56453): {"G":[[0,9103,0],[0,1101,1],[0,5101,100],[0,2101,0],[0,2102,""],[0,2103,7],[0,2201,0],[0,2202,"S"],[0,2203,13],[0,4101,20.27],[0,4103,0],[0,6102,0],[0,6109,0.00],[0,6104,0],[0,3104,46.24],[0,3105,115.23],[0,6101,0],[0,9101,"white"]]}

2022-01-25 19:04:13.916 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: CoIoT Sensor data {"G":[[0,9103,0],[0,1101,1],[0,5101,100],[0,2101,0],[0,2102,""],[0,2103,7],[0,2201,0],[0,2202,"S"],[0,2203,13],[0,4101,20.27],[0,4103,0],[0,6102,0],[0,6109,0.00],[0,6104,0],[0,3104,46.24],[0,3105,115.23],[0,6101,0],[0,9101,"white"]]} (serial=1026)

2022-01-25 19:04:13.917 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 18 CoAP sensor updates received

2022-01-25 19:04:13.919 [DEBUG] [ly.internal.coap.ShellyCoIoTProtocol] - shellydimmer2-3c6105e405c7: Trigger event S

2022-01-25 19:04:13.920 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellydimmer2-3c6105e405c7: Update button state with S/SHORT_PRESSED

2022-01-25 19:04:13.921 [DEBUG] [y.internal.handler.ShellyBaseHandler] - shellydimmer2-3c6105e405c7: Send event relay#button2 to channel SHORT_PRESSED

2022-01-25 19:04:13.925 [INFO ] [org.openhab.core.model.script.test  ] - 2 SHORT_PRESSED

2022-01-25 19:04:13.925 [INFO ] [org.openhab.core.model.script.Test  ] - Event: SHORT_PRESSED

2022-01-25 19:04:13.925 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#lastUpdate updated with 2022-01-25T19:04:13.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:13.928 [DEBUG] [ly.internal.coap.ShellyCoIoTVersion2] - shellydimmer2-3c6105e405c7: Updating meter:currentWatts with 20.27

2022-01-25 19:04:13.931 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel meter#lastUpdate updated with 2022-01-25T19:04:13.000+0100 (type class org.openhab.core.library.types.DateTimeType).

2022-01-25 19:04:13.935 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#brightness$Value updated with 100 % (type class org.openhab.core.library.types.QuantityType).

2022-01-25 19:04:13.938 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#eventCount2 updated with 13 (type class org.openhab.core.library.types.DecimalType).

2022-01-25 19:04:13.940 [DEBUG] [lly.internal.util.ShellyChannelCache] - shellydimmer2-3c6105e405c7: Channel relay#input2 updated with OFF (type class org.openhab.core.library.types.OnOffType).

2022-01-25 19:04:13.941 [DEBUG] [elly.internal.coap.ShellyCoapHandler] - shellydimmer2-3c6105e405c7: 4 channels updated from CoIoT status, serial=1026

2022-01-25 19:04:13.943 [INFO ] [ipt.lights:Light Office Override OFF] - Light Office Timer Override OFF. Automatic switch OFF timer active

It is configured via the text file, I have the thing config in my first post:

ColoT is active in the Shelly:

ok. the script works as it should and so does yours

My understanding if you want to use CoIoT (which is the preferred way over Coap to communicate with shellys) then you need the following parameters in your thing definition:

eventsCoIoT=true
eventsButton=false
eventsPush=false
eventsSwitch=false

did you enable MQTT for testing purposes! Otherwise you can disable it.

After all these changes, does the problem persist?

Thanks, that worked.
I used MQTT to catch the trigger event, but now I will disable it

You could also change the CoIoT peer in your device to communicate directly to your openhab server (and not through multicast).

Thanks, I modified according your suggestion