Skip to content

How to make continuous lines for missing values? #44

Answered by dbuezas
Photelegy asked this question in Q&A
Discussion options

You must be logged in to vote

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

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Photelegy
Comment options

@macbih
Comment options

@dbuezas
Comment options

@macbih
Comment options

@dbuezas
Comment options

Answer selected by dbuezas
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants