Voice PE - Implementing display of Named Timers in HA *working... sort of*

I am actually working on a custom integration to sync the Voice PE timers with the HA Timer Helper - Right now I have a real struggle with creating Timer Helper instances on the fly.

I also read into the source code for the Voice PE for this. Basically I also extended the ESPHome like @jazzmonger did. To control the timers on the Voice PE I’m calling the C++ functions directly to, for example, to stop the timer:

  services:
    - service: stop_timer
      variables:
        timer_id: string
      then:
        - lambda:  |-
            api::VoiceAssistantTimerEventResponse msg;
            msg.timer_id = timer_id;
            msg.event_type = api::enums::VOICE_ASSISTANT_TIMER_CANCELLED;
            msg.total_seconds = 0;
            msg.seconds_left = 0;
            msg.is_active = false;
            id(va).on_timer_event(msg);

But there’s still a bug, since the assistant will tell me the timer still persists (it won’t ring though) Opened an issue here but didn’t get any response.

1 Like

Thanks for the inspiration!
Have used variation of your code to create 2 objects in HA:

  1. sensor having “finished timer” name
  2. event firing on timer finishing.

That allows to create an automation that giving announcement: “Timer XXXX finished”. Sometimes it is great to hear exact name of timer, and not just alarm sound.
concept is like that:

text_sensor:
  - platform: template
    id: finished_timer_name
    name: "Finished timer name"
    update_interval: never
    icon: "mdi:clock"

event:
  - platform: template
    id: timer_event
    name: "Timer"
    icon: mdi:camera-timer
    device_class: button
    event_types:
      - timer_running
      - timer_finished


voice_assistant:
.....
  on_timer_finished:
    - switch.turn_on: timer_ringing
    - event.trigger:
        id: timer_event
        event_type: "timer_finished"
    - lambda: | 
          id(finished_timer_name).publish_state(id(first_active_timer).name);
          if (is_timer_active) {
            id(timer_event).trigger("timer_running");
          }

I honestly dont know why setting a timer from the VPE doesnt start a timer in HA. Once its set there you can act on it in so many ways. I don’t think the timer stuff in VPE is long for the world. Too many issues and problems.

But, all this work and investigation kinda proves that.

And honestly I would turn this on for ALL timers. We’re constanly asking Alexa “what is the name of that timer?”

As a chef, I sometimes have 4-5 timers running at a time.