How to show a zigbee2mqtt payload on a dashboard

Everything is back in HA
If I go to developer tools then I see :

The visvoeder is unknown ???

if there was no message yet, it will be unknown until the first message received.

yes there is already defferent messages

vis

I changed the “voltage_l2” to “l2” to see if I can change to the other attribute. But I get also unknown.

  sensor:
    - name: "visvoeder "
      state_topic: "Visvoeder"   
      value_template: "{{ value_json.voltage_l2 }}"
      unit_of_measurement: 'V'
      unique_id: "visvoeder_voltage"        

afbeelding

I still have the same unknown value.
In MQTT explorer I put also the json file to publish and still unknown value as result.

it looks that it is working with you, but here still the same.

can it be in the configuration.yaml that I made a mistake?

 How can you send a piece of yaml code, so that it looks good?

Format your code properly:

    
mqtt:
  sensor:
    - name: "Kwartverbruik sim"
      state_topic: "sm/kwsim"
      qos: 0
      unit_of_measurement: "W15min"
    - name: "spanning L1"     
      state_topic: "sm/kwL1"
      qos: 0
      unit_of_measurement: "V"
    - name: "spanning L3" 
      state_topic: "sm/kwL3"
      qos: 0
      unit_of_measurement: "V"
    - name: "energy used" 
      state_topic: "sm/dagU"
      qos: 0
      unit_of_measurement: "Wh"  
      state_class: total
      device_class: energy
    - name: "energy returned" 
      state_topic: "sm/dagR"
      qos: 0
      unit_of_measurement: "Wh"  
      state_class: total
      device_class: energy  
    - name: "Gas teller" 
      state_topic: "sm/gas"
      qos: 0
      unit_of_measurement: "m³"
      state_class: total
      device_class: gas    
    - name: "regenwaterput" 
      state_topic: "rw/proc"
      qos: 0 
      unit_of_measurement: "%"
    - name: "tvlift" 
      state_topic: "tv/op-neer"
      qos: 0   
    - name: "visvoeder"
      state_topic: "Visvoeder"   
      value_template: "{{ value_json.voltage_l2 }}"
      unit_of_measurement: 'V'
      unique_id: "visvoeder_voltage" 

This is what is in my cofiguration.yaml under MQTT

you are sure the state_topic is Visvoeder, and not visvoeder ? MQTT is case-sensitive.

this is wat mqtt explorer gives:

but I see that with other topics , you get (? topics, ? messages) and not with Visvoeder.

Alternative is a template sensor, with the attribute of afbeelding

I see on other topics that they also have no ? topics, ? messages

How do you make that =>
Alternative is a template sensor, with the attribute of afbeelding

Settings → Devices & Services → Helpers → Add Helper → Template

and in state template
{{state_attr(‘sensor.0xxxx_click’, ‘voltage_l2’) }} (did not retype that sensor !!)

Is the red in the template Ok?

yes, yes, yes, it is working !!!
many thanks.

1 Like