How can I prevent a warning message to be written to my home-assistant.log file (/config).?
The following line written every minute to this log file:
2020-02-03 15:13:41 WARNING (MainThread) [homeassistant.components.switch] Updating tuya switch took longer than the scheduled update interval 0:00:30
I guess writing every minute to a file will break my SD card some day.
If you think a log every 30 seconds is bad for your SD card…don’t even look what that database is doing. It’s writing for every single state update on every single device every time they change!
To answer your question, add the ‘logger’ component to your configuration
Now you can control every single component log level. If you don’t want tuya warnings, do
# Unless otherwise stated below, only log warning level and above
# Suppressing tuya warning messages with this
Now the tuya component will only give error level and above to the logs.
If later you find you, say, want debug statements for some other component, you can add that too and make only that component ‘debug’ level and above. Etc, etc.
Thanks Jim, that does the trick.
A positive side effect is that this log becomes readable again (too many tuya warnings to be able to see the other entries).