Using Entities In Automations

Greetings all,

I am trying to set up an automation in which my living room lights turn on at sunset if neither my wife or I are at home.

The automation UI only lets me use devices in the actions part and not entities. My HA has an entity named lights.living_room which is a room/group passed to it by Philips Hue.

How would I go about using that entity in an automation or turning that entity into a device.

Thanks !

Change the Action Type to ā€˜Call Serviceā€™ instead of ā€˜Deviceā€™.

In fact I recommend you do not use device triggers, conditions or actions if you can. This will make it a lot easier if you ever have to replace a device/entity.

1 Like

This worked like a charm, thanks again.

This tip about using service calls, is this a best practice for cards as well ?

Cards?

What do you mean?

When working with dashboards and creating buttons/entities is the best practice to use service calls as often as possible in place of other things ?

Sorry for the confusion.

You canā€™t use device automations there.

No I know that, Iā€™m just asking if in general it is best to use service calls whenever possible instead of interacting directly with devices and entities.

Not referring specifically to automation.

Yes, thatā€™s what I said:

There is nowhere else this ā€œdeviceā€ logic applies.

Okay, thanks for the clarification.

Plus, you are far more likely to get high-quality support if you use normal service calls with entities/data than if you use the device-based triggers/actions in automations/scripts.

1 Like