šŸ“ 100% Templatable Lovelace Configurations

You donā€™t have the most recent code orneed to clear your cache

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

Thanks

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.

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.

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

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:

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': '...'}"

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

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

1 Like

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ā€¦

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)

2 Likes

well shit! yes you can! Thanks.

1 Like

It does? Where?

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

I donā€™t see it here

image

Letā€™s keep the conversation relevant here, please

1 Like

Sorry, my fault.
Itā€™s gone private.

Please do let me know too if you figure this out ^^

Cheers

Iā€™m having some fun with this!

Can anyone tell me why one of these works but not the other?

  - type: 'custom:config-template-card'
    config:
      type: 'custom:hui-entities-card'
      title: London Underground
      show_header_toggle: false
      entities:

        - type: custom:card-modder
          style:
            --primary-text-color: "${states['sensor.bakerloo'].state === 'Good Service' ? 'yellow' : 'red' }"
          card:
            type: custom:hui-sensor-entity-row
            entity: sensor.bakerloo
            secondary_info: last-changed

        - type: custom:card-modder
          style:
            --primary-text-color: "${states['sensor.bakerloo'].state === 'Good Service' ? 'yellow' : 'red' }"
          card:
            type: custom:hui-entities-card
            entities:
              - entity: sensor.bakerloo
                secondary_info: last-changed

image

1 Like

Does anyone have problem with hold_action inside the custom:config-template-card?

The same hold_action works outside of the config-template-card but not inside,
tap_action works in both cases, though.