JSON ("let it be" ;)

Hi,
I just reflashed a IR-Blaster with Tasmota. So I am using MQTT as protocoll.

Playing with some IR-Remotes I got following entries:

15:00:23.480 MQT: Infrared/IR80/tele/RESULT = {"IrReceived":{"Protocol":"SONY","Bits":12,"Data":"0x11","DataLSB":"0x88","Repeat":0}}
15:00:25.333 MQT: Infrared/IR80/tele/RESULT = {"IrReceived":{"Protocol":"SONY","Bits":12,"Data":"0x811","DataLSB":"0x1088","Repeat":0}}
15:00:27.288 MQT: Infrared/IR80/tele/RESULT = {"IrReceived":{"Protocol":"SONY","Bits":12,"Data":"0x411","DataLSB":"0x2088","Repeat":0}}
15:00:30.891 MQT: Infrared/IR80/tele/RESULT = {"IrReceived":{"Protocol":"SONY","Bits":12,"Data":"0xC11","DataLSB":"0x3088","Repeat":0}}

Doing a sen (inside Tasmota is working like a charme (stripped JSON with the optional parameter)

IrSend:{"Protocol":"SONY","Bits":12,"Data":"0x811"}

As You can see, I have so send exactly what I have received.
But with a String/Item and “STANDARD” transformation (JSONPATH:$.IrReceived) the incomming String looks like this:

{Protocol=SONY, Bits=12, Data=0x11, DataLSB=0x88, Repeat=0}

So I can not save and reuse it later for irsend :frowning:
Infrared/IR80/stat/RESULT = {“IRSend”:“Invalid JSON”}

How can I disable this transforation OR retransform it back to a valid JSON I can simply use within a Script → sendCommand: “”

Gratings David

In stead of JSONPATH transformation, why not strip the incoming message using REGEX.

Sorry I did not see:
http://192.168.1.11:8080/settings/addons/transformation-regex
(I guess I can do it by myself)

Can you give an example how (and where) to insert REGEX Expression?

REGEX:.*IrReceived..(.*)}

in stead of

JSONPATH:$.IrReceived

Of course install the REGEX transformation (but I can see you figured that out already) :slight_smile: