Hey there,
I have a couple of Tasmotas I try to read by an HTTP call like this:
After this I get a result like this
{t}{s}Voltage{m}231 V{e}{s}Current{m}0.023 A{e}{s}Power{m}2 W{e}{s}Apparent Power{m}5 VA{e}{s}Reactive Power{m}5 VAr{e}{s}Power Factor{m}0.39{e}{s}Energy Today{m}0.015 kWh{e}{s}Energy Yesterday{m}0.000 kWh{e}{s}Energy Total{m}14.304 kWh{e}{t}ON
My problem is that my regex skills are beginner level. I try to extract the power value “2 W”.
I’ve tried it with this (works in regex101, but not in Openhab):
}Power{m}([0-9]{1,5})
So my final goal would be a String Item like this:
String Tasmota_CurrentConsumption “Consumption [%s W]” { http=“<[http://192.168.1.1/?m=1:10000:REGEX((}Power{m}([0-9]{1,5})))]” }
Can someone tell me how to format the regex correctly that I only get “2” as a result in the string?
Thanks a lot!
PS: I’m running OH 2.5