Motion Sensors - Cookie cutter approach for many sensor/light actions

If you have a mix of switches and lights then the template needs to change to this:

    data_template:
      entity_id: >
        {% set map = {'foyer_pir': 'switch.exterior_foyer',
                      'kitchen_pir': 'light.kitchen_cabinets',
                      'basement_pir': 'light.basement_main',
                      'bar_pir': 'switch.basement_bar_cabinets',
                      'storage_pir': 'light.basement_storage_lights'} %}
        {% set id = trigger.to_state.object_id %}
        {{ map[id] if id in map.keys() else 'none' }}