Home Assistant Template Sensor - OStillman/HomeAssistantTeamsStatus GitHub Wiki

Configuring the Template Sensor

You should now have a teams_raw sensor populating itself within Home Assistant. This will provide the raw details from Teams, but it's generally easier for us to group multiple catagories into one to keep the Blinkt! status and other actions simple.

Therefore, add to your configuration.yaml in Home Assistant the following details:

- sensor
  - platform: template
    sensors:
      teams:
        friendly_name: "Microsoft Teams"
        unique_id: sensor.teams
        value_template: >-
            {% if states("sensor.teams_raw") in ["Available"] %}
              Available
            {% elif states("sensor.teams_raw") in ["DoNotDisturb","Presenting","Focusing"] %}
              Do not disturb
            {% elif states("sensor.teams_raw") in ["Busy","OnThePhone","DoNotDisturb","Presenting","Focusing","InAMeeting"] %}
              Busy
            {% elif states("sensor.teams_raw") in ["Away","BeRightBack"] %}
              Away
            {% else %}
              {{ states("sensor.teams_raw") }}
            {% endif %}