Published: Jul 30, 20234 min read

My First Home Assistant Card 🎉: O365 Card 🗒️

Written by: Fixt

Installation

O365 Card Config
Open your Home Assistant instance and open a repository inside the Home Assistant Community Store.

You can use this button to be redirected to the download page. It will open the repository's page in HACS.

You can find the documentation here.

This is a Custom Card to show information from your O365 sensors into the home assistant dashboard.
The intent is to create a simple and easy-to-use card to show the sensor's information in the dashboard.

Once installed can be added from the Dashboard Panel, just search for O365 Card, works with the Lovelace Config Editor.

Supported Types

Mail
To Do
Teams

Add more functionality

Open your Home Assistant instance and show your helper entities.

You can use this button to go to the helpers page. There create a new input_text (Text) and name it as you want.

Create new task from the dashboard

To Do

config/automations.yaml

alias: Create new task office 365 list
description: ""
trigger:
  - platform: state
    entity_id:
      - input_text.o365_card_task_input #Change this to your input_text
condition:
  - condition: template
    value_template: '{{ (states.input_text.o365_card_task_input.state | length) > 0 }}' #Change this to your input_text
    enabled: true
action:
  - service: o365.new_task
    data:
      subject: '{{ states.input_text.o365_card_task_input.state }}' #Change this to your input_text
    target:
      entity_id: sensor.create_office365_card_fixt #Change this to your tasks sensor
  - service: input_text.set_value
    data:
      value: ''
    target:
      entity_id: input_text.o365_card_task_input #Change this to your input_text
  - service: homeassistant.update_entity
    data: {}
    target:
      entity_id: sensor.create_office365_card_fixt #Change this to your tasks sensor
mode: single

New Task Dashboard Card

Custom Card

type: vertical-stack
cards:
  - type: custom:o365-card
    entity: sensor.create_office365_card_fixt #Change this to your tasks sensor
    max_items: 0
    only_overdue: false
  - type: entities
    entities:
      - entity: input_text.o365_card_task_input #Change this to your input_text

Answer Last Teams Message Automation

Teams

config/automations.yaml

alias: Send Teams Chat Message
description: ""
trigger:
  - platform: state
    entity_id:
      - input_text.o365_card_chat_input #Change this to your input_text
condition:
  - condition: template
    value_template: '{{ (states.input_text.o365_card_chat_input.state | length) > 0 }}' #Change this to your input_text
    enabled: true
action:
  - service: o365.send_chat_message
    data:
      chat_id: '{{ states.sensor.fixt_chat.attributes.chat_id }}' #Change this to your chat sensor
      message: '{{ states.input_text.o365_card_chat_input.state }}' #Change this to your input_text
    target:
      entity_id: sensor.fixt_chat #Change this to your chat sensor
  - service: input_text.set_value
    data:
      value: ''
    target:
      entity_id: input_text.o365_card_chat_input #Change this to your input_text
mode: single

Answer Last Teams Message Dashboard Card

Custom Card

type: vertical-stack
cards:
  - type: custom:o365-card
    entity: sensor.fixt_chat #Change this to your chat sensor
    max_items: 0
    only_overdue: false
  - type: entities
    entities:
      - entity: input_text.o365_card_chat_input #Change this to your input_text