3.5.X Update to Variables+History has broken working variables

An update of Variables+History under HACS has caused my temp and rain tracking to break. I have the latest version and I can’t seem to fix what I have. I have created new variables under the new version and I just need an example for me to modify the automations to set the variables again.

I run an automation whenever the temperature changes in order to maintain current temp, max temp, min temp, and current rain for the day.

I also run a midnight automation to save the current day’s values as the previous day’s values for display

here is the first thing that has to be done when the weather station changes temp

entity id is sensor.hacs_curtemp and it needs to be set to the value that came from the weather station sensor. sensor. hacs_curtemp is defined as a number with an initial value of 255. I also have hacs_curtemp set as the name of the variable. All of my defined variables are showing as 255 in the main diosplay.

data:

value: ‘{{ states(’‘sensor.kwakenmo81_temperature’‘) | float(1) }}’

action: sensor.hacs_curtemp

I am guessing I am missing something easy, but I can’t seem to find any samples that work once I change the sample variable to my defined name. Any insight from someone? Thanks!

You did not format the code properly for the forum so we cannot see what is truly there. But if you have the smart quotes in your real template, then the template will not work. Disable smart quotes on your keyboard settings and replace all the quotes with normal ones.

Out of curiosity, what does that integration do that isn’t already handled by the Template integration?

Did you try the one’s in the repo…?

I actually figured I had it formatted wrong which is why I asked the question. I do not have smart quotes turned on and had to look up what they were in the first place. I realize the column position is not there. The text I put in the question is contained in an action for the automation. The code does not set the variable and there is no error. I can format the lines in HA and the concept had worked until a recent update.

if you mean variables in general, I need persistence of variables through out the automations and the display that shows me today’s temps and yesterday’s temps. I had been using the hass-variables just fine until a recent update. My variables stopped working, so none of then would change and be remembered. It is my understanding that HA variables that were added are not global.

In the forum the quotes shown are changed by smart quoting (some quotes are upside down) so unless the forum changed them, they are wrong.

then the forum changed them. They worked in the automation before. Frankly, the character was not a curled quote as you had in your message before. ’ ’ ’ ’ " " " " the following two groups of four quotes are normal as I type them…

variables are still not working as expected. I have an automation that is triggered when there is a temperature change. Every change updates a variable called currenttemp. That works perfectly. I do an Update_Sensor_Variable of curtemptemp set by a new value from the weather station ‘{{ states(‘sensor.kwakenmo81_temperature’) }}’ This was all done if the UI. I add an “If” action, so I can save the high and low temps during the day. The low temp “If” is checking if currenttemp is below variable mintemp. No matter what I do (i have tried a lot of variations), the code fails due to entity states I guess. The “If” is If Variables+History mintemp is above Variables+History currenttemp (entity to entity).
I get the following trace and yaml code follows.

if

Executed: August 25, 2026 at 15:02:26
Result:

result: null

if/condition/0

[If Variables+History currenttemp is below Variables+History mintemp]
Executed: August 25, 2026 at 15:02:26

Error: In ‘numeric_state’: In ‘numeric_state’ condition: entity sensor.hacs_currenttemp state ‘‘87’’ cannot be processed as a number

if/condition/0/entity_id/0

[If Variables+History currenttemp is below Variables+History mintemp]
Executed: August 25, 2026 at 15:02:26

Error: In ‘numeric_state’ condition: entity sensor.hacs_currenttemp state ‘‘87’’ cannot be processed as a number

entity: sensor.hacs_currenttemp

yaml

if:
  - condition: numeric_state
    entity_id: sensor.hacs_currenttemp
    below: sensor.hacs_mintemp
then:
  - action: variable.update_sensor
    metadata: {}
    data:
      value: '''{{ states(''sensor.kwakenmo81_temperature'') }}'''
    target:
      entity_id: sensor.hacs_mintemp

the conditional IF yaml is:

condition: numeric_state
entity_id: sensor.hacs_currenttemp
below: sensor.hacs_mintemp

Coding in C, C#, assembly made sense. This doesn’t to me… Each sensor is supposed to be a variable, so comparisons should be easy. Any help pointing me to a solution would be great. Thanks!

I did contact the developer with the issue I was having. I eventually took his information and finally resolved my issue. The one caveat for me I would mention is that the HA UI automatically thinks everything is string. I inadvertently set a variable to be a text string of the number I had, so ever where it was used wouldn’t work. I had to create the UI version of what I wanted and then go back into YAML and fix all of the variable references by deleting apostrophe characters. It is all working now, but it was not easy getting here.