dylandoamaral / uptime-card

Minimalistic uptime card for Home Assistant Lovelace UI
266 stars 11 forks source link

Existing data is not used #17

Closed agneevX closed 3 years ago

agneevX commented 3 years ago

Firstly, great job on the card. I've been looking for a replacement for binary sensors over the native graph and I think I've found it.

After I've added the card, it looks like it populates new data in the browser and existing/old data seems to be ignored.

image

That means I get different data depending on the device. Could this be changed so it uses existing data? Thanks!

dylandoamaral commented 3 years ago

It is, look at https://github.com/dylandoamaral/uptime-card/issues/12 for more information about your problem. I will maybe increase the home assistant API fetching time by multiplying hoursToShow to make it a bit less confusing !

Edit: I didn't see that there is a lot of state changes inside the history during the last hour. There is a bug... I will see that later in the afternoon.

agneevX commented 3 years ago

Thanks because it's hard to change that parameter on each device.

Do you think you can add tap on entity name/icon to view entity details?

dylandoamaral commented 3 years ago

Of course it is on my roadmap (inside the readme) 😉.

agneevX commented 3 years ago

Ah that's good. When hours_to_show is set to 1, how much data does it end up grabbing?

dylandoamaral commented 3 years ago

One hour, it try to fetch exactly the hoursToShow option. And if there is no changes during that amount of time it can't detect any points... I will increase that amount.

agneevX commented 3 years ago

Hmm but there were a lot of changes in a short period in 1 hour (first graph above).

So maybe there's a bug somewhere?

dylandoamaral commented 3 years ago

Yes I think so

IanAdd commented 3 years ago

FYI When setting up my first card in the simplest way, ie just entering a binary sensor id, no data was shown just grey. By experimentation I found that hours_to_show: and ok: are essential Can I suggest that they are added to the 'mandatory' section of the setup of the card or default values are assumed if not defined.

dylandoamaral commented 3 years ago

Hello there is a defaut value for hours_to_show set to 24 hours. For ok it is a bit difficult since it is not mandatory by itself but you should add either ok or ko option to make the card work. I wrote an entire section about that specificity. I will maybe point out that specificity earlier inside the README. Thanks for the feedback !

agneevX commented 3 years ago

Is it possible to rename ok and ko to on_state and off_state?

Also, there's limited binary states, on or off, so for these sensors, there should not be a need to specify states.

dylandoamaral commented 3 years ago

The problem renaming the parameters is that they are breaking changes and every people using the card will have an unpredictable effect. But you are totally right ok and ko was bad namings (I am terribly bad at naming things), I still note any of these changes for the v1.0.0 since it will be by nature a breaking version. But I would not do that until this version.

About on and off, you are right I didn't know every binary sensors are only limited to on or off. I was thinking that you can select both on and off state using templating for exemple. I will make a PR to deduce state for entity starting by binary_sensors.

However please create several issues for any new features/bugs request ^^'.

dylandoamaral commented 3 years ago

The inference for binary sensors issue is closed with #19.