I have my ecobee sensors around the house that detect occupancy, I want to create a script that looks at all of them to determine if the house is occupied. How do I pull device_class: occupancy from all of the binary sensors, then cycle through them to determine if any are on? Then set a state for a new binary_sensor.home_occupancy to On or Off?
binary_sensor.kitchen_occupancy off
friendly_name: Kitchen Occupancy
device_class: occupancybinary_sensor.master_bedroom_occupancy off
friendly_name: Master Bedroom Occupancy
device_class: occupancybinary_sensor.office_occupancy off
friendly_name: Office Occupancy
device_class: occupancy