Mclupo
(Wolf Kroenert )
August 30, 2024, 3:42am
1
OH 4.3 snapshot
Hello again
I get this json data from rtl_433 via mqtt server
{
"time": "2024-08-30 03:29:41",
"model": "inFactory-TH",
"id": 77,
"channel": 1,
"battery_ok": 1,
"button": 0,
"temperature_F": 64.5,
"humidity": 80,
"mic": "CRC"
}
Reading the time data creates a warning
2024-08-29 13:10:55.561 [WARN ] [ab.binding.mqtt.generic.ChannelState] - Command '2024-08-29 11:10:54' from channel 'mqtt:topic:MQTT_NAS:LS11:LS11_zuletztGesehen' not supported by type 'DateTimeValue': 2024-08-29 11:10:54 is not in a valid format
Whatās wrong with this data
JimT
(jimtng)
August 30, 2024, 5:25am
2
Try regex transform s/ /T/
Mclupo
(Wolf Kroenert )
August 30, 2024, 7:18am
3
I canāt select regex profil for date/time items
Oliver2
(Oliver)
August 30, 2024, 7:57am
4
Did you install the RegEx Transformation add-on?
JimT
(jimtng)
August 30, 2024, 8:21am
5
You can set the transformation pattern on the Mqtt thing channel, not profile
Mclupo
(Wolf Kroenert )
August 30, 2024, 11:25am
6
Regex transformation is installed
Unfortunately I need some help for regex command, haveānt used it before.
Thats what I have for incoming value transformation, and whatās needed for regex
jsonpath:$.time ā©
JimT
(jimtng)
August 30, 2024, 12:38pm
7
Thatās it. Put the regex I showed above at the end of it
Mclupo
(Wolf Kroenert )
August 30, 2024, 1:37pm
8
That creates configuration error
JSONPATH:$.time ā© regex transform s/ /T/
2024-08-30 15:36:03.970 [WARN ] [rnal.handler.GenericMQTTThingHandler] - Configuration error for channel 'mqtt:topic:MQTT_NAS:LS11:LS11_ZuletztGesehen'
java.lang.IllegalArgumentException: The transformation pattern must consist of the type and the pattern separated by a colon
at org.openhab.binding.mqtt.generic.ChannelStateTransformation.<init>(ChannelStateTransformation.java:50) ~[bundleFile:?]
JimT
(jimtng)
August 30, 2024, 1:55pm
9
JSONPATH:$.timeā©REGEX:s/ /T/
Mclupo
(Wolf Kroenert )
August 30, 2024, 2:12pm
10
Thank you, it works. I tried that before but with blanks in between. It said, REGEX not found.
JimT
(jimtng)
August 30, 2024, 2:14pm
11
If this gets merged into 4.3, you can have spaces in there, or even specify it in multiple lines in UI without that intersection symbol.
1 Like
JimT
(jimtng)
September 5, 2024, 11:53pm
12
Iāve also submitted this PR so that core can just parse yyyy-MM-dd HH:mm
without us needing to add a āTā between the date and the time part
openhab:main
ā jimtng:datetimetype-space
opened 04:57AM - 05 Sep 24 UTC
Support `yyyy-MM-dd HH:mm` syntax in addition to `yyyy-MM-ddTHH:mm`.
The synā¦ tax with space often appears in incoming data, e.g. mqtt. By supporting this, we won't need to run the input data through a transformation.
2 Likes
Mclupo
(Wolf Kroenert )
September 6, 2024, 1:42pm
13
Multiple lines for commands on incoming value transformation works great in oh 4.3 4255
1 Like