LoveLace: how to create tasmota status card

Tags: #<Tag:0x00007f73977f0730> #<Tag:0x00007f73977f05f0>

Hello,

I am experimenting with Sonoff devices, tasmota firmware and home assistant.
In LoveLace auto-gen, I get a status card like

What is the yaml config to create this manually? I can not find the correct syntax…
Creating the individual sensors is not a problem
I.e.

sensor:
  - platform: mqtt
    name: "Tasmota-113 Power"
    state_topic: "tasmota-113/tele/SENSOR"
    value_template: '{{ value_json["ENERGY"]["Power"] }}'
    unit_of_measurement: "W"

But I especially like the status card with the multiple sensors…

any help is appreciated

Kind regards,
Bart

here read this

this should point you down the right path

Hi,

Maybe my question was not clear enough.
I’m looking for the correct syntax tot get all the details of my tasmota on just “one” sensor (status), and when you click on it, it shows all the details

Is this something that can be done manualy in lovelace? The above screenshot is from lovelace auto-gen

grtz
B

They are all attributes you can get into Lovelace. I don’t need/want to see them all but I have a card that shows this:
image
Clicking on any line shows the full card.
Lovelace config:

          - type: 'custom:config-template-card'
            variables:
              - states['sensor.sonoff1_2914_status'].attributes['MqttCount']
              - states['sensor.sonoff1_2914_status'].attributes['WiFi LinkCount']
              - states['sensor.sonoff1_2914_status'].state
              - states['sensor.sonoff2_3110_status'].attributes['MqttCount']
              - states['sensor.sonoff2_3110_status'].attributes['WiFi LinkCount']
              - states['sensor.sonoff2_3110_status'].state
              - states['sensor.sonoff5_1083_status'].attributes['MqttCount']
              - states['sensor.sonoff5_1083_status'].attributes['WiFi LinkCount']
              - states['sensor.sonoff5_1083_status'].state
              - states['sensor.sonoff6_3719_status'].attributes['MqttCount']
              - states['sensor.sonoff6_3719_status'].attributes['WiFi LinkCount']
              - states['sensor.sonoff6_3719_status'].state
              - states['sensor.nodemcu_lounge_status'].attributes['MqttCount']
              - states['sensor.nodemcu_lounge_status'].attributes['WiFi LinkCount']
              - states['sensor.nodemcu_lounge_status'].state
              - states['sensor.nodemcu_bedroom_status'].attributes['MqttCount']
              - states['sensor.nodemcu_bedroom_status'].attributes['WiFi LinkCount']
              - states['sensor.nodemcu_bedroom_status'].state
              - states['sensor.sonoff3_0898_status'].attributes['MqttCount']
              - states['sensor.sonoff3_0898_status'].attributes['WiFi LinkCount']
              - states['sensor.sonoff3_0898_status'].state
            entities:
              - sensor.sonoff1_2914_status
              - sensor.sonoff2_3110_status
              - sensor.sonoff5_1083_status
              - sensor.sonoff6_3719_status
              - sensor.nodemcu_lounge_status
              - sensor.nodemcu_bedroom_status
              - sensor.sonoff3_0898_status
            card:
              type: 'custom:hui-entities-card'
              title: MQTT & Wifi Connections
              show_header_toggle: false
              entities:
                - entity: sensor.sonoff1_2914_status
                  name: "${'Coffee' + '\xa0'.repeat(16) + 'MQTT ' + vars[0] + '\xa0'.repeat(4) + 'WiFi ' + vars[1] + '\xa0'.repeat(3) + ((parseInt(vars[2]) / 2) - 100 ) + '\xa0' + 'dBm' + '\xa0'.repeat(3) + ( vars[2] >= 100 ? 'Excellent' : vars[2] >= 80 ? 'Good' : vars[2] >= 60 ? 'Fair' : 'Weak' )}"
                  icon: "${vars[2] >= 100 ? 'mdi:wifi' : vars[2] >= 80 ? 'mdi:wifi-strength-3' : vars[2] >= 60 ? 'mdi:wifi-strength-2' : 'mdi:wifi-strength-1' }"
                - entity: sensor.sonoff2_3110_status
                  name: "${'Toothbrush' + '\xa0'.repeat(7) + 'MQTT ' + vars[3] + '\xa0'.repeat(4) + 'WiFi ' + vars[4] + '\xa0'.repeat(3) + ((parseInt(vars[5]) / 2) - 100 ) + '\xa0' +  'dBm' + '\xa0'.repeat(3) + ( vars[5] >= 100 ? 'Excellent' : vars[5] >= 80 ? 'Good' : vars[5] >= 60 ? 'Fair' : 'Weak' )}"
                  icon: "${vars[5] >= 100 ? 'mdi:wifi' : vars[5] >= 80 ? 'mdi:wifi-strength-3' : vars[5] >= 60 ? 'mdi:wifi-strength-2' : 'mdi:wifi-strength-1' }"
                - entity: sensor.sonoff5_1083_status
                  name: "${'Garage' + '\xa0'.repeat(15) + 'MQTT ' + vars[6] + '\xa0'.repeat(4) + 'WiFi ' + vars[7] + '\xa0'.repeat(3) + ((parseInt(vars[8]) / 2) - 100 ) + '\xa0' +  'dBm' + '\xa0'.repeat(3) + ( vars[8] >= 100 ? 'Excellent' : vars[8] >= 80 ? 'Good' : vars[8] >= 60 ? 'Fair' : 'Weak' )}"
                  icon: "${vars[8] >= 100 ? 'mdi:wifi' : vars[8] >= 80 ? 'mdi:wifi-strength-3' : vars[8] >= 60 ? 'mdi:wifi-strength-2' : 'mdi:wifi-strength-1' }"
                - entity: sensor.sonoff6_3719_status
                  name: "${'Alarm' + '\xa0'.repeat(17) + 'MQTT ' + vars[9] + '\xa0'.repeat(4) + 'WiFi ' + vars[10] + '\xa0'.repeat(3) + ((parseInt(vars[11]) / 2) - 100 ) + '\xa0' +  'dBm' + '\xa0'.repeat(3) + ( vars[11] >= 100 ? 'Excellent' : vars[11] >= 80 ? 'Good' : vars[11] >= 60 ? 'Fair' : 'Weak' )}"
                  icon: "${vars[11] >= 100 ? 'mdi:wifi' : vars[11] >= 80 ? 'mdi:wifi-strength-3' : vars[11] >= 60 ? 'mdi:wifi-strength-2' : 'mdi:wifi-strength-1' }"
                - entity: sensor.nodemcu_lounge_status
                  name: "${'Weather' + '\xa0'.repeat(12) + 'MQTT ' + vars[12] + '\xa0'.repeat(4) + 'WiFi ' + vars[13] + '\xa0'.repeat(3) + ((parseInt(vars[14]) / 2) - 100 ) + '\xa0' +  'dBm' + '\xa0'.repeat(3) + ( vars[14] >= 100 ? 'Excellent' : vars[14] >= 80 ? 'Good' : vars[14] >= 60 ? 'Fair' : 'Weak' )}"
                  icon: "${vars[14] >= 100 ? 'mdi:wifi' : vars[14] >= 80 ? 'mdi:wifi-strength-3' : vars[14] >= 60 ? 'mdi:wifi-strength-2' : 'mdi:wifi-strength-1' }"
                - entity: sensor.nodemcu_bedroom_status
                  name: "${'Bedroom' + '\xa0'.repeat(10) + 'MQTT ' + vars[15] + '\xa0'.repeat(4) + 'WiFi ' + vars[16] + '\xa0'.repeat(3) + ((parseInt(vars[17]) / 2) - 100 ) + '\xa0' +  'dBm' + '\xa0'.repeat(3) + ( vars[17] >= 100 ? 'Excellent' : vars[17] >= 80 ? 'Good' : vars[17] >= 60 ? 'Fair' : 'Weak' )}"
                  icon: "${vars[17] >= 100 ? 'mdi:wifi' : vars[17] >= 80 ? 'mdi:wifi-strength-3' : vars[17] >= 60 ? 'mdi:wifi-strength-2' : 'mdi:wifi-strength-1' }"
                - entity: sensor.sonoff3_0898_status
                  name: "${'Office' + '\xa0'.repeat(16) + 'MQTT ' + vars[18] + '\xa0'.repeat(4) + 'WiFi ' + vars[19] + '\xa0'.repeat(3) + ((parseInt(vars[20]) / 2) - 100 ) + '\xa0' + 'dBm' + '\xa0'.repeat(3) + ( vars[20] >= 100 ? 'Excellent' : vars[20] >= 80 ? 'Good' : vars[20] >= 60 ? 'Fair' : 'Weak' )}"
                  icon: "${vars[20] >= 100 ? 'mdi:wifi' : vars[20] >= 80 ? 'mdi:wifi-strength-3' : vars[20] >= 60 ? 'mdi:wifi-strength-2' : 'mdi:wifi-strength-1' }"

Uses the custom config-template-card

1 Like

Hi,
sorry for my lovelace-ignorance, it’s all very new to me.

here is how I defined my tasmota in my config


# =================================================
# SONOFF
# TASMOTA firmware
# =================================================
switch:
  - platform: mqtt
    name: "Tasmota-113"
    state_topic: "tasmota-113/stat/RESULT"  
    value_template: "{{ value_json.POWER }}"
    command_topic: "tasmota-113/cmnd/POWER"
    payload_on: "ON"
    payload_off: "OFF"
    availability_topic: "tasmota-113/tele/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    qos: 1
    retain: false



sensor:
  - platform: mqtt
    name: "Tasmota-113 WiFi Quality"
    state_topic: "tasmota-113/tele/STATE"
    unit_of_measurement: "%"
    value_template: "{{value_json['Wifi'].RSSI }}"
    availability_topic: "tasmota-113/tele/LWT"
    payload_available: "Online"
    payload_not_available: "Offline"
    device_class: signal_strength


  - platform: mqtt
    name: "Tasmota-113 Energy Today"
    state_topic: "tasmota-113/tele/SENSOR"
    value_template: '{{ value_json["ENERGY"]["Today"] }}'
    unit_of_measurement: "kWh"

  - platform: mqtt
    name: "Tasmota-113 Power"
    state_topic: "tasmota-113/tele/SENSOR"
    value_template: '{{ value_json["ENERGY"]["Power"] }}'
    unit_of_measurement: "W"

  - platform: mqtt
    name: "Tasmota-113 Voltage"
    state_topic: "tasmota-113/tele/SENSOR"
    value_template: '{{ value_json["ENERGY"]["Voltage"] }}'
    unit_of_measurement: "V"

  - platform: mqtt
    name: "Tasmota-113 Current"
    state_topic: "tasmota-113/tele/SENSOR"
    value_template: '{{ value_json["ENERGY"]["Current"] }}'
    unit_of_measurement: "A"

But I don’t know how I can show the uptime, SaveCount, IPaddress, etc…
In fact, I even don’t know how I have to define this “status” sensor with all it’s attributes… :relaxed:

The sensor you showed a screenshot of is only created if you use MQTT discovery. It will be there in the mqtt integration. You showed the screenshot so it must be there…