Hi, thanks for responding so fast. I’ve tried your suggestion but the code only seems to spit out what im putting in. Other than that i have no idea where i can define On = 1 and Off = 0
transform: "return x === 'on' ? hass.states['binary_sensor.boiler_burner'].state : 5;"
OK, so you are doing it differently from me. Did you check the pictures from my link (to my post above)?
You want to show how many hours in any given day (and a binary_sensor cannot do that). I was showing when it is on and off (and a binary sensor can do that).
Hey!
What @jchh wrote is exactly how I do it too. Make sure that on vs ON capitalization. You can find it in the Developer Tools while looking at current state, it shows there as plaintext.
I have it similarly:
- entity: sensor.valve_operation
name: DWH heating
type: line
curve: stepline
color: blue
stroke_width: 2
opacity: 0.8
transform: 'return x === ''ON'' ? 2 : 0;'
yaxis_id: first
show:
in_header: false
legend_value: false
Note that double quotes around ON are put automatically while saving, and for Column type of entity it does not take into account length of operation. Stepline to the rescue.
Let us know how it goes!
I’m building a graph for my electric water heater. I have 3 entities; water temperature, power usage and energy used. I would like to graph all 3 in the same graph.
The problem with energy used is that it’s an ever growing number. Is there a way I can offset the energy value with the first value of the graph. So energy will always begin at 0 kWh at the begining of the graph and raise as I see the power bars.
If you also have a trick for showing the power bars as a percentage, but keep showing the real value. The power draw is 4000 w and shown next to the temperature of 60 something create a useless graph. So I found how to convert it to percentage, but real values would be better.
Note: The graph is showing energy usage of an other sensor, as an example of the problem, the one for the electric water heater is brand new and was showing the graph correctly until the energy value gets too high.
Not sure why your number is wrong, but I had a similar setup and was getting weird results also until I combined the “today” and “tomorrow” into one entity.
I have a working setup that shows Nordpool electricity prices for today and tomorrow. Because I’m unfamiliar with ApexCharts, I’m mostly copypasting other people’s work. I want the chart to show the actual total price including the electricity suppliers margin and the grid company’s transfer price in addition to the spot price.
My current solution is to just add the values like this ("+0.4+2.81"):
That works but it’s not a proper solution since I’d have to remember to change those in the chart settings if the prices change. I have helper values in Home Assistant for those prices and I’ve also got a sensor.electricity_additions_total that returns the sum of those. I use these elsewhere in the system.
I’d like to replace the “+0.4+2.81” part with fetching the value from the sensor so that I could manage the prices only in the helper values but can’t figure out how to do it. Any help for a newbie is highly appreciated!