Plot arbitrary data #26
Replies: 3 comments 2 replies
-
Just sharing my example: type: custom:plotly-graph
refresh_interval: 10
layout:
yaxis:
scaleanchor: x
scaleratio: 1
entities:
- entity: vacuum.robutt::position
lambda: |-
(ys) => (
{
x: ys.map(y => y.replace('(','').replace(')','').split(',').map(Number)[0] ),
y: ys.map(y => y.replace('(','').replace(')','').split(',').map(Number)[1] )
})
line:
width: 3 This plots the location of my roomba (from the Home Assistant Roomba integration). I believe the attribute produces data like "(x,y)", hence the It would be nice to have the colour fade out or change as the data gets 'older'. |
Beta Was this translation helpful? Give feedback.
-
without lambdas: type: custom:plotly-graph
hours_to_show: current_day
layout:
xaxis:
type: number
autorange: true
entities:
- entity: ""
x: [25,25,25,25,25,26,27,29,30,32,34,36,37,39,40,40,40,40,39,38,37,35,33,31,29,28,27,26,25,25,25,25,24,24,24,24,23,22,21,19,18,16,14,12,11,10,9,9,9,9,10,12,13,15,17,19,20,22,23,24,24,24,24]
y: [25,25,25,26,27,28,30,31,31,31,31,31,30,28,27,25,23,21,19,17,16,14,12,11,9,8,6,5,4,3,3,3,3,3,4,4,5,7,8,9,11,13,14,16,18,19,21,23,25,27,28,30,31,31,31,31,30,29,28,27,26,25,25] or you can use $ex or $fn if you want to generate the data points procedurally |
Beta Was this translation helpful? Give feedback.
-
Hey there, found this while looking for a method to make a bar plot of the hourly average of the power used over the 24 hours of a day. My idea was to plot 24 bars with the average of the hour as x data (arbitrary) and y would be the average of the wattage used in the hour averaged over the last 30 days (month). While I got the x data quite easily set-up, I have my troubles to get the y-values in. The data is no stored in 24 sql-sensors that evaluate said wattage data directly from the HA database. The method you show in the initial post does not allow the data to be the state of the sql sensor. At least I couldnt figure out how to do it. Since I am not really a programming guy there might be a method, but I didnt understand it from what is in the documentation and the examples given on your github. If there is any advice you can give or any pointers on where to look and what to do, I appreciate it. Thanks in advance |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
All reactions