Timer (Kitchen Timer) - IN PROGRESS#

I have an old Android phone on the kitchen wall showing a home assistant dashboard.

On it, there should be a timer (countdown clock) that lets me:

  • input digits on a keypad

Research#

Play a Sound#

At the end of it all, we want to play a sound.

Notification Channels#

https://companion.home-assistant.io/docs/notifications/notifications-basic#notification-channels

This thing tells me to create an automation, but I have no idea what to put into the trigger block…

Aside: Adding a Button#

I looked at existing automation (configured via UI):

  trigger:
  - platform: device
    domain: mqtt
    device_id: 789b43da25b726816bb703f2b5ae9f12
    type: action
    subtype: single

I remember seeing platform while perusing the docs, but first, let’s be stupid and google “home assistant automation platform button”. This yields https://community.home-assistant.io/t/trigger-automation-with-button-helper-on-dashboard/446816/5 which gives some good context:

to trigger the current automation via the dashboard you could create a ‘button helper’ and add this new button as a trigger for the automation

So based on the example in https://www.home-assistant.io/integrations/input_button/ put in configuration.yaml:

input_button:
  notify_with_sound:
    name: Notify A7 with sound
    icon: mdi:bell

This works, but home assistant shows a button next to the helper saying that it cannot be managed via the UI.

Return#

So AFAICT, to play sound:

  • send a notification with a custom channel

  • this creates the channel for the companion app

  • in the companion app’s settings: configure a sound for the channel

I have an existing notification set up for a physical button, so let’s re-use this to validate the hypothesis. Here’s the current button card config:

show_name: true
show_icon: true
type: button
tap_action:
  action: call-service
  service: notify.mobile_app_sx
  target: {}
  data:
    title: ping
    message: via dashboard button
name: ping felix

Edit tap_action.data to look like this:

  data:
    title: ping
    message: via dashboard button
    data:
      channel: "kitchen_timer_done"

I took a little while for the notifications to arrive, but after all, the new notification channel appeared! \o/

Now I can configure it to play any sound I have access to on my device.

But a new problem arises: The notification API has rate limits: 500 per day. Ouch. Maybe that’s not the way to go after all! :’(

Maybe I can use https://companion.home-assistant.io/docs/notifications/notification-local

Create a Timer#

Settings > Devices & Services > Helpers: