Using a To-Do List for Messages

Home Assistant Automation

I first created a new To-Do list called todo.messages. This will receive any Messages which need to be sent to users and displayed on the dashboard. It was simply created on the Helpers tab in Devices.

Adding a message is as simple as calling the todo,additem service call.

service: todo.add_item
  item: Title
  description: Description
  entity_id: todo.messages

The next challenge was to get a compact view on the dashboard as the standard To-Do list is very large.

The display simply shows a greeting when there are no outstanding messages. When there is one or more messages it shows the messages so they can be ticked off when complete.

No outstanding messages
with a message, note the red icon
type: vertical-stack
  - type: custom:mushroom-template-card
    primary: |-
    secondary: >-
      {%- from 'easy_time.jinja' import  easy_time %}
      {%- from 'tools.jinja' import days_till, time_of_day -%}Good
      {%- set count =
      state_attr('sensor.downloads','number_of_files')|int %}
      {%- if count > 0 %}
      {%- for file in state_attr('sensor.downloads','file_list') %}      
      ({{loop.index}}) Voicemail - 
      {%- set datestring = file | replace("/media/downloads/voicemail-",'')|
      replace('.mp3','') %}
      {%- set fmat = "%Y%m%d%H%M%S" %}
      {%- set datetime = strptime(datestring, fmat) | as_local %}
      {{- ' '}}{{easy_time(datetime)}} ago 
      {%- endfor %}
      {%- endif %}
    icon: mdi:message
      action: call-service
      service: input_boolean.turn_off
        entity_id: input_boolean.notify_light
      data: {}
    badge_icon: ''
    icon_color: |-
      {% if states('todo.messages') | int  > 0 %}red{% endif %}
    entity: todo.messages
    multiline_secondary: true
  - type: conditional
      - condition: numeric_state
        entity: todo.messages
        above: 0
      type: todo-list
      entity: todo.messages
          .: |
            ha-card.type-todo-list div.header {
              display: none;
            ha-card.type-todo-list .addRow {
              display: none;
            ha-card.type-todo-list div.divider {
              display: none;
            ha-card.type-todo-list mwc-list#checked {
              display: none;
          ha-check-list-item$: |
            mwc-checkbox {
              display: none;

The next job was to update the Voicemail automation and Rubbish automation to use the new messages. Then to change the phone and tablet charging routine to send and clear messages when needed.

When new messages arrive we need to be able to see them. So I have a couple of automations to handle that.

Send Notification when items added to to do list such as Messages or Shopping

This will send a standard notify.notify message each time something is added to any To Do list.

alias: >-
  Send Notification when items added to to do list such as Messages or Shopping
description: Lists can include any todo list such as Messages or Shopping List
  - platform: event
    event_type: call_service
      domain: todo
      service: add_item
      date: "{{now().strftime(' %A %d/%m at %H:%M')}}"
      list_name: >
        {{ state_attr(([0],
        'friendly_name') }}
      item: "{{ | title }}"
      description: "{{}}"
      user_name: >
        {% set uid = trigger.event.context.user_id %}

        {% set user = None %}

        {% set matching_users = states.person | selectattr('attributes.user_id',
        '==', uid) | list %}

        {% set user = matching_users | first if matching_users | length > 0 else
        "Jarvis" %}

        {{ user if user == "Jarvis" else
        state_attr(user.entity_id,"friendly_name") }}
condition: []
  - service: notify.notify
      title: "{{list_name}}: {{item}}"
      message: |
           - added by {{user_name}} on {{date}}.
mode: single

This turns on the Warning Light in the Living Room when there are outstanding messages and the Living room becomes occupied.

alias: Turn notify light when a new message arrives
description: >-
  This can be enhanced to turn on light for other reasons.  It should only turn
  on once the Family is Home.
  - platform: state
      - binary_sensor.living_room_occupied
    to: "on"
  - platform: state
      - todo.messages
  - condition: state
    state: "on"
    entity_id: binary_sensor.living_room_occupied
  - if:
      - condition: numeric_state
        entity_id: todo.messages
        above: 0
      - service: input_boolean.turn_on
        data: {}
          entity_id: input_boolean.notify_light
      - service: input_boolean.turn_off
          entity_id: input_boolean.notify_light
        data: {}
    alias: If there are messages turn on flasher else turn off
mode: single

In all I have around a dozen automations which now send messages this way.