[Solved] Shelly I3 event string - how to read correctly

Hello and welcome to my first post :wink:

well, I tried to include my new Shelly I3 into OpenHAB3, as I did for several other Shelly 1 and 2.5. Primarly I like to use it to controll rollershutters.

So I’d like to identify the S/SS/SSS/LS/SL pushes. Therefore I made a new thing and a string channel. As item I tried this piece of code:

String ShellyT1 "Shelly_i3_Test" {channel="mqtt:topic:MQTTBroker:ShellyI3:ShellyI3"}

It returns the whole event string that is published by the I3:

{"event":"S","event_cnt":14}

I see the S for the short push I did, but how can I get only the letter so I can use it in a rule?
Unfortunately I am quite lost and I am looking forward to any hint from you, guys!

Cheers, Timo

I think you can use JSONPATH:$.event to get only the S. You need to add this as incoming transformation in the channel.

1 Like

Hi Chris,
I opend the advanced option in the channel config and yes, I found the section “Transform Value” :+1:
For “Incoming Value Transformation” I put in

JSONPATH:$.device.status.event

But it still shows:

{"event":"S","event_cnt":14}

Do you have any example how to make the right transformation? Do I have to make the JSONPATH in my .items file?

It should be only JSONPATH:$.event
The .event links it to the “event” part and takes it’s value out, in this case S.

Oh my gosh! I forgot to install the JSONPATH transformation add-on
Thanks for your help. It works fine!!
:weary: :rofl: