Replies: 2 comments 7 replies
-
Cool plot-project! x: |
$fn ({ vars, hass }) => {
const some_other_calculation = xxxxxx;
return some_other_calculation + vars.y + hass.states['sensor.solcast_pv_forecast_prognose_heute'].attributes['detailedHourly'][10]['pv_estimate']
} Or this is the same: x: |
$ex {
const some_other_calculation = xxxxxx;
return some_other_calculation + vars.y + hass.states['sensor.solcast_pv_forecast_prognose_heute'].attributes['detailedHourly'][10]['pv_estimate']
} $ex is exactly the same as $fn, except that the parameters are added automatically. The third (maybe best) solution is: entity: sensor.solcast_pv_forecast_prognose_heute
y: |
$ex {
const est = meta.detailedHourly[10].pv_estimate;
....
return whatever;
} the |
Beta Was this translation helpful? Give feedback.
1 reply
-
|
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hallo everyone,
plotly is so cool, great job.
I have a question that I haven't found yet (perhaps I have not understood the solutions):
I would like to show the forecast of the energy stored in the battery. The data for this is available in sensors, which I can access via jinja as follows (example for 10 o'clock):
{{ state_attr('sensor.solcast_pv_forecast_prognose_today', 'detailedHourly')[10]['pv_estimate'] }}
or
{{ states['sensor.solcast_pv_forecast_today'].attributes['detailedHourly'][10]['pv_estimate'] }}
Of course, I can display this directly in plotly:
`
`
But I would like to make additional calculations (battery status + forecast - estimated consumption) and wonder how I can access the data in a function. For example: How can I store the above value with the index i in y[i]:
`
`
Tank you very much
Roland
Beta Was this translation helpful? Give feedback.
All reactions