Single Automation to make Philips Hue light match Shelly relay state?

Just installed my first Shelly relays and am experimenting with integrating them with HA and some Philips Hue lights (not on the same circuit as the Shelly relay itself).

I have the following 2 separate automations up and running:

  • when Shelly relay turned ON, turn ON a specific group of hue lights
  • when Shelly relay turned OFF, turn OFF the same group of hue lights

I am wondering if it is possible to use a single automation to always match the state of the relay (on or off) instead of the two separate automations? Would be a little easier to maintain… Haven’t found an obvious way to do it, but I’m probably just overlooking something (I’m new to HA and Shelly relays)

Thanks!

Post the two automations and I’ll show you how to consolidate them.