Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 102819

Memory leak when using Google Calendar and location in an automation

$
0
0

Hi
Relatively new to HA - about 3 weeks in.

HA Core - v2022.4.6
Synology NAS Docker install : Low-pri CPU + 2048Gb RAM assigned
Nothing too much integrated yet. Still feeing it out before I commit to a Pi4 build.

I had an issue recently during a late night session where my docker container was crashing due to memory full and then auto-restarting.
Initially I thought the issue was due to a typo in the raw config editor (as I shared here), but the next day I had a load of emails waiting for me from my NAS telling me that HA had been crashing every 30 minutes overnight.

Last night it started doing the same. Emails and I could see it fill up the RAM within 15 mins, slowly become unresponsive and then crash at about the 30minute mark. “Why is it only doing this at night?” … and then I realised what it may be.

The pattern seemed to follow an automation I have that triggers every /10 to re-activate my phone’s charger when the battery level dips below 93% but only when my calendar is set to “sleeping”.

As soon as I de-activated that Automation and reset my HA that it stopped. CPU load is back down and RAM back to reasonable numbers.

The only thing different in this automation compared to the others I have for my phone charging on/off is the use of the Google Calendar in this one automation as well as (“is_home”).
It’s weird 'cos this was one of the first automations I’d set up about 10 days in (preventing battery overcharging as my motivation to start HA)

The calendar itself seems to be fine. I followed SlackerLabs YT guide on integrating it into my HA and it updates quickly and the card on my homepage works fine too. I don’t use search or offset features in the google_calendars.yaml as I don’t do all day events there. Just as a trigger for events for tasker to automate different profiles on my phone.

Some screenshots below for reference

No-one likes to see this in the morning :frowning:
Home_Ass_overnight_memory_munching_0

Next night and it’s happening again. RAM full for 10 minutes and counting…

After disabling the automaton and it’s still happy No emails:

Here’s the automation (edited to remove phone ID and real calendar name)

`alias: MyPhone Sleeping Recharge Top Up
description: ''
trigger:
  - platform: time_pattern
    minutes: /10
condition:
  - condition: state
    entity_id: calendar.schedulingcal
    state: 'on'
  - condition: state
    entity_id: calendar.schedulingcal
    state: Sleeping
    attribute: message
  - type: is_battery_level
    condition: device
    device_id: 12345678901234567890123456789012
    entity_id: sensor.myphone_battery_level
    domain: sensor
    below: 93
  - condition: device
    device_id: 12345678901234567890123456789012
    domain: device_tracker
    entity_id: device_tracker.myphone
    type: is_home
action:
  - service: script.myphone_master_recharge_on
    data: {}
mode: single`

2 posts - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 102819

Trending Articles