Hi ! - am on OH3.2 and am trying to use some output I get from running a python3 command using the exec-binding. The output contains a dump of information from my panasonic cloud AC - and in that, there is a JSON-formatted section, I would like to pick in.
The output I get back from the exec binding when triggering run looks like this:
--- creating token by authenticating
--- raw beginning ---
{"result":0,"uToken":"xxxxxxxxxxxxxxxxxxxxxxx","country":"DK","clientId":"xxxxxxxxxxxxxxxxxxxxxx","language":0}
--- raw ending ---
--- _get_groups()
--- raw beginning ---
{"iaqStatus":{"statusCode":200},"uiFlg":false,"groupCount":1,"groupList":[{"groupId":123626,"groupName":"My House","deviceList":[{"deviceGuid":"xxxxxxxxxxx","deviceType":"1","deviceName":"xxxxxxxxxxx","permission":2,"summerHouse":2,"iAutoX":false,"nanoe":false,"nanoeStandAlone":false,"autoMode":true,"heatMode":true,"fanMode":true,"dryMode":true,"coolMode":true,"ecoNavi":false,"powerfulMode":true,"quietMode":true,"airSwingLR":true,"autoSwingUD":false,"ecoFunction":0,"temperatureUnit":0,"modeAvlList":{"autoMode":1,"fanMode":1},"parameters":{"operate":0,"operationMode":3,"temperatureSet":30.0,"fanSpeed":0,"fanAutoMode":1,"airSwingLR":2,"airSwingUD":4,"ecoMode":0,"ecoNavi":1,"nanoe":0,"iAuto":0,"actualNanoe":0,"airDirection":1,"ecoFunctionData":0,"lastSettingMode":0}}]}]}
--- raw ending ---
dryTempMin : -1
.
.
.
I want to get the (JSON formatted) text data between “— _get_groups()” “— raw beginning —”
and “— raw ending —”. In the example above, that would be the line starting with {"iaqStatus
But how will that REGEX expression look like?
I have tried this in my rule:
val json_dump_string_newValue = transform("REGEX", ".*--- _get_groups()\n--- raw beginning ---\n(\\d*.\\d*)\n--- raw ending ---.*", panasonicac_get_dump_Output_str.state.toString)
But that doesnt work…