Logbook Woes

Hi All,

Hopefully someone can help me understand how and what logbook decides to log…

I have logbook entries for things like Nest, Wunderground, Alarmdecoder but things like Rachio, media players and some custom components I’ve written never get logged in Logbook.

In my configuration.yaml I have the following:

logbook:
  include:
    domains:
      - sensor
      - switch
      - media_player
      - climate
      - nest
      - iaqualink
      - light
      - weather
      - cover
      - alarm
      - alarmdecoder
      - rachio
      - sun
      - binary_sensor

Am I missing something else?

Rachio should be under switch/sensor

I don’t think media players log to the logbook (could be wrong), and the custom components will need to be listed there (definitely) and (presumably) have something within their code to say which events are ‘logged’.

Also, you can only log things that are recorded in the recorder: component, so make sure you’re not excluding anything there.

According to the code, it looks like the logbook displays state changes, homeassistant starts and stops, as well as logbook_entry events. The only code I’ve found that creates a logbook_entry event is automation (which it does when an automation is triggered.) Also this event can be created by calling the logbook.log service (which is documented at the bottom of the Logbook doc page.

The other aspect is as explained by @anon43302295 and the doc page - the events are retrieved from the database, so they have to get there in the first place via the recorder configuration for logbook to be able to display them.

I have a rachio entry under switch, I can trigger a zone on or off but it never gets logged in logbook.

What’s strange is some sensors like wunderground create tons of entries while others don’t create any. I looked through the code and there is nothing specific that calls to a log entry or any function to log specifically.

Under recorder I don’t have any inclusions or exclusions so maybe there are some default coded?

If it records state changes by default would t that mean things like my nest thermostat temperature should be in logbook also?

According to this part of the logbook code, some state changes are not shown in the logbook. E.g., if it doesn’t have an entity_id, or if old_state or new_state are None, of if only attributes changed (i.e., the actual state string hasn’t changed), or if it’s an automatically maintained group, or if it’s hidden. Otherwise it should show up.

So, e.g., for your Nest thermostat climate entity, the state is the mode its in (i.e., off, cool, heat, eco, etc.), so it will only show up in the logbook if it’s mode is changed, not just if the temperature changes (which is an attribute of the entity.) Hmm, but if you have it configured to create sensor.NAME_temperature, that will change when the temperature changes, and I would think that should show up, but I don’t see that for my Nest thermostat. So, it would appear there might be more going on here than meets the eye. Hmm…

So… just as a more confusing example… I have the Wunderground and Foobot sensors… Wunderground state changes show in the logbook but Foobot dont, both change states often but only one gets logged and I dont have anything specific including or excluding either.

Looking at the code I dont see anything that would trigger a log or not…

Anyone else have any thoughts on this?

+1 implemented Rachio integration only to have better tracking of watering… only to find out it is not loogging anything in the logbook :-/

You’re not seeing anything in the logbook for Rachio switches? I’m getting logs for switches and binary sensor state changes…

Untitled

interesting… no: I’m not seeing anything logged. Doesn’t matter if they get activated from HA or Rachio App

If you start a zone or schedule from HA does the switch stay on? Or if you start it from app is HA showing the correct state?

the switch will stay on. Rachio show a manual schedule is running (for 10 min) activated by integration.

If I start it from the app then HA switch is not changing state.

logbook is not reporting anything

Do you have external access setup? Either through HA Cloud or external_url?

I don’t but I can set it up - do you want to take a look at it?

I would try setting up external access as the first step. Rachio uses webhooks for state updates, so if it’s not able to receive those the states won’t update properly, which means nothing will be logged. I’m willing to bet that’s the issue.

thanks I don’t understand why other aspects are working (history e.g.) but will definitely give it a try to check!

so I configured an external url (basically opening HA ports for remote access) - HA is accessible but nothing is logged. Its behaviour is unchanged…

Screenshot 2021-03-18 at 20.17.26

Now that you have external access, if you start a zone from the app does the switch update to show that zone on? Also, do you have anything excluded in the logbook config?

Hi - the behaviour is unchanged. No If I start a zone from the app the switch won’t react and not my logbook is untouched. I noticed this since the switch history (for some reasons all except one) were not even reporting the watering.