How to add "more-info" on the dashboard

Good Morning,
I have a binary sensor (leak sensor) that is correctly displayed on the dashboard.
The sensor is calleable as: “binary_sensor.water_leak_sensor_IDNUMBER”, if i click on this element “more-info” i can see different information like voltage & battery level.

image

image

How can i move directly this information on the dashboard without click on the item to show it?

regards
Gianluca

You can use the binary sensor template to get more informations:

For example (put the code in configuration.yaml):

sensor:
  - platform: template
    sensors:
      water_leak_sensor:
       friendly_name: "Water leak sensor battery"
       unit_of_measurement: "%"
       value_template: "{{ state_attr('binary_sensor.water_leak_sensor_IDNUMBER', 'Battery') }}"

Correction: Template sensor. Not template binary sensor. They are analogue attributes.

sensor:
  - platform: template
    sensors:
      wcf_battery:
        friendly_name: "WCF battery"
        entity_id: binary_sensor.water_leak_sensor_IDNUMBER
        device_class: battery
        value_template: "{{ state_attr('binary_sensor.water_leak_sensor_IDNUMBER', 'battery level') }}"

      wcf_votage:
        friendly_name: "WCF Voltage"
        entity_id: binary_sensor.water_leak_sensor_IDNUMBER
        unit_of_measurement: 'V'
        icon: mdi:flash
        value_template: "{{ state_attr('binary_sensor.water_leak_sensor_IDNUMBER', 'voltage') }}"

Using the battery device class for the battery sensor will give different battery level icons depending on the battery state.

Screenshot_2020-02-27 Home Assistant(1)

You are right! Sorry, I am still half asleep. :sleeping:

1 Like

Thanks a lot fot the reply.
My idea is to have a for each sensor in dashboard the same panel displayed on more-info:

image

In addition instead of “13 hour ago” that is the “last-changed” value…i prefer have the last time that the sensor is switched from off to on.

Im asking too much ? :slight_smile:

There’s a custom more-info card, and guess who did it?

Thanks guys,
I have tried your code and work fine!! Thanks!!
In addition instead of “13 hour ago” that is the “last-changed” value…i prefer have the last time that the sensor is switched from off to on. How can i implement this message ?