Use SD card to log sensor data in the case of wifi loss

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.