I’m perplexed at not finding the answer to this pretty easily. Maybe I’m not searching for the right thing.
I would like to send the log from an ESP32 running Esphome to a file, either directly or via HA or MQTT or something else. The method doesn’t matter too much but I want to collect some extended data. My device is sending a hex command via UART to a modbus slave which then returns a hex string which has bytes that change frequently. I want to gather all the hex string responses - 1 per minute - over 24 hours.
The string appears in the log for the device but how do I get it into a file or some other data collection repository?
Not on Docker, running HassOS on NUC. By commandline, I assumed you meant a terminal in HA but when I do that, I get ‘bash: esphome: command not found’.
So, I discovered that I was using the official add-on so I swapped that out for the community add-on from Frenk. I now see the ‘Protection Mode’ and have disabled it. I now get ‘zsh: command not found: esphome’
So, after a great deal of searching and reading, it seems that the official Esphome page and just about every other source references Docker installs. I cannot find anything for an Esphome install on HassOS that is running natively on Intel with no Docker.
As far as I can see, there is no esphome executable in this instance or if there is, it is hidden way back in the HassOS system. I doubt I’m the first one running up against this and yet, I can’t seem to find anyone else in the same position on the same platform.
I discovered something in the Discord chat while chasing this down. Back in early 2022, ESPhome ‘changed tracks’ and the last released version of the ‘old track’ was 2022.3.1. Somehow, I missed all the notices about this so while I was on the latest version of everything else, my ESPhome was 2022.3.1.
In that scenario, the command ‘docker exec -it {options here]’ also results in ‘command not found’ which is what I was getting. The info here was key for me. What was throwing me off is that I do have a Docker system, I just do not run Home Assistant on it. The fact that HA uses Docker in the background is probably something I knew way back when I first installed it but had completely forgotten. Regardless, until I uninstalled the 2022.3.1 version and installed the 2022.11.1 version, the command ‘docker exec -it [ ]’ failed with 'command not found. Hopefully this will be useful for someone else that finds this thread in the future. I have confirmed that the docker command works with the new version but I’m currently busy with all the device updates that the new Esphome version brought along with it.
I certainly learned something, I always do on here. The #4 post from @mulcmu was very helpful AFTER figuring out why the docker exec command wasn’t working and returning the same failure as the esphome command. That is a valuable lesson for anyone who reads this thread in the future. The issue here isn’t in whether I remembered or connected with HassOS using Docker in the back end but in that I had missed the Feb and April changelogs where the shift in Esphome track had occured. If I had been on top of that one then the docker stuff would have run. Strangely, your #2 post still fails for me for some reason but the command in post #4 succeeds. It generates a user selection in the log but not in the console and hangs until selected (I have a DeConz USB and it needs input to choose between that and the esphome api) but then runs flawlessly.
Are you having a bad day, @nickrout ? It’s not like you to be so antagonistic. I’m always grateful for your help on here and that of others.