[SOLVED] Help needed for simple http regex item definition for MyStrom Wi-fi Switch

Hi, I integrate the mystrom wifi switch with openhab. On/off/toggle are simple http commands and easy to setup. Works well also in/with HomeKit!

I would like to create an item for showing the current power consumption and current temperature but couldn’t figure out how to use the regex command.

The MyStrom http command output is straightforward:

{“power”:13.743849754333496,“relay”:true,“temperature”:22.449981689453125}

I tried to do the following items definition (but get some missing } failure message):

Number MyStromNo1_Power "MyStrom Steckdose Verbrauch [%W]" {http="<[http://192.168.5.60/:REGEX(.*power*:.*?([0-9]+.[0-9]+).*.)]"}
Number MyStromNo1_Temp "MyStrom Steckdose Temperatur [%.1f °C]" {http="<[http://192.168.5.60/:REGEX(.*temperature*:.*?([0-9]+.[0-9]+).*.)]"}

Please advise & Thanks in advance!

Br, Chris

Ensure that the JSONPATH transform is installed:

Number MyStromNo1_Power "MyStrom Steckdose Verbrauch [%W]" {http="<[http://192.168.5.60/:JSONPATH($.power)]"}
Number MyStromNo1_Temp "MyStrom Steckdose Temperatur [%.1f °C]" {http="<[http://192.168.5.60/:JSONPATH($.temperature)]"}

Thanks, that did it!

See below:

Number MyStromNo1_Power "MyStrom Steckdose Verbrauch [%Wh]" {http="<[http://192.168.5.60/report:1000:JSONPATH($.power)]"}
Number MyStromNo1_Temp "MyStrom Steckdose Temperatur [%.1f °C]" {http="<[http://192.168.5.60/report:1000:JSONPATH($.temperature)]"}

Br, Chris