this post was submitted on 20 Feb 2024
12 points (100.0% liked)

homeassistant

12080 readers
4 users here now

Home Assistant is open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server. Available for free at home-assistant.io

founded 1 year ago
MODERATORS
 

I have a robot vaccum that sends an alert to HA when it's done cleaning or when it encounters a problem. How can I intercept or re-route those notificiations? I want to post them to Matrix, which I do have an integration for.

Thanks for assistance.

top 4 comments
sorted by: hot top controversial new old
[–] [email protected] 4 points 9 months ago (1 children)

https://www.home-assistant.io/docs/configuration/events/

In the dev tools > events tab you can subscribe and see what events are sent. There should be an event that is sent when it sends a notification. Create an automation that listens for that event

[–] [email protected] 4 points 9 months ago (1 children)

I would say that, in HomeAssistant, the more “proper” way to do it is to watch entities for state changes and trigger that way.

Events are really only accessible in case you want to manage your own entity, or if you are doing something complex and it makes more sense to publish an event of your own and then trigger from that.

Triggering via entity state transitions (which, yes, under the hood operates on Events) are meant to be a universal abstraction from whatever might be firing over the event queues. Unless you need Events for some reason, IMHO keep it simple.

[–] [email protected] 1 points 9 months ago

Yeah I always use states when I can but the original post description made it sound like the integration was directly sending a notification. If it didn't set a state (which would be weird) then you'd need an event.

[–] [email protected] 10 points 9 months ago

I don't use matrix so cannot answer with precision but you can create an automation and use vacuum state as trigger (ex: from cleaning to dock) and use notify platform to send to matrix whatever message you want