Open kylian-002 opened 7 months ago
You could post values from one plot into a sensor using the hass object, then fetch it in the other one.
The currently visible range is in get('vidible_range')
Ok, I tried it and it does work but it is not great to be honest.
One thing you could do is to put all plots in a single card like this: https://github.com/dbuezas/lovelace-plotly-graph-card/discussions/13
For the record, this was my experiment:
type: custom:plotly-graph
entities:
- entity: sensor.senseair_co2
fn: >
$ex hass.callApi("POST", "states/sensor.plotly_visible_range", {state:
JSON.stringify(get("visible_range"))})
type: custom:plotly-graph
entities:
- entity: sensor.senseair_co2
- entity: sensor.plotly_visible_range
internal: false
comment1: for some reason, plotly doesnt update the layout if this is internal true
comment2: this is here just to make plotly refresh when visible range changes
yaxis: y10
'y': []
layout:
xaxis:
range: |
$ex JSON.parse(hass.states["sensor.plotly_visible_range"].state)
hours_to_show: 24
refresh_interval: auto
Ok, I tried it and it does work but it is not great to be honest.
One thing you could do is to put all plots in a single card like this: #13
I think this wil work for my usecase. Thanks!
Describe the solution you'd like I would like to have the ability to use a single set of date and time selection controls to select the date and time for all cards on a given dashboard, or perhaps for a selected few that are selectable by tags. This functionality would be similar to how the "energy-date-selection" card works for the energy dashboard but applicable to Plotly cards and usable for purposes other than energy-related data.
How would it be defined in yaml?