Lovelace: Bar Card

I can’t make it work on the template card at all

also… I didn’t see any instrucions for if this is a js or a module when I set it up and I selected module… this seems to work but I see now that it’s supposed to be js… is there a problem if I leave it as module?

Those are great changes too… thanks for doing that. Great card. Working with the attribute.

1 Like

That’s odd I’m fairly certain I had it working with the template card, but can’t get it to work anymore either. I’ll have another look tomorrow, for now you can just set the attribute like the example I posted earlier.

1 Like

Yes that’s what I did and it works… I had tried previously with it on the template card but no joy so if you do get it working I’ll be interested to see your code… Thanks again.

If it works I doubt it matters, but might as well change it to js then?

1 Like

Actually the template card does work, I just made a mistake in the config.

- type: custom:config-template-card
  card:
    type: custom:bar-card
    title: Default
    entity: sensor.test_value1
    color: purple
    direction: right-reverse
    max: ${states['climate.living_room'].attributes.max_temp}
1 Like

I was trying with it as a var[1] which it didn’t seem to read and also after a bunch of templates. Ill have another go tomorrow morning. Thanks.

It looks like animation: 'off' has stopped working?
My cards that include it don’t display at all.

You’re right, I didn’t have a test case for this so it just straight up broke. However you’re in luck since I was working on a new version anyway :wink:

0.1.7

  • fixed off config option for animation
  • adjusted color contrast, making the bar work better on bright themes
1 Like

It seems all the animations and indicator aren’t working correctly with config-template-card, probably because of the way it updates the card. So for now you’re better off just using the built in attribute options.

1 Like

Sorry but it still doesn’t work (for me).

          - type: custom:bar-card
            title: Processor Use
            entity: sensor.processor_use
            height: 30px
            animation: 'off'
            indicator: 'off'
            severity:
              - value: 60
                color: green
              - value: 85 
                color: orange
              - value: 100
                color: red

image

Your config works for me, are you sure it’s not using the cached version? Are you using the customcards path for the resource or local?

If it’s not the cache could you check the debug console (F12 in chrome) and see if it throws an error.

I agree… The only reason I wanted to use the template card was because you didn’t allow attributes for reading the max/min etc… Now that I can do that there’s no reason to use the template card for this anymore.

It’s working great… so thanks for that and the recent changes you made that give me what I needed.

Yeah sorry. :blush:
I can’t believe I fell for that one again (cache).

2 Likes

I have a problem using 0.90.0 where the error is saying:

Sat Mar 30 2019 23:52:50 GMT+1000 (Australian Eastern Standard Time)

Setup failed for resources: Component not found.

and

Sat Mar 30 2019 23:52:50 GMT+1000 (Australian Eastern Standard Time)

Unable to find component resources

Anyone else had a similar problem using 0.90.0?

UPDATE:
Been trying to find the problem here for hours.
Rebooted my QNAP server and even that did not help.
Read the documentation for custom cards and found the resources example:

# Example Lovelace configuration
resources:
  - url: /local/content-card-example.js
    type: js

So I tried copying the .js file and put it just inside the www folder adjusted my resources config and all working my example bar card now.

resources:
#  - url: /local/custom-lovelace/bar-card/bar-card.js?v=0.1.5
  - url: /local/bar-card.js?v=0.1.5
    type: js

I’ll post any problems as I get using this across my ui.

Cheers for all your hard work as immediately my tank contents looks much more convincing!

1 Like

Does anybody know how to ged rid of this from showing?

Thanks! Love this card

It’s a bit hard to see the context of your issue. What card are we looking at here?

Sorry it’s the Bar Card, I use it for a state sensor everything works perfectly but I just want to hide the name behind the state.

If you don’t want to see the title at all you can set title_position to off.