Intercepting, Handling an Event

Can you listen for an event, say turning on a switch or a group and then “handle” it so that the default handler isn’t called?

I was thinking about this while chatting to a user about some insteon devices being skipped (using the UDI/ISY platform). He has about 10 insteon items in group and when turning the group on or off, some devices get skipped.

This got me thinking. If he created an insteon scene, added all the devices to it, that significantly cuts down on the insteon traffic in the house.

What would be nice is, if, in a component or automation or whatever, listen for the group event, then call your insteon scene and then stop the propagation of the event. Mark it as handled, that way, the default group code of turning on/off each device isn’t called.

This functionality might be too limited to use, but if currently possible, please point me to an example, or if it isn’t, maybe a feature request?


Edit: I read more about the current events. We have state_changed but that is too late. We would need a state_changing type event that would let us interecept, cancel, do our thing and fire state_changed. Probably too big of a change to support. It could however, provide for some interesting features in the future.

1 Like

It’s not a general purpose solution, but my Insteon-MQTT link software can be used to create an arbitrary insteon scene on the modem and then trigger that scene via MQTT (either via automation message or as an MQTT button in HA). It’s also very reliable for sending messages to multiple insteon devices (though that obviously takes longer than using a scene).

I think you were discussing with me… what’s funny is where I work, we build network security software and we have the concept of plugins and one plugin can listen for an action or resolve request for another plugin and respond… so it’s a good idea that you have…

As to the scenes concept, I’d love to use scenes if they supported dimming in HA. I have a bunch of 3 way switches that are groups into a scene… if I turn a switch on to a certain brightness it doesn’t turn the scene on, if I use the scene I can’t set brightness… I think the ISY HA component should support dimming scenes… but also back to the original issue of too many requests… I opened some tickets with UDI about that… waiting to hear back.

Did you find a way to do this? I want to create an automation to intercept a closing blinds event if the windows are open. If they are I want to cancel the event before it is executed.

Not really, no.

I’ve got a similar use case:

I’d like to intercept the “arm alarm” events and stop the arming if certain doors are open. There are workarounds I guess, but all of them (that I can think of) mean that I cannot use the default arming mechanism but only one that I customly build, so it feels very un-elegant (and not sure it will work either).

I guess still nobody has a solution for this?