SD Card Corruption Problem? Couple Tips

If your windows machine has enough power and is on all the time should work. For windows I would try this (link below) to make it much easier or run it in Docker on windows. I have no real experience with it though. It does bundle everything you would need together.

Also I followed this link to setup on my Synology NAS but I now run in Docker on my NUC. Except for actually installing the Maria DB and phpMyAdmin the rest of the setup should be pretty much the same.

It looks like I’ll try other items before going down the external database route. I changed my config to reduce the amount of writes to the database. We’ll see how it goes. I now have this:

recorder:
  include:
    domains:
      - lock
      - climate
    entities:
      - sensor.jeremy
      - sensor.nichole
      - sensor.tim_visiting
      - sensor.mike_visiting
      - sensor.paula_visiting
      - group.presence_trigger
      - input_boolean.on_vacation
      - sensor.house_locked
      - sensor.doors_closed
      - sensor.water_leak_status
      - sensor.grill_detector
      - sensor.fireplace_detector
      - switch.watercop_valve
      - sensor.water_valve_status
      - group.shop_lights
      - fan.finishing_room_exhaust
      - sensor.basement_average_humidity
      - sensor.shop_average_humidity
      - sensor.garage_multisensor_temperature
      - sensor.garage_multisensor_humidity
      - sensor.front_door_deadbolt_last_action
      - sensor.garage_door_last_action
      - sensor.deck_door_deadbolt_last_action
      - sensor.basement_door_deadbolt_last_action
      - sensor.front_door_last_code
      - sensor.garage_door_last_code
      - sensor.deck_door_last_code
      - sensor.basement_door_last_code

# Enables support for tracking state changes over time
history:
      
# View all events in a logbook
logbook:

What did you exclude?

Mine is more like this…

recorder:
db_url: mysql://root:redacted@redacted
purge_interval: 1
purge_keep_days: 4
include:
entities:
- device_tracker.faiths_cell
- device_tracker.vins_cell
- group.all_devices
exclude:
domains:
- automation
- weblink
- updater
- sensor
- scene
entities:
- sun.sun
- binary_sensor.anycubic_i3_printing
- binary_sensor.anycubic_i3_printing_error
- binary_sensor.dome_motion_detector_sensor_2

I excluded EVERYTHING that is not on the include list.

From the recorder doc (note the part that says: If set, all other entities will not be recorded.):

include
(map)(Optional)Configure which components should be included in recordings. If set, all other entities will not be recorded.

domains
(List)(Optional)The list of domains to be included in the recordings.

entities
(List)(Optional)The list of entity ids to be included in the recordings.

Basically it breaks down into 3 categories based on what you put in your config:
include only → excludes everything not on the include list
exclude only → includes everything not on the exclude list
include & exclude → 3rd option that I don’t 100% understand.

In the documentation they give a specific example that does make sense. Basically goes like this:

Include the domain “sensor” for example. Let’s pretend you have 100 sensors, but only want to keep 99 of them. You could then EXCLUDE a specific entity. Note this case includes the domain and then excludes entities within the domain.

I’m not sure what happens if you include some domains AND exclude other domains at the same time. It seems like you end up with a contradiction. (include causes unspecified items to be excluded and exclude causes unspecified items to be included this leads to the unspecified items being both included and excluded) Hopefully that makes sense.

I’m not sure I quite got what the documentation is saying either but I’m happy with what shows up in my logbook and I know a bunch of stuff I didn’t need is gone now.

Thank you for carefully preparing two effective hardware repair methods. I have already collected these two methods, and they will definitely be useful to me at the crucial moment. I also have seen several other tips for repairing SD cards. Please allow me to make a supplement.

THX for all the hints, also not thougth about logging config so far at all.
→ Are all this problems not relevant by migrating to “Home Assistant Blue” ?
THX M