#Speaking a sound at a specific time

1 messages · Page 1 of 1 (latest)

runic parrot
#

How do I speak a sound at a specific time, such as when I have a calendar event coming up? I would prefer to use the text-to-speech feature in Home Assistant to generate the sound, rather than having to record it myself.

This is probably a super easy task with some YAML, but the UI is not at all obvious.

desert pelican
#

what are you outputting to?

runic parrot
#

Voice PE

desert pelican
#

something like that should do it

runic parrot
#

I managed to get that working with a trivial trigger (timer), but a more complex trigger (Google Calendar) doesn’t work.

desert pelican
#

ah so its the trigger rather than the tts

runic parrot
#

It was the TTS before I figured out that I needed to select a device.

desert pelican
#

you use the calandar trigger no?

runic parrot
#

Yes

#

It appears that the calendar does not refresh very frequently and is often out of date by a few minutes.

desert pelican
#

what is your actual use case here? are you using google calandar to trigger stuff rapidly?

runic parrot
#

I want the assistant to remind me whenever an event is about to happen, so that I don’t forget stuff or miss appointments.

#

Also, it is far, far harder to test something if I can’t trigger it on demand. The message uses a custom template so triggering the event manually doesn’t work.

desert pelican
#

can you show the yaml of your trigger?

runic parrot
#
alias: New automation
description: Calendar reminder
triggers:
  - trigger: calendar
    entity_id: 'calendar.<redacted>'
    event: start
    offset: "-0:15:0"
    id: Test 3
  - trigger: calendar
    entity_id: 'calendar.<redacted>'
    event: start
    offset: "-0:30:0"
    enabled: true
    id: Test 2
  - trigger: calendar
    entity_id: calendar.test_calendar
    event: start
    offset: "-0:0:0"
    enabled: true
    id: Test 1
actions:
  - action: assist_satellite.announce
    metadata: {}
    data:
      message: >-
        {% if True %}{{trigger.calendar_event.summary}}, described as
        {{trigger.calendar_event.description}}, {% if trigger.offset.seconds > 0
        -%} {{trigger.calendar_event.offset}}s in {{trigger.offset.seconds/60}}
        minutes {%- elif trigger.offset.seconds < 0 -%} {{trigger.event}}ed
        {{trigger.offset.seconds/60}} minutes ago {%- else -%}
        {{trigger.event}}s now {%- endif -%}{%else%} Testing testing testing!!!
        {%endif%}
    target:
      device_id: 3200fca8f520e20745f45d6560b7473c
mode: queued
max: 100

Is my template wrong?

desert pelican
#

can you see the traces: does the trigger fire but fail or does it not fire at all?

runic parrot
#

Does not fire

#

Update: Trigger fires, but no trace.

desert pelican
#

if it fires there should be something in the trace log

#

should show if there are any errors

runic parrot
#

The UI for “this trigger fires” is displayed, but there are no trace logs.

desert pelican
#

what shows when you open the traces for the automations

runic parrot
#

Only old events

desert pelican
#

oh thats odd

#

i think the calandar triggers only scans new events every 15 minutes (or it did at one point) so if your test event is 2 minutes ahead it might not be gettring recognised correctly

runic parrot
#

What is the reason for this? Known limitation?

desert pelican
#

i do not know

runic parrot
#

I expected triggers to be fully event-driven, with a timer wheel (or similar) updated whenever the calendar is modified.

desert pelican
#

its been quite a while since i did much with calandars and i dont really automate off them that much. it may be different now from the last time i looked at it tbh.

runic parrot
#

How likely is this to be a HA bug?

desert pelican
#

i am not sure, hopefully someone else can jump in that knows a little more then me

runic parrot
#

I got almost everything working, except for one thing: {{ trigger.calendar_event.seconds / 60}} renders as the number of seconds (wrong), not the number of minutes (correct). It seems the division is ignored.

desert pelican
#

{{ ((trigger.calendar_event.seconds|float) / 60) }}

#

i am sure there is a better way of doing that but i cant think of it right now

runic parrot
#

Why the extra parentheses?

desert pelican
#

just habbit shouldnt need them