People, I have a problem that drives me crazy - filtering and assigning data at the level of .things files does not work.
Software openhabian 3.4.1 on RPI4 4GB. I have REGEX and JSONPATH extensions installed.
I get messages from the D1mini device:
21:59:55.664 MQT: stat/K/Og/Ok/RESULT = {"Time":"2023-01-23T21:59:55","MCP230XX_INT":{"D1":0,"MS":4122}}
21:59:55.681 MQT: stat/K/Og/Ok/RESULT = {"Event":"Done"}
21:59:55.664 MQT: stat/K/Og/Ok/RESULT = {"Time":"2023-01-23T21:56:55","MCP230XX_INT":{"D10":1,"MS":4122}}
21:59:55.681 MQT: stat/K/Og/Ok/RESULT = {"Event":"Done"}
21:59:55.664 MQT: stat/K/Og/Ok/RESULT = {"Time":"2023-01-23T21:57:55","MCP230XX_INT":{"D12":0,"MS":4122}}
21:59:55.681 MQT: stat/K/Og/Ok/RESULT = {"Event":"Done"}
as you can see above both Time and MCP230XX_INT contents change.
I wrote some transformationPattern codes within .things file but none of the things return me the value I want
Type string : sypPstate "Ok Ma st" [
stateTopic="stat/K/Og/Ok/RESULT",
transformationPattern="REGEX:(.*D15.*)∩JSONPATH:$.MCP230XX_INT.D15"
] //in this rule i would like if "MCP230XX_INT" contains D15 to assign to string the value of D15 (0 or 1)
Type string : sypPmsC "Ok Ma ms" [
stateTopic="stat/K/Og/Ok/RESULT",
transformationPattern="REGEX:(.*D15.*:0.*)∩JSONPATH:$.MCP230XX_INT.MS"
] //here if "MCP230XX_INT" contains "D15":0 to assign to string the MS value
Type datetime : sypPtimeC "Ok Ma cz" [
stateTopic="stat/K/Og/Ok/RESULT",
transformationPattern="REGEX:(.*D15.*:1.*)∩JSONPATH:$.Time"
] //here if "MCP230XX_INT" contains "D15":1 to assign a Time value to the string
String D1BOkSypPstate "Ok Ma st" {channel="mqtt:topic:d1bOK:sypPstate"}
String D1BOkSypPmsC "Ok Ma ms" {channel="mqtt:topic:d1bOK:sypPmsC"}
DateTime D1BOkSypPtimeC "Ok Ma cz" {channel="mqtt:topic:d1bOK:sypPtimeC"}
Tell me if I wrote stupidity in transformationPattern or is it a matter of the new OH edition?