Hi,
in my mental model i think of events in hubitat as a pub/sub system.
Extending that to RM, i want to verify that i can have multiple rules listening on the same event, each triggering its rule separately in an exactly once delivery system for each event listener?
I just want to confirm that hubitat supports multiple subscribers to the same event?
As an example: two rules listening to the same contact sensor
Trigger: door sensor any Action: IF door sensor closed THEN lock door END-IF
Trigger: door sensor any Action: IF door sensor closed THEN turn hallway lamp on END-IF
I assume i don't need to encode these in the same rule, even though it is possible (maybe even feasible..). But as written will these rules execute reliably?
. I just want to make sure my understanding of how hubitat operates is correct.
yes but a couple of comments.. no reason to use any action, may as well use closed in your case..
and then no reason to use the if.. you know its closed it just triggered.
i would do one rule
trigger door sensor closed
action: lock door, turn hallway light on.
from an implementation perspective of that example i agree with you.
i was asking a more fundamental architectural question how the platform decouples the events from the service.
Lets say i want to subscribe to events from the same source in both rule machine as well as in an app. Is that fuily supported?
I like pub-sub style of programming to asynchronously decouple service chains but i wanted to make sure my mental model is correct.
as i said yes. you can have an many subscriptions to events as you want.. each is independent.
Ah, i missed the first yes, thanks for clarifying.
1 Like