Home Assistant Community

📝 100% Templatable Lovelace Configurations

lovelace
templates
Tags: #<Tag:0x00007f375c6e0b28> #<Tag:0x00007f375c6eb4d8>
#108

Hi @iantr
did you have any chance to look into my tests?

So far I didn’t manage to have anything working with this card (well, I tested two things to be fair :D)

0 Likes

#109

Tried that as well… still doesn’t work… Can you show how to use it in my template please?

0 Likes

#110

If you use Tasmota version 6.2.1.21 or so there’s a new MQTT status that pops up automagically as a sensor. You can see my config in the template to display it here. (I am using MQTT Discovery so I have 2 sensors for each switch a status one and a control one)

0 Likes

#111

You don’t have the most recent code orneed to clear your cache

0 Likes

#112

I don’t use MQTT Discovery, so I guess I’ll have to create it myself :slight_smile:

Thanks

0 Likes

#113

You’re right I didn’t…
But the Tracker Card was telling me I did!

image

I’ve now copied the latest code across manually and it works.
Thanks and sorry for the misunderstanding.

0 Likes

#114

I ran into the same issue as you klogg, same error, then same custom_updater thing. I posted over on the issue on github and found the source of the problem. Not sure who “owns” the issue, probably custom_updater.

0 Likes

#115

Just want to say thanks to this awesome card!!
Opens up so much options and possibilities, also keep making changes so much easier, changes used to required restart now can be done all in lovelace yaml with a refresh.

I vote for the temp_var also.

1 Like

#116

Just to post another example, I managed to color a group of person entities based on their individual states. As I mentioned in the comment with it, it’s probably better to just use CustomUI for stuff like this:

0 Likes

#117

Maybe it would be possible to support any number of temp_vars:

temp_vars:
  var_1: "..."
  var_2: "..."

Although you could probably still achieve that by just returning an object to temp_vars directly:

temp_vars: "{'var_1': '...', 'var_2': '...'}"
0 Likes

#118

Thanks to @iantrich got it working. In case anyone else is interested:

image

           - type: 'custom:config-template-card'
            config:
              type: 'custom:hui-entities-card'
              title: MQTT & Wifi Connections
              show_header_toggle: false
              entities:
                - entity: sensor.sonoff1_2914_status
                  name: "${'Coffee' + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + 'MQTT ' + states['sensor.sonoff1_2914_status'].attributes['MqttCount'] + '\xa0\xa0\xa0\xa0' + 'WiFi ' + states['sensor.sonoff1_2914_status'].attributes['WiFi LinkCount']}"
                - entity: sensor.sonoff2_3110_status
                  name: "${'Toothbrush' + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + 'MQTT ' + states['sensor.sonoff2_3110_status'].attributes['MqttCount'] + '\xa0\xa0\xa0\xa0' + 'WiFi ' + states['sensor.sonoff2_3110_status'].attributes['WiFi LinkCount']}"
                - entity: sensor.sonoff5_1083_status
                  name: "${'Garage' + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + 'MQTT ' + states['sensor.sonoff5_1083_status'].attributes['MqttCount'] + '\xa0\xa0\xa0\xa0' + 'WiFi ' + states['sensor.sonoff5_1083_status'].attributes['WiFi LinkCount']}"
                - entity: sensor.sonoff6_3719_status
                  name: "${'Alarm' + '\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0' + 'MQTT ' + states['sensor.sonoff6_3719_status'].attributes['MqttCount'] + '\xa0\xa0\xa0\xa0' + 'WiFi ' + states['sensor.sonoff6_3719_status'].attributes['WiFi LinkCount']}"
1 Like

#119

Good looking card; god awful configuration :rofl: it looks hideous, lol

1 Like

#120

It looks even worse in the GUI editor… the above is my yaml version where I do my edits and then paste into the raw editor… the GUI version is even worse…
I’m open to any suggestions on how to improve it but am just grateful I can show the information without creating sensors.
Here’s the GUI version:

  - type: 'custom:config-template-card'
    config:
      type: 'custom:hui-entities-card'
      title: MQTT & Wifi Connections
      show_header_toggle: false
      entities:
        - entity: sensor.sonoff1_2914_status
          name: "${'Coffee' + '\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_' + 'MQTT ' + states['sensor.sonoff1_2914_status'].attributes['MqttCount'] + '\_\_\_\_' + 'WiFi ' + states['sensor.sonoff1_2914_status'].attributes['WiFi LinkCount']}"
        - entity: sensor.sonoff2_3110_status
          name: "${'Toothbrush' + '\_\_\_\_\_\_\_' + 'MQTT ' + states['sensor.sonoff2_3110_status'].attributes['MqttCount'] + '\_\_\_\_' + 'WiFi ' + states['sensor.sonoff2_3110_status'].attributes['WiFi LinkCount']}"
        - entity: sensor.sonoff5_1083_status
          name: "${'Garage' + '\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_' + 'MQTT ' + states['sensor.sonoff5_1083_status'].attributes['MqttCount'] + '\_\_\_\_' + 'WiFi ' + states['sensor.sonoff5_1083_status'].attributes['WiFi LinkCount']}"
        - entity: sensor.sonoff6_3719_status
          name: "${'Alarm' + '\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_\_' + 'MQTT ' + states['sensor.sonoff6_3719_status'].attributes['MqttCount'] + '\_\_\_\_' + 'WiFi ' + states['sensor.sonoff6_3719_status'].attributes['WiFi LinkCount']}"

I tell a lie… it’s changed even from what I saw last time… Note it’s changed the spaces as well…

0 Likes

#121

This may be a dumb question, but can you replace:

'\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0\xa0'

with

'\xa0'.repeat(16)

1 Like

#122

well shit! yes you can! Thanks.

1 Like

#123

It does? Where?

0 Likes

#124

Look in the integration and as well as the switch you will have a status sensor

0 Likes

#125

I don’t see it here

image

0 Likes

#126

Let’s keep the conversation relevant here, please

1 Like

#127

Sorry, my fault.
It’s gone private.

0 Likes