I’d like to use a mini graph (and the display options it offers) for a sensor that is (always) returning a negative value. I’m not sure how to go about converting the value in the mini graph yaml to a positive one before it is then displayed on the graph. It probably really simple - and I have found the following code in a similar question - but the answer didn’t state quite where this code goes and I’m very new to coding!
sensor:
- platform: template
sensors:
sensor.myenergi_harvi_10312221_storage_ct2:
value_template: "{{ (states('sensor.fronius_house_load') | int) | abs }}"
The mini graph yaml currently looks like this:
type: custom:mini-graph-card
entities:
- sensor.myenergi_harvi_10312221_storage_ct2
name: Water Tank Heating from Solar
show:
labels: true
color_thresholds:
- value: 20
color: '#0ffc03'
- value: 100
color: '#fcd703'
- value: 500
color: '#fc0320'
Thanks