kalkih / mini-graph-card

Minimalistic graph card for Home Assistant Lovelace UI
MIT License
2.87k stars 231 forks source link

feat: Add support of attribute tree when available #996

Closed onlinux closed 11 months ago

onlinux commented 11 months ago

I confess i am not an expert of github. Yesterday, I submitted a pull request. In order to begin with a clean slate, I chose to re-clone the project. However, I noticed that this action resulted in the removal of all previous comments. I apologize for any inconvenience this may have caused.

When devices have attributes defined as attr1.attr2.attr3 etc... you can define the attribute as attr1.attr2.attr3 etc

Ex: for RPI monitor :

type: custom:mini-graph-card entities:

entity: sensor.rpi_raspi64_rpi_monitor_raspi64
attribute: cpu.load_1min_prcnt
name: Load Raspi64
entity: sensor.rpi_monitor_raspi65
attribute: cpu.load_1min_prcnt
name: Load Raspi65
unit: '%'

This will prevent the need to create numerous virtual sensors for each sub-attribute you wish to access.

akloeckner commented 11 months ago

However, I noticed that this action resulted in the removal of all previous comments.

The comments are in #995 .

Could you also please rebase your work on the dev branch? We have some erroneous commits in main that you have in your branch as well. (We should sort this out. But for now, we haven't yet...)

onlinux commented 11 months ago

Yes, this is what i am trying to do but don't know yet how to rebase it. As i said i am really not an expert of github, sorry. I guess i t is ok by now.

akloeckner commented 11 months ago

No worries. I pulled the master changes into dev. That should prevent us from this rebasing hassle in the future. 💪

onlinux commented 11 months ago

Yes you are right. Maybe i didn't correctly flush the cache of the browser when i was testing. Made the changes and test it, ok. I rebased the dev and master branch, hope this is good!

Thank you

akloeckner commented 11 months ago

Looks good! Can you also remove that other if?

I'll want to do a test tonight.

onlinux commented 11 months ago

Done

akloeckner commented 11 months ago

Great, thanks a lot!! I'll try this as soon as I can and merge.

(@ildar170975, I take your comment on this being a great feature as approval in the sense of #937.)

akloeckner commented 11 months ago

I somehow had a hard time to load the dev version into my HA instance. But I finally can confirm your contribution to work here as well! Thanks a lot for this great feature!

github-actions[bot] commented 11 months ago

:tada: This PR is included in version 0.12.0-dev.4 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket:

paqpaqpaq commented 10 months ago

Does this mean it now would be possible to get ahold of the values under "precip" from this sensor in order to plot a graph? And if so, how would one go about?

Attributes:

data:
  success: true
  start: 1692434100
  start_human: '10:35'
  temp: 25
  delta: 300
  precip:
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0
    - 0.3
    - 0.4
    - 0.3
    - 0.4
    - 0.5
    - 0.3
    - 0.3
    - 0.4
    - 0.2
    - 0.4
    - 0.4
    - 0.2
  levels:
    light: 0.25
    moderate: 1
    heavy: 2.5
  grid:
    x: 425
    'y': 552
icon: mdi:weather-cloudy
friendly_name: neerslag_buienalarm_regen_data
akloeckner commented 10 months ago

No, unfortunately.

This means, we can now access complex attributes. Before, we could only access attributes, which directly contained one numerical datum.

To plot a graph, we still need the individual points to be recorded at individual times in history.

Sorry for not having responded in #1001. I didn't want to distract from getting the docs improvement merged.

github-actions[bot] commented 5 months ago

:tada: This PR is included in version 0.12.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: