Text sensor on graphs #266
-
Describe the solution you'd like I have complex logic for several sensors that I track in in a graph. One of them is a text sensor that changes state from idle/heat/cool/off and I'd like to be able to illustrate that in a graph WITH the text. Of course I can represent that with a 1/2/3/4 step function, but knowing when that sensor changes and what the state is would be very cool. How would it be defined in yaml? type: custom:plotly-graph
entities:
- entity: sensor.monthly_internet_energy
entity_feature_config: xxx
global_feature_config: xxx Scribble I'd like to annotate the changing state on a line at the bottom of this graph: Additional context |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
Hi there 👋 here's a way of doing it: type: custom:plotly-graph
hours_to_show: 10m
entities:
- entity: sensor.teich_temperature
mode: markers+text+lines
textposition: top
text: $ex ys the
Alternatively you may want to use a bar chart instead and avoid setting the text array yourself, see this Show&Tell: #223 |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
Hi there 👋
here's a way of doing it:
the
$ex
you see there means "this is an expression", andys
just means "put the array of y values in there". See more about universal functions and expressions here. You can probably combine it withtexttemplate
to format it or just this instead:Alternatively you may want to use a bar chart instead and avoid setting the text array yourself, see this Show&Tell: #223