I’m trying to create a group of the entities that show there is occupance in my home. The template works, but it is being treated as a binary sensor (true/false). I’m trying to use this new sensor in an automation that expects a motion device. Adding device_class: motion is not valid.
I’m fairly new to Home Assistant customization and my configuration which started years ago may not be correct. I have this entry included below in a sensors.yaml file and I’m not sure if that is good practice.
- platform: template
sensors:
occupancy_detected:
value_template: >
{{ is_state('device_tracker.pixel_7_pro_m', 'home')
or is_state('device_tracker.pixel_7_pro', 'home')
or is_state('binary_sensor.ecobee_sensor_occupancy', 'on')
or is_state('binary_sensor.dining_room_occupancy', 'on')
or is_state('binary_sensor.family_room_occupancy', 'on')
or is_state('binary_sensor.main_occupancy', 'on')
or is_state('binary_sensor.claires_room_occupancy', 'on')
or is_state('binary_sensor.guest_room_occupancy', 'on')
or is_state('binary_sensor.wesley_s_room_occupancy', 'on')
or is_state('binary_sensor.upstairs_occupancy', 'on')
or is_state('binary_sensor.theater_occupancy', 'on')
}}