My Lovelace Plugins

After upgrading to the last release i get this about useful-markdown-card:

19

The code is:

      - type: custom:card-modder
        card:
          type: custom:useful-markdown-card
          content: >
             Oggi [[ sensor.oggi.state ]] <br> [[ sensor.weather_report.state ]]
        style:               
          text-align: center
          background-image: url("/local/lovelace/images/meteo.jpeg")
          background-size: 100% 200px
          --primary-text-color: var(--primary-text-color)
          --secondary-text-color: var(--secondary-text-color)
          --paper-item-icon-color: var(--primary-text-color) #small variation icons
          color: yellow
          background-repeat: no-repeat
          border-radius: 20px
          border: solid 1px rgba(100,100,100,0.3)
          box-shadow: 3px 3px rgba(0,0,0,0.4) 

What is changed? How to fix it?

I made a mistake in card-tools. Itā€™s fixed now @VDRainer, @maurizio53.
Missed a single ?ā€¦

1 Like

My bad. You probably need quotes around everything to the right of the colon:

background-color: '[[ if(input_select.remote == ā€œTIVOā€, ā€œblueā€, ā€œrgba(56, 60, 69, 1)ā€) ]]'

1 Like

BAM!, you are the man.

Strangeā€¦
background-color: '[[ if(input_select.remote == "TIVO", "blue", "rgba(56, 60, 69, 1)") ]]'
Will work!

But not:
background-color: '[[ if(input_select.remote == "TIVO", "rgba(0, 0, 255, 1)", "rgba(56, 60, 69, 1)") ]]'

Ah. I see the problem, and can try to fix it later tonight perhapsā€¦

In the meantime, you canā€™t use commas in the <then> clause of the if(<condition>, <then>, <else>)ā€¦

Regexes are hardā€¦

Iā€™m not sure thatā€™s correctā€¦

I updated yesterday and didnā€™t notice this till this morning. But I just updated card-tools to the latest version (according to the resource trackerā€¦) and Iā€™m still not getting the state in secondaryinfo, just the entity name:

ex

ex2

Thanks to the great work of @thomasloven, @mayker and @frenck (sorry if i forgot to credit someone) my lovelace now rocks these 4 remotes for controlling my: LG TV, Nvidia Shield TV, TIVO Box and Radio on my Sonos Play Bar.
(I will publish the code on my github soon, will post here when i do)

(Right click the image and open in new tab to see the full image)

3 Likes

Strangeā€¦ i changed the code in this way:

  - type: custom:card-modder
    card:
      type: custom:useful-markdown-card
      content: >
         Oggi [[ sensor.oggi.state ]]
              [[ sensor.weather_report.state ]]
    style:               
      text-align: center
      background-image: url("/local/lovelace/images/meteo.jpeg")
      background-size: 100% 200px
      --primary-text-color: var(--primary-text-color)
      --secondary-text-color: var(--secondary-text-color)
      --paper-item-icon-color: var(--primary-text-color) #small variation icons
      color: yellow
      background-repeat: no-repeat
      border-radius: 20px
      border: solid 1px rgba(100,100,100,0.3)
      box-shadow: 3px 3px rgba(0,0,0,0.4) 

And all was okā€¦

Not to me :wink: Thatā€™s exactly the behavior Iā€™d expect with the bug I had.
It really should be fixed in 82f5e6, though. Make sure you invalidated your cache, and do a few extra ctrl+f5. You too @finity - and if that doesnā€™t work, you should post your yaml as well.

No. still the same.

Iā€™ve restarted HA, hit the ā€œrefreshā€ button in the top left of the Lovelace UI, hit ctrl-F5 a few times and even went in to the setting section of Chrome and cleared the cache from there too. And as one more check I went to my phone and checked it from there and I always end up with the results above.

here is my lovelace config for that sensor:

  - type: entities
    title: Garage
    show_header_toggle: false
    entities:
      - cover.north_garage_door
      - entity: sensor.n_gd_pos_template
        type: "custom:secondaryinfo-entity-row"
        secondary_info: "Battery Level: [[ sensor.batt_garagedoor1.state ]]%"

As far as I know it was working until I updated yesterday.

Oh! Iā€™m an idiot!
I forgot entity ids can contain digits too!

Update 9203a1 of card-tools should fix thatā€¦

2 Likes

Just updated to the latest version and that issue is fixed. Thanks! :+1:

Is it possible to use any of these plugins to create a card that appears ONLY if a given value of a device comes above / below a given value?
As for example here ā€¦ if it is low on battery.

Or the card may appear if the window in the childrenā€™s room is open and the temperature falls below a given value (then shows the childā€™s window = open and outside temperature = x degrees).

Or is it possible to create a plugin based on an automation? If sensor.child.bedroomwindow = open and sensor.outside_temp = > x degreesā€¦ then show card and these two sensors.

Is this possible to achieve?

Is it possible to adjust a card title so that it is centered?

If i change justify - content: to ā€œcenterā€, it will center it like in the screenshot below. But how would I enter that in lovelace card to center the header?

any way to set the background of a vertical or horizontal stack?

Iā€™ve tried using card-modder but it doesnā€™t seem to apply at the right level.

I have now my code on github for my lovelace ā€œmulti remoteā€

5 Likes

Any changes to card-modder? After a recent update, some of the css styling such as:

padding: 14px
font-size: 24px
color: 'var(--orange-accent)'

doesnā€™t work. It worked a couple of days ago.
I noticed that e.g. background-color changed to --paper-card-background-color, but are there other changes to the css syntax and where can I find it?

Edit: Updated the card-modder.js and now all except padding seems to work.

This works for me:
padding: 5px 5px 5px 5px

This is a very nice effect. Is it done with styling or a background image?
image