-
I have a cover and want to plot the position. But when the cover is not used for some time it goes into sleep mode and doesn't send any values. Somewhat like in Excel (handling missing data) https://www.nurturetechacademy.in/how-to-handle-missing-data-in-excel-charts/
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
filter the unknown/unavailable with a lambda: entities:
- entity: sensor.mysensor
lambda: |-
ys => ys.map(y => +y) The way this works is that when your cover goes to sleep, HomeAssistant will store a datapoint with "unavailable" as its value. Then the + (plus symbol) in the lambda will make javascript try to cast (convert) it to a number, and the javascript will treat the string "unavailable" as "not a number" or NaN. Finally, Plotly should discard those NaNs. If this doesn't work, let me know and I'll help you filter those more explicitly |
Beta Was this translation helpful? Give feedback.
filter the unknown/unavailable with a lambda:
The way this works is that when your cover goes to sleep, HomeAssistant will store a datapoint with "unavailable" as its value. Then the + (plus symbol) in the lambda will make javascript try to cast (convert) it to a number, and the javascript will treat the string "unavailable" as "not a number" or NaN. Finally, Plotly should discard those NaNs.
If this doesn't work, let me know and I'll help you filter those more explicitly