Filters #168
Replies: 7 comments 22 replies
-
Warning: beta version, some filters may change before production releaseExamplesCelcious to farenheit- entity: sensor.wintergarten_clima_temperature
unit_of_measurement: °F
filters: # °F = °C×(9/5)+32
- multiply: 1.8
- add: 32 alternatively, - entity: sensor.wintergarten_clima_temperature
unit_of_measurement: °F
filters: # °F = °C×(9/5)+32
- map_y_numbers: y * 9/5 + 32 Energy from power- entity: sensor.fridge_power
filters:
- integrate:
unit: h # resulting unit_of_measurement will be W/h Using state attributes- entity: climate.loungetrv_climate
attribute: current_temperature # an attribute must be set to ensure attributes are fetched.
filters:
- map_y_numbers: state.state === "heat" ? state.attributes.current_temperature : 0 more in the branch's readme here! |
Beta Was this translation helpful? Give feedback.
-
Small example of how simple it will be to do complex operations type: custom:plotly-graph
title: Smoothing
entities:
- entity: sensor.openweathermap_wind_speed
- entity: sensor.openweathermap_wind_speed
name: Moving window average
filters:
- sliding_window_moving_average:
extended: true
window_size: 20
- entity: sensor.openweathermap_wind_speed
name: Moving window median
filters:
- median:
extended: true
window_size: 20
hours_to_show: 240
|
Beta Was this translation helpful? Give feedback.
-
type: custom:plotly-graph
title: Forecast
offset: 1.5d
entities:
- entity: sensor.openweathermap_rain
legendgroup: 1
name: Precipitation
- entity: weather.openweathermap
legendgroup: 1
showlegend: false
name: Precipitation
line:
dash: dot
shape: spline
unit_of_measurement: mm
filters:
- fn: |-
({ meta }) => ({
xs: meta.forecast.map(({ datetime }) => new Date(datetime)),
ys: meta.forecast.map(({ precipitation }) => precipitation),
})
- entity: sensor.openweathermap_temperature
legendgroup: 2
name: Temperature
- entity: weather.openweathermap
legendgroup: 2
showlegend: false
name: Temperature
line:
dash: dot
shape: spline
unit_of_measurement: °C
filters:
- fn: |-
({ meta }) => ({
xs: meta.forecast.map(({ datetime }) => new Date(datetime)),
ys: meta.forecast.map(({ temperature }) => temperature),
})
- entity: sensor.openweathermap_wind_speed
legendgroup: 3
name: Wind speed
- entity: weather.openweathermap
legendgroup: 3
showlegend: false
name: Wind speed
line:
dash: dot
shape: spline
unit_of_measurement: m/s
filters:
- fn: |-
({ meta }) => ({
xs: meta.forecast.map(({ datetime }) => new Date(datetime)),
ys: meta.forecast.map(({ wind_speed }) => wind_speed),
})
color_scheme:
- '#1f77b4'
- '#1f77b4'
- '#d62728'
- '#d62728'
- '#7fc97f'
- '#7fc97f'
hours_to_show: 72 |
Beta Was this translation helpful? Give feedback.
-
Just upgraded to the new version and started to replace my Lambdas. I only failed replacing one of them. Now I wonder if I'm missing something, or if it might be a nice feature suggestion: However, the derivative-function of the filters seems to require a time-unit, so I can only create fixed bar charts (e.g. water usage per hour). Yaml:
Additionally, the unit seems to not work correctly for me in the derivate filter.. EDIT: Oops: If I indent the "unit:" one less, I do get a graph, but it's always hourly..? |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Is there a way to have a stacked bar beside a bar in a line chart? |
Beta Was this translation helpful? Give feedback.
-
How might I convert this
Do I read this correctly as |
Beta Was this translation helpful? Give feedback.
-
What's Changed
Instructions in the readme of the draft branch here
Full Changelog: v1.8.4...v2.0.0-beta
This discussion was created from the release Filters.
Beta Was this translation helpful? Give feedback.
All reactions