Hello everyone, I’m facing a challenge with MQTT sensor values and I hope someone can help me out. I’ve set up MQTT to monitor my electricity usage, and while the current consumption value is coming through, it’s embedded within a JSON string. Here’s what the value looks like:
{
“val”: 94,
“ack”: true,
“ts”: 1715751831194,
“q”: 0,
“from”: “system.adapter.smartmeter.0”,
“user”: “system.user.admin”,
“lc”: 1715751831194
}
I’ve configured two sensors in my configuration.yaml file—one for the current meter reading, which works fine, and another for the current consumption. However, I’m struggling to extract just the val and ts values from this JSON string. I’ve tried various approaches over the past week, but nothing seems to work. I’m hoping someone here has encountered a similar issue and can share their solution. Any advice would be greatly appreciated! ![]()