Changing to 1 day graphs and period to hour, it can be see the bars are similar but the valors are completely illogical in plotly whereas in HA native card the have a logical value each hour
Changing to 1 month does’t change the native statistics card, as there is only dates since the 17th, but the values seem again to be logical, whereas in plotly the bars seems to be proportionally correct but the values aren’t.
state_class: total_increasing
unit_of_measurement: kWh
device_class: energy
friendly_name: Daily Self Consumed Energy
But it still shows “undefined” for the value in the name, and there is no graph displayed. I also tried to remove “statistic” as you recommended, but that did not change anything. Is there anything else that I am not getting?
One another question. For similar with my water usage, I have values in cubic meters. I display that on the bar, so I get values like “0.323”. How can I multiply it by 1000 to get “323” value instead? I am using texttemplate: '%{y}'
I have a simple plot but have been unable to disable the two-finger scroll. I’m on a MacBook and every time I scroll down on my dashboard, my plot zooms out when I scroll with two fingers with the mouse over the plot. I’ve set drag mode and scrollZoom both to false, but the behavior does not change. Any suggestions? I would like to not fully disable zooming (by fixing the axes).
Thanks
This is a very cool card that I only just discovered from your reference to my my tap_action navigate post. I installed plotly and got it working using the code above.
Ok, I found out why changing the order of the traces/entities doesn’t affect what occludes what. It is because all your entities have the same unit_of_measurement and therefore the same yaxis. In this case it looks like Plotly decides what to do itself.
The trick is to set yaxis yourself:
- entity: sensor.sensor_background
yaxis: y
type: bar
- entity: climate.sensor_foreground
yaxis: y2 # <---- here, this forces a new axis and it will be rendered on top.
You can then hide the y2 axis and force it to stay in sync with y
Thank you for your help. I placed “scrollZoom: false” under a config: section as suggested, but this did not fix my problem. Let me describe the behavior more specifically (in case this helps):
If my mouse is not over the plot area (above or below the card) and I put my two fingers on the trackpad and scroll (up, down or back and fourth) the behavior is as expected (no zooming). I can scroll past the Plotly card up and down with no problems as long as I don’t take my two fingers off the trackpad and as long as they are initially placed on the trackpad when my mouse is NOT over the plot.
If the mouse is IN the plot area (so the mouse curser is a “plus”) and then I put my two fingers on the trackpad to scroll up or down, the plot will zoom in or out. The display also scrolls up or down even to the point where the mouse will no longer be over the plot. As long as I keep my two fingers on the trackpad, the plot will also zoom while I’m scrolling, even if my mouse has moved completely off of the graph.
Not sure if there’s any way to fix this, but here is my code:
type: custom:plotly-graph
disable_pinch_to_zoom: true
layout:
config:
scrollZoom: false
margin:
r: 75
dragmode: false
legend:
orientation: h
xanchor: center
x: 0.5
entities:
entity: sensor.deye_sunsynk_sol_ark_pv_power
name: Solar
fill: tozeroy
line:
color: gold
filters:
I am using an expression to calculate a range for a y-axis, because I need to exclude a trace. I use getFromConfig(entities) to get the traces, then find min and max for the desired traces.
Can I somehow detect which traces are shown? (Enabled or disabled in the legend)