Received my Shelly 3EM today and as the Shelly binding is unusable (dunno why it is listed in the bindings then ;o) I use the HTTP binding to get the JSON via the Shelly API.
Then something is wrong with your config, which we cannot see.
Your openhab.log may have something to say on the matter.
Remember that JSONPATH is an optional add-on.
2022-11-10 12:30:10.683 [WARN ] [ofiles.JSonPathTransformationProfile] - Could not transform state 'UNDEF' with function '$.emeters[0].voltage' and format '%s'
Configuring as:
- id: shelly3em_voltage_a
channelTypeUID: http:string
label: Shelly 3EM Voltage A
description: ""
configuration: {}
is fine…but since it is then a String it is not graphed…
Well…just saw that the Shelly binding does support the 3EM, just not the Pro 4PM, which I’m gonna reflash with esphome anyway…
A profile operates on the link between channel and Item.
In other words, the profile takes the final output from the channel and modifies it.
If you use a JSONPATH profile, then you must pass it the whole JSON string to work with, which of course means using a string type channel.
Should the profile result after processing be numeric, you may link to a Number type Item - the profile has done the conversion from channel-string to Item-number.
If you use a number type channel to pass the whole JSON, it is non-numeric, simply doesn’t fit, and you get UNDEF passed out of the channel and onwards to the profile.
JSONPATH profile cannot process “UNDEF” of course, and complains.
What people do is not use a profile at all.
The HTTP channel has built-in configuration for transformations, including JSONPATH. Its in the docs.
This allows processing before the channel passes the value along.
If JSONPATH can extract a numeric, you would use a number type channel and the output will be a number.
You may even add a unit at the channel, if you know the numeric is say expressed in volts, “V”, and link to an quantity type Item.
You’re not alone in getting drawn into using profiles, something about the GUI invites people into this trap every week.