I have an ESP that receives a TCP command string to trigger a relay (string = {“ObjType”: 0, “Id”: 1, “OnState”: 1, “InvertedState”: 0, “ToggleState”: 0, "Send2 ": 0}).
When it receives this string, it triggers the relay and sends back to the other string (string = {“ObjType”: 0, “Send2”: 2}), confirming that it received the command. The value 2 within Send2 is the confirmation. All this works perfectly.
But I would like to create a rule to capture this return and show the “OK” result. But I have no idea how to do it, and I did not find anything in the tutorials I could help.
Currently, when I send the command, the result of the log is:
2017-08-26 17: 59: 20.514 [WARN] [rm.AbstractFileTransformationService] - Could not transform ‘{“ObjType”: 0, “Send2”: 2}’ with the file ‘test.map’: Target value not found In map for '{“ObjType”: 0, “Send2”: 2}'
2017-08-26 17: 59: 20.514 [WARN] [ing.tcp.protocol.internal.TCPBinding] - Can not parse input {“ObjType”: 0, “Send2”: 2} to match command ON on item Swicth01
In fact, I was not thinking about doing this with MAP. My idea is to capture this return with a rule that will parse with JSONPATH. The problem is that I can not get the rule to capture this retarget message. Is this possible?