Sun component - avoid state changes in log

I’m getting sun state changes every 60 secs in the logs, I’m wondering how can I get rid of them while keeping every other relevant log entries.
I’ve tried to add the logger component in configuration.yaml, and setting CRITICAL for the sun component, but as you can see in the sample log entry, the state change is actually reported by homeassistant.core. Of course I really don’t want to change the log level of that component since it reports a lot of important staff that I need to keep.

Jun 17 21:07:30 nas hass[17519]: 2017-06-17 21:07:30 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state sun.sun=below_horizon; next_dusk=2017-06-18T21:15:16+00:00, next_midnight=2017-06-18T03:53:01+00:00, azimuth=272.58, next_noon=2017-06-18T15:52:52+00:00, elevation=-40.11, friendly_name=Sun, next_dawn=2017-06-18T10:30:28+00:00, next_rising=2017-06-18T10:58:36+00:00, next_setting=2017-06-18T20:47:08+00:00 @ 2017-06-17T18:14:40.372920-03:00>, old_state=<state sun.sun=below_horizon; next_dusk=2017-06-18T21:15:16+00:00, next_midnight=2017-06-18T03:53:01+00:00, azimuth=272.71, next_noon=2017-06-18T15:52:52+00:00, elevation=-39.91, friendly_name=Sun, next_dawn=2017-06-18T10:30:28+00:00, next_rising=2017-06-18T10:58:36+00:00, next_setting=2017-06-18T20:47:08+00:00 @ 2017-06-17T18:14:40.372920-03:00>, entity_id=sun.sun>

Is there any configuration possible to prevent this sun states to be reported? Thanks in advance

1 Like

Bump, because I’ve been searching for a solution to this with no luck.

1 Like

God, bumping it again about 6 months after the last bump. Anything short of recompiling or getting rid of the “sun” component?

See the logger component

In general, to avoid too many entries in the log, set the default to

logger:
  default: warning

If, for some reason, you like info messages, you can just exclude certain topics

logger:
  default: info
  logs:
     homeassistant.core: warning
logger:
  default: debug
  logs:
    homeassistant.components.sun: critical

should get you exactly what you are looking for. It should only display critical errors for the sun component.

1 Like

I just can’t get this one to work… I’ve got the following now and I still get constant log spam:

logger:
  default: info
  logs:
    homeassistant.components.sun: critical
    homeassistant.core.sun: error
    homeassistant.sun: error
    core.sun: error
    sun.sun: error

See my previous answer.