Remove dips in a history graph

Hi, I have a slightly irritating problem that I can’t get rid of…

Every time I reboot my HA I get a value from the adjusted sensor showing like a “dip” in the graph, and I wonder if there is a way to remove this “dip” from my graph?

Template looks like this (sensors.yaml):

   - platform: template
     sensors:
       grund_humidity_adjusted:
         friendly_name: "Källargrund Fukt"
         unit_of_measurement: '%'
         value_template: "{{ states('sensor.199_humidity')|float - 5 | round(1) }}"
       basement_n_humidity_adjusted:
         friendly_name: "Källare N Fukt"
         unit_of_measurement: '%'
         value_template: "{{ states('sensor.183_humidity')|float - 5 | round(1) }}"
       basement_s_humidity_adjusted:
         friendly_name: "Källare S Fukt"
         unit_of_measurement: '%'
         value_template: "{{ states('sensor.96_humidity')|float + 2 | round(1) }}"

Any help is greatly appreciated.

Kind regards:
// Flagg

You won’t be able to without pulling the previous temperature. On startup, your sensors aren’t ready. When this happens your equations will return a sensor value of 0 and it will be reported. You can attempt to wrap your templates in an if statement so that the template returns a blank value. Not sure how that will impact the graph result though.

Also, as a side note, that round function is doing nothing to your whole value. It’s only affecting the subtracted or added number. filters work like order of operation in math. So your templat is subtracting a rounded 5 from your sensor value. Better put those in parenthesis.

   - platform: template
     sensors:
       grund_humidity_adjusted:
         friendly_name: "Källargrund Fukt"
         unit_of_measurement: '%'
         value_template: >
          {% if states.sensor.199_humidity is defined %}
            {{ ( states('sensor.199_humidity')|float - 5 ) | round(1) }}
          {% endif %}
1 Like

Thank you, I will look into this according to your tips.

// Flagg

You might want to check the Filter Sensor which allows a few ways of dealing with spurious values:

@Bit-River, Awesome, I did not know about that !

I think that will give me just what I want, thank you very much.

// Flagg