Automate with device vs entity

I have a very simple automation which turns on a light when motion is detected. In the trigger section, I can either use an entity like this:

entity_id: binary_sensor.upstairs
platform: state
to: “on”

or I can use the device like this:

type: motion
platform: device
device_id: 0f11fa93830c7843b5a1c8ef31822a5f
entity_id: binary_sensor.upstairs
domain: binary_sensor

What is the advantage of doing it one way vs the other way?

Entity ids will save you a lot of hassle in the long run.

2 Likes