My automation keeps crashing HA & Runs Out Of Memory need help

so i made an automation for when you toggle home (none) to away (away) for the thermostate… it used to work in previous HA os but i noticed its not working…
i needed to build a work around with the generic thermostate as its missing features for away and such…
so i have 2 file reads for Away (away) and Home (none)

now in my automation its supposed to read the toggle and then choose whatever setting its set to away or none… well now it crashes HA i added extra action to force the Button to away or none as for whatever reason when you Press Away it seems to run but it wont set the Switch to Away it keeps it on None like your at home… and doesnt switch … turn off the automation and it toggles fine… so whatever wrong in my automation does toggle the switch anymore

alias: "!!test"
description: ""
triggers:
  - trigger: state
    entity_id:
      - climate.moms_furnace
    attribute: preset_mode
conditions: []
actions:
  - choose:
      - conditions:
          - condition: state
            entity_id: climate.moms_furnace
            attribute: preset_mode
            state: away
        sequence:
          - action: climate.set_temperature
            metadata: {}
            data:
              temperature: "{{states('sensor.away_temperature_house') }}"
            target:
              entity_id: climate.moms_furnace
          - action: climate.set_preset_mode
            metadata: {}
            data:
              preset_mode: away
            target:
              entity_id: climate.moms_furnace
      - conditions:
          - condition: state
            entity_id: climate.moms_furnace
            attribute: preset_mode
            state: none
        sequence:
          - action: climate.set_temperature
            metadata: {}
            data:
              temperature: "{{states('sensor.home_temperature_house') }}"
            target:
              entity_id: climate.moms_furnace
          - action: climate.set_preset_mode
            metadata: {}
            data:
              preset_mode: none
            target:
              entity_id: climate.moms_furnace
mode: single

this is what i normally have minus the added code above

alias: "!!test"
description: ""
triggers:
  - trigger: state
    entity_id:
      - climate.moms_furnace
    attribute: preset_mode
conditions: []
actions:
  - choose:
      - conditions:
          - condition: state
            entity_id: climate.moms_furnace
            attribute: preset_mode
            state: away
        sequence:
          - action: climate.set_temperature
            metadata: {}
            data:
              temperature: "{{states('sensor.away_temperature_house') }}"
            target:
              entity_id: climate.moms_furnace
      - conditions:
          - condition: state
            entity_id: climate.moms_furnace
            attribute: preset_mode
            state: none
        sequence:
          - action: climate.set_temperature
            metadata: {}
            data:
              temperature: "{{states('sensor.home_temperature_house') }}"
            target:
              entity_id: climate.moms_furnace
mode: single

so the 2nd one used to work but it doesnt it just crashes

if i set the trigger for preset away and just run the away it will set the temperature but it wont toggle the switch it will stay on Home(none) so its not letthing the switch toggle… but it used to work

Hello comet424,

Can you elaborate on that more?
There’s a range there from it corrupts my database all the way to it drops out and does nothing.

Looking at a trace will help you diagnose what is stopping it.

Related, is none actually a state of this attribute ever? I mean you are triggering when that attribute changes, and none is a bit unusual as an actual state…

so what happens is when i set to 4gigs of ram it ran out of memory … as i run it in a VM

i bumped it to 8gigs ram

so when you press the Away button it doesnt toggle… and HA crashes instantly as the connection says connection retrying or so so i loose connection to the HA but the console i still see working but commands dont wanna work right…

i trigger both none and away… so when its away it forces the away temperature as the target temp… when you set it to none then it sets the target temp to home

i do this because the generic thermostat has a few glitchs in it so i made a work around for it

so i write to a file and use the notification to export the Away and None (Home) temperatures
then i use the FILE intergration to read the value Home (none) and Away (away) values and when you reboot HA whatever mode your in it also sets the temp from the file

but the toggling doesnt work now when it used it… and its like crapping out

Let me guess, Code Server addon / VSCode is running all the time. Start out by only running this when you are using it to save over a gb of memory,.

You will also get a much better response at this point if you change your title to talk about running out of memory and not an automation won’t work.

1 Like

ya the code server i let it run all the time. as i just let everything run on its own i only noticed issue cuz oif the automation not working when i couldnt toggle and then i saw the console saying out of memory

and ok ill change topic now

1 Like

so ya when i run my automation it crashes HA and the screen just pops up connection lost: reconnecting

but it never reconnects

i type in the console
core restart
and it just sits at processing but never actually reboots HA

I reboot the VM just to get it to work again

Well let me know if I understand correctly your automation:

  • each time there is a change in the preset_mode of the climate entity, the automation triggers.
  • then you test if you are in “away” or “none” preset_mode to set the temperature in the corresponding mode…
    Correct sofar ?

But what I do not understand is why you are forcing the preset_mode to be “away” or “none” in the code while the condition for the code to run is that the preset_mode is already in “away” or “none” state…

It seems also that you have more automations associated with this one… Maybe good to share the full code… The problem is maybe between two automations written to achieve what you are looking for…

For me, it seems that something is crashing the supervisor…

each time i change from the Preset Away to None it then reads the sensor value from away_temperature_house and sets the target_temp to that value… when you choose None (Home) then it takes the value from sensor home_temperature_house

but when you press the button away… it instantly crashes … it was working in the previous update of HA as you could go back and forth away and the away button toggle… but right nwo it defaults to none(Home) and u cant switch to away. and then it instantly crashes HA or locks it up only the console works somewhat

so for the Toggling the automation is below i used to have it in 2 automations but made it into 1…

alias: "!!test"
description: ""
triggers:
  - trigger: state
    entity_id:
      - climate.moms_furnace
    attribute: preset_mode
conditions: []
actions:
  - choose:
      - conditions:
          - condition: state
            entity_id: climate.moms_furnace
            attribute: preset_mode
            state: away
        sequence:
          - action: climate.set_temperature
            metadata: {}
            data:
              temperature: "{{states('sensor.away_temperature_house') }}"
            target:
              entity_id: climate.moms_furnace
      - conditions:
          - condition: state
            entity_id: climate.moms_furnace
            attribute: preset_mode
            state: none
        sequence:
          - action: climate.set_temperature
            metadata: {}
            data:
              temperature: "{{states('sensor.home_temperature_house') }}"
            target:
              entity_id: climate.moms_furnace
mode: single

and then my 2 other automations for what HA Boots up

alias: Furnace - Set Furnace Target Temperature - Away Mode
description: ""
triggers:
  - trigger: homeassistant
    event: start
conditions:
  - condition: state
    entity_id: climate.moms_furnace
    attribute: preset_mode
    state: away
actions:
  - action: climate.set_temperature
    metadata: {}
    data:
      temperature: "{{states('sensor.away_temperature_house') }}"
    target:
      entity_id: climate.moms_furnace
mode: single
alias: Furnace - Set Furnace Target Temperature - Home Mode
description: ""
triggers:
  - trigger: homeassistant
    event: start
conditions:
  - condition: state
    entity_id: climate.moms_furnace
    attribute: preset_mode
    state: none
actions:
  - action: climate.set_temperature
    metadata: {}
    data:
      temperature: "{{states('sensor.home_temperature_house') }}"
    target:
      entity_id: climate.moms_furnace
mode: single

and ir your asking why i tellin the automation to force the button to away or none

is because when you click on away… it would do nothing or just pop the value from the file… but it would still only state in none mode… it wouldnt flip to away mode… so i tried forcing it… but right now it just keeps crashing

theres a new core update i wonder if i should update it now and re test if it crashes

the only reason i noticed a problem is my furnace was supposed to be set to away mode for a week and i had updated HA forwhatever happened when HA rebooted or so it set itself to Home(none) and i tried to set it to away and thats where i find it crashing or running out of ram when i had it at 4 gig of ram… but it was working a update or 2 ago which update like core os supervisor i not sure but was working a week and half ago but in mean time i did update tthem

upgraded just now to core 2025.2.2 and i re tested… it hasnt crashed

but when you press the not home button it doesnt put the not home temperature in… it puts in the home temperature and stays on none(home) so it wont toggle to away

as you can see in my video it doesnt set to the away sensor value cuz it wont toggle over to away… it will toggle heat and idle on the preset away and it only puts in the home sensor temperature value not the away… it used to work now it wont and i had them in 2 seperate automations to toggle from none to away and away to none
here is my one drive link to the video
https://1drv.ms/f/c/2759db01e8e27b46/EqrInQquK59AlRz6mJ-MnGQB12iMNBwd7JYZQM1-wOECSA?e=zoviYa

as you can see why i had the force the toggle over to away or to none cuz its not flipping on its own anymore when the automation is running if you disable it… then the toggle switch works but then loads from the preset away and not from the file

here is the automation just to go from none to away… i just turned off the other one and just enabled a single automation

alias: "!!!test again"
description: ""
triggers:
  - trigger: state
    entity_id:
      - climate.moms_furnace
    attribute: preset_mode
    to: away
    from: none
conditions: []
actions:
  - action: climate.set_temperature
    metadata: {}
    data:
      temperature: "{{states('sensor.away_temperature_house') }}"
    target:
      entity_id: climate.moms_furnace
mode: single

here is the video if trying to run automation from none to away… as you can see it sets it ok the temperature but it wont toggle to away mode so it keeps it on none so you cant get it off home and set to away
https://1drv.ms/f/c/2759db01e8e27b46/EgwPcEHttgpKr7Qza42sT6ABWic611f2njw844Ryxumppg?e=IOP6DQ

@browetd any idea from the videos i uploaded for ya to demostrate on the automation code… as it used to work and now it doesnt

or is this a bug i need to report in the supervisor or core or whatever on the githubs?