Hej Folks,
I’m using MQTT to fetch my energy meter using a python script. The format is valid in JSON and I’m able to fetch the data within node-red. But I want to implement a template sensor as MQTT directly.
My JSON string
{"time":1555400065567,"values":{"power":351270,"power3":236640,"energyOut":0,"power1":43290,"energy":69505866394000,"power2":71340}}
I want to see only the power1 value:
- platform: mqtt
name: "mqtt_power1"
state_topic: "strom"
value_template: "{{ value_json.values.power1 }}"
using this, I will not get a value
if I only select for example: value_json.time this is working.
I already tried using:
value_json.values.['power1']
value_json.values.[0]
value_json.values['power1']
value_json.values[0]
without success