Hello to all, I’m new to ha.
I’m trying to import some mqtt values inside domoticz, and I’m using this config:
- platform: mqtt
name: "Autoconsumo"
unique_id: “Autoconsumo”
state_topic: "domoticz/in"
unit_of_measurement: 'kWh'
force_update: false
value_template: "{% if value_json.idx == 5 %} {{ value_json.svalue }} {% endif %}"
device_class: energy
state_class: measurement
- platform: mqtt
name: "Sunnyboy"
unique_id: “Sunnyboy”
state_topic: "domoticz/in"
unit_of_measurement: 'kWh'
force_update: false
value_template: "{% if value_json.idx == 95 %} {{ value_json.svalue }} {% endif %}"
device_class: energy
state_class: measurement
- platform: mqtt
name: "Consumo Total"
unique_id: “Consumo Total”
state_topic: "domoticz/in"
unit_of_measurement: 'kWh'
force_update: false
value_template: "{% if value_json.idx == 92 %} {{ value_json.svalue }} {% endif %}"
device_class: energy
state_class: measurement
The trouble is that only that first sensor works properly, the other ones shows zero. Why?