hmm, dont think there’s a way for me to get all of those commands in terminal within 1 minute from restart…you’re right… cant do that in some predefined script can we?
ssh [email protected] -p 22222
docker exec -it homeassistant /bin/bash
Top (to get pid for homeassistant)
cd py_spy-0.3.12.data/scripts
./py-spy record --duration 120 --rate 100 --pid 61
using anchors in dashboard files has always worked nicely, especially when making a mistake… it would simply state things like ‘missing anchor’ or ‘anchor not defined’ Not exactly sure.
And, it did show the card yaml in a placeholder in the Dashboard view.
With the new yaml checker however, this turns into a cryptic:
just noticed these once more, not sure off we already took it off the list of possible optimizations:
2022-07-11 10:12:13.552 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2022-07-11 10:12:13.563 INFO (MainThread) [homeassistant.setup] Setting up group
2022-07-11 10:12:13.897 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2022-07-11 10:12:13.915 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2022-07-11 10:12:13.915 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2022-07-11 10:12:13.915 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
2022-07-11 10:12:13.923 DEBUG (MainThread) [homeassistant.setup] Dependency template will wait for after dependencies ['group']
happening midway startup…
even though group itself is not taking very long:
2022-07-11 10:12:16.091 INFO (MainThread) [homeassistant.setup] Setup of domain group took 2.5 seconds
Confirming the groups being of importance for those numbers in the integration startup list (btw. notice this is the first time an MQTT logging of below 100 secs happened):
Just an FYI you don’t actually have to set up host ssh for this task. If you install the ssh & web terminal addon and disable protection mode then you can access the docker cli and follow the rest of the steps from that.
Important: this is the ssh addon in the community addons repo, not the ssh addon in the official addons repo. You cannot access the docker cli from the ssh addon in the official addons repo.
Yes, I am aware, but as stated in above instructions: one can not copy&paste in the add-on.
Since these commands are a pain to type, I wanted to copy and paste them.
In the config of both addons you can expose the ssh port on the host via the network options on the configuration tab. Then you can use it over ssh from a terminal on any machine. Just like with the host ssh.
I’ve never used the web UI of the ssh addon tbh, I always forget it exists
yes, but I am not sure why you say this now. Did I make a mistake above in the listing of actions required? I am using an external terminal to do all this, so no issue there.
sorry if I misunderstand what you’re saying Mike.
Well I noticed you linked it around discord and places. Which makes sense, it is a pretty complete guide. I was thinking if you are going to keep linking it you might want to update it to use the Community SSH addon approach instead of recommending setting up host SSH. Mostly since its significantly easier for others to do that. No formatting a USB drive and restarting required, just a few clicks from the UI.
@bdraco any chance you can look at my svg files and help me narrow down the issue? My pi4 usually has very minor load and sometimes could be after a day could be after a few hours it really spikes and stays high the only fix is to restart the HA container. There is nothing in the logs at that time either, so I am pretty stumped. I included py-spy svg snapshots for when I have good usage and bad. I suspected it was MQTT but reloading it didn’t solve the issue.
Thank you soo much!
bad cpu usage svg snapshot: https://secure.fabriceleven.com/g23hio+
good cpu usage svg snapshot: https://secure.fabriceleven.com/V8AQnu+
Can you get an strace -p <pid> -f -s4096 -o /config/spin.log ?
You may have to run apk install strace
Don’t post it though as it could happen to read a file with sensitive data when its logging. PM me and I’ll send you my dropbox or google address so you can share it securely.
Hi
sure about the parameter for the PID? 61 is the PID of the parent process for homeassistant, you are likely trying to get information for PID 64 with py-spy? py-spy top --pid 64
Edit: this worked for me too, uses pgrep to dynamically find the the pid for the “hass” process started by user “homeassistant” (if I recall correctly): sudo py-spy top --pid $(pgrep -u homeassistant hass )
Armin
and just to be sure the guide was still accurate I dd test the exact same commands, and no errors appeared.
are you sure you have the correct pid, and file installed?
(I take it the docker exec went ok given the command prompt, and the folders are there too, given no cd error was displayed)