Better logbook entries from Node-RED?

Hi there,

I have various Node-RED automations to turn my lights on and off, and I’m wondering if it’s possible to make the logbook entries more helpful. At the moment it says this:

And I really want the service call to be able to provide an annotation for the action, so the logbook could record a reason / trigger context, and maybe even a reference to another entity:

Is anything like this achievable?

Stop using node red. Use home assistant automations and you will get context like that.

Create a new user in home assistant then use that user to create a long lived access token. Use the newly created access token in node red to connect to HA. Then that user will show up in the logbook

https://zachowj.github.io/node-red-contrib-home-assistant-websocket/guide/#configuration

@tom_l thanks, I do keep an eye on developments in the native automation mechanism but I don’t think it can do there what I do with Node-RED. For example, listening for state changes on all entities that match a regex or which have a specfic domain and device class

1 Like

OK, I tried creating an automation that triggers on state_changed events and it basically bricked home assistant :joy:

Discussed here: Home Assistant fails to start with 503 error after creating an automation - how to debug?

So I think I’m OK with Node-RED for now :sweat_smile:

That’s one hell of a way getting started using HA automations.

It’s not what you were looking for but you can make your own entries into the logbook. Use the logbook domain and the log service.

You created an automation that triggered on all state change events. Including your automation’s state. Which got recursive real fast and used up all your memory.

I’ve done this. I created an automation that notified me of logged errors, unfortunately the automation caused errors. Took about 10 seconds for HA to choke.

It is wise to put a delay in these types of automations when first testing.

@Mikefila I’ll take that as a compliment :slight_smile:

@tom_l i guess that explains it. I was just trying to repro the node-red event state node !