esphome / esphome/feature-requests

Home Assistant logbook entry action

Open
#2,198 3 comments 4 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**

I'd like an action for creating entries in the home assistant logbook associated with a specific entity. Something like

```yaml
- homeassistant.logbook_entry:
id: my_sensor
message: My sensor did something
```

This would fire a [`logbook_entry`](https://www.home-assistant.io/docs/configuration/events/#logbook_entry) event in home assistant with the entity_id properly populated.

**Please describe your use case for this integration and alternatives you've tried:**

I have some automatons in esphome, it would be valuable to have logs associated with these automations in home assistant. So for example I can look at the details of my light, and see which automation turned it on.

**Additional context**

I can almost get there firing a custom event, then setting up an automation in home assistant to listen for those events and create the logbook entries. The blocker is any way to reliably get the entity id.

```yaml
- homeassistant.event:
event: esphome.log_message
data:
entity_id: !lambda return id(my_sensor).get_object_id();
message: here's a message
```

get_object_id() will sometimes work, but not if the entity id has been renamed in home assistant.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.