Hi everyone.
Im trying to log a simple ADC reading into a SD card, as a backup in case the Wi-Fi signal is lost. Is there a way to achieve this with ESPHome?
Thanks in advance.
Hi everyone.
Im trying to log a simple ADC reading into a SD card, as a backup in case the Wi-Fi signal is lost. Is there a way to achieve this with ESPHome?
Thanks in advance.
Not really - although there has been some chatter about it on the ESPHome GitHub over the years.
This is one such - there are others:
Tasmota has support for sd card. It worked immediately for a sparkfun esp I have with built-in card reader. Scripting is required to write data to the card. I am not good enough to do that yet, but I know it can be done.
And this is how you can do it with Arduino.
For what? HA does not accept “old” data…
Is that the case? Hmm. Thats a pity. Iam currently search a solution for a mobile temp data logger and upload its history to HA when reconnected to wifi.
Why? You need to log temp data and need it in HA? You need to add historical temp data to HA? Is there an interesting reason why or is this the ever frequent HA OCD popping up?
If the data was actually important then why not store it off HA and convert your HA data plus the mobile data to something like CSV and store it? Just seems silly to add historical data after the fact to HA and temp data at that.
The Reason: Two things recording critical data independently(SD card text file on the device and HA text file and historical data). For example I have a datalogger on the gas pressure because of an incident from the propane company that destroyed my water heater and furnace gas control valves and filled my basement with propane. At the time (before I built the datalogger), I was unable to prove they broke my equipment because of improperly filling my tank. After spending $2000 on new water heating equipment and furnace parts. I built the following: I have a data logger on the gas line, one security camera pointed at the propane tank, a door sensor that triggers the homes gas valve to close any time the lid is open, and a notice that the owner must be present during fill-up. I also have my account flagged at the propane company “no unsupervised fill-ups - guard dog on property” even though I do not have a dog. So i have time stamped data proving precisely what time they broke my equipment next time they fill my tank unannounced. Should be easy to prove my case if it would go to court.
There many metrices which are worth to record during HA absence eg. car driving parameters. Another example is utility voltage meter saving exact outage timestamp - again HA might be unavailable at this very moment just because this outage. ESPHome device can be easily battery powered especially for that purpose.
I found custom made component sd_mmc_card written by Nicolas Serrette which supports writing and reading from SD card.
I’ve tested this with esp-cam module. (Which can be handy as compact board having SD card slot)
These might help…
sdmmc - Allows SD card access from esphome.
webdav - Allows access to the sd card from networked computers (saves having to remove the sd card to get to the contents)
The question was recording data during wifi outage which is different than a HA offline.
HA isnt necessary at all for Esphome to be used and to its fullest potential. It was made to be run as an independent environment from the beginning and never has and likely never will require a HA server paired with it.
No HA has no impact on its abilities to communicate wirelessly which is why OP wasnt asking about HA going offline, it just doesnt matter.
That sounds like an individual OCD issue there. Cant say ive ever come across someone during my 40 yesrs on earth that put a high importance level or any importance at all to logging car driving parameters.
Having a precise timestamp for a power outage is right up there with driving parameters in importance and if it were for some reason important then its not hard to find out when ine happened because every single entity in HA will show when it went Unavailable as well as nearly all digital clocks in someone’s house so, IDk… It’s not a problem I would consider that needs solved or even a problem at all if someone possess common sense.
As i already said, the issue wasnt HA being unavailable or even a specific problem like a power outage. There’s many reasons HA or someone’s home wifi could become inoperable, such as a hardware failure…
Just because you haven’t met anyone who considers something important does not mean no one considers it important. For this example I know that race car drivers (and probably wannabes) definitely want to know ALL about car parameters and likely in real time.
https://www.autosportlabs.com/shop/racecapture-mk3-apex/
I know people who have been doing this for decades. I was interested in it, but it never got around to actually doing it.
Ya, im sure rocket scientists do too… Try to stay focused here bud, we are talking about data relevant to HA. Race car performance metrics wouldn’t be something id consider relevant to anyones smart home system just like it wouldn’t make sense to track your space ship engine thrust data into HA and log it there.
I didnt say there’s no scenario where any data isnt worth storing or charting. I thought that since this is a smart home forum it was common sense that we werent talking about nonsense examples and instead they would be applicable to a smart home system.
This is the OP
There is nothing about Home Assistant in there. I, for one, don’t use any of my esphome devices with Home Assistant and there is nowhere (that I read) that it says you must. There is also nothing that says you MUST use esphome ONLY for home automation.
The question, which you seem to think is worthless (based on your responses), is a very valid one for some use cases. If this is a use case that doesn’t interest you, feel free to ignore this thread. I happen to be interested in this very question, so I am here to learn and help in any way I can.