gluap / pyduofern-hacs

Repository managing hacs-integration for pyduofern
MIT License
27 stars 8 forks source link

Tons of log entries #37

Closed mhaack closed 1 year ago

mhaack commented 1 year ago

Not sure if this is since the last update but I get tons of log entries by the duofern component in HA. It is an endless stream of log messages. Is this correct behavior? Seems like the Duofern Stick sends messages all the time?

2023-06-03 13:18:30.554 INFO (Thread-6) [/usr/local/lib/python3.10/site-packages/pyduofern/duofern_stick.py] sending 0DFF0F40000000000000000000000000000042d8ac01 from write queue, 0 msgs left in queue
2023-06-03 13:18:30.986 INFO (Thread-6) [/usr/local/lib/python3.10/site-packages/pyduofern/duofern_stick.py] sending 0DFF0F40000000000000000000000000000042d8ac01 from write queue, 0 msgs left in queue
2023-06-03 13:18:31.273 INFO (Thread-6) [/usr/local/lib/python3.10/site-packages/pyduofern/duofern_stick.py] sending 0DFF0F40000000000000000000000000000042d8ac01 from write queue, 1 msgs left in queue
2023-06-03 13:18:31.351 INFO (Thread-6) [/usr/local/lib/python3.10/site-packages/pyduofern/duofern_stick.py] sending 0DFF0F40000000000000000000000000000042d8ac01 from write queue, 0 msgs left in queue

It logs ~250 MByte in 10min !

bcutter commented 1 year ago

Did you (accidentally) enable debug logging? I would check this first.

mhaack commented 1 year ago

Logging was set to

logger:
  default: info
  logs:
    pyhomematic.devicetypes.generic: warn
    homeassistant.helpers.script: warn
    homeassistant.components.python_script: warn
    custom_components.duofern: warn

After changing the default to warn the message disappears. However I'm still wondering why the integration seams to send tons of messages every second?

gluap commented 1 year ago

People have different notions of how much logging they like for the program they write. I tend to be on the verbose side of the spectrum. Essentially anything that's not a warning can be ignored unless there's a problem to diagnose - that's also why homeassistants default level is warning. With many programs there's also a bunch of "warning" level messages that do not mean there's an actual error but just a potential concern. But homeassistant enforces the notion that warnings basically shouldn't happen so I'm less liberal with those than usual in homeassistant related code.

mhaack commented 1 year ago

Appreciate the detailed answer and already set log level to warn.

However I'm still wondering why the integration seams to send tons of messages every second? What is the use case here? I only have 10 roller shutters and they are not moving or doing anything most of the time.

bcutter commented 1 year ago

I think that's the normal chatty stuff going on with duoFERN protocol and pyDuoFern just logs it from the stick/hardware.

mhaack commented 1 year ago

Ok thanks.

gluap commented 1 year ago

Apologies, @mhaack , I read your initial post before you added the "250 Mbyte in 10 minutes" part (because I read it from the notification mail which didn't come with the edit). 250 Megabytes/10 min is definitely not normal even with the rather verbose logging style used by duofern.

I run 6 Duofern shutters and for me - with some automation, several shutter movements per day and log level "INFO" I get at about 5-8 Megabytes/day. Which admittedly is still a lot, but also a a thousand times less than 250 megabytes in 10 minutes.