kalkih / mini-graph-card

Minimalistic graph card for Home Assistant Lovelace UI
MIT License
3.05k stars 237 forks source link

Only show today #726

Closed pdwonline closed 2 years ago

pdwonline commented 2 years ago

I want to show only todays values and hoped to manipulate the hours_to_show parameter with a template to only show up to the current hour like this:


  - type: custom:mini-graph-card
    min_bound_range: 50
    logarithmic: true
    hours_to_show: '{{ now().hour |int(0) }}'
    show:
      name: false
      icon: false
    entities:
      - entity: sensor.cv_burnrate

Unforunately it didn's work. How can I achieve this? Or is this a feature request?

jlsjonas commented 2 years ago

Relates to #502, this is currently (indeed) not possible

ildar170975 commented 2 years ago

Related to https://github.com/kalkih/mini-graph-card/issues/697


Currently this may be achieved by placing the mini-graph-card ("MGC") into config-template-card ("CTC"):

  1. List all required sensors in the CTC::entities option - otherwise the graph will not reflect the changing sensors.
  2. Specify a CTC::variables option - add a variable for "now().hour |int(0)" but written on JS.
  3. Use this variable for MGC::hours_to_show option.
ildar170975 commented 2 years ago

May be based on the same approach: https://github.com/kalkih/mini-graph-card/issues/363 https://github.com/kalkih/mini-graph-card/issues/77

stale[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this is still an active issue, please let us know!

ildar170975 commented 1 year ago

For the record: https://community.home-assistant.io/t/lovelace-mini-graph-card/71385/2344?u=ildar_gabdullin