Since_last_boot gone, now how to?

I’m still playing with these…

One thing I’ve stumbled upon is the graph seems to crap out sometimes (if the sensor doesn’t keep a history of states maybe?)

For example this sensor:

      count_automations:
        entity_id: sensor.date
        value_template: "{{ states.automation | count }}"

Fails with this error;

mini-graph-card TypeError: Cannot read property 'aggregate_func' of null

              - !include
                - templates/button_sensor.yaml
                - sensor: sensor.count_automations
                  name: Automations
                  icon: mdi:robot

I have a ton of sensors without a history. Not getting that exception. Are you running the latest mini-graph-card?

Yep, latest everything.

If I comment out the graph I get this

image

image

You shouldn’t have needed to comment out the graph. Something isn’t quite right. Check the name of your entity_id. Maybe spelling error

If I don’t comment out the graph I get this

image

To be more accurate for all those component count sensors I get this

Yeah, I think your entity_id is wrong for your configuration. I.E. spelling error on the sensor entity_id. Because there’s no way you should be getting null as a response from my template.

for shits and giggles uncomment this line and look in the chrome logs (F12):

        // console.log(`${entity_id}: ${statestr}, ${units}, ${date}, ${value}`);

Ok, so what do you want to know?

Yep, you spelled something wrong for your entity_id. The first check I do is to make sure the entity_id is valid.

var entity_id = (entity === undefined) ? 'Invalid Entity' : entity.entity_id;

This means all the cards aren’t seeing your entity_id.

If you’re using lovelace_gen, make sure you’re passing `entity’ to the card and not ettiitity or something.

But this proves it’s right. Surely?

your yellow highlight row should be

- entity: sensor.count_automations

UUURRRGGGHHH…
:woozy_face: :man_facepalming: :man_facepalming: :man_facepalming:

That’s what you get for copy and pasting without thinking.

Sorry…

1 Like

I love how this thread has come to live and segwayed into something else.

Yeah… sorry my fault :wink:

I’ve got some nice buttons now though. (and learnt a bit more CSS/Javascript)

1 Like

impossible, it’s wizardry

2 Likes

I love this buttons!! But I can´t make it work… In the entity I put a sensor temperature, anything else? I get this error:

imagen

That’s not an error, that’s the code. You’ll have to screenshot the actual error.

I don´t undestand, nothing is displayed. I have modified the first part because in “config UI” I don’t know where to put the code “lovelace_gen”. Just tell me this:

Yeah, sorry. I can’t help with the UI editor. I’d need to see the full yaml code and an actual error associated with it. The rex box is not displaying and error. It’s displaying the code.

Ok, I’m going to take a closer look and tell you something. Congrats on your configuration!! Lovely!!

@petro
I’m just wondering…
Do your graphs show on the first time a tab is displayed?
I’m finding that they don’t until I go back to that tab a second time.

It seems to be repeatable. Pressing F5 makes the graph line disappear but going to a different tab and back again makes them reappear.

I just wondered if it was something you’d ever come across?