#Speaking a sound at a specific time
1 messages · Page 1 of 1 (latest)
what are you outputting to?
Voice PE
I managed to get that working with a trivial trigger (timer), but a more complex trigger (Google Calendar) doesn’t work.
ah so its the trigger rather than the tts
It was the TTS before I figured out that I needed to select a device.
you use the calandar trigger no?
Yes
It appears that the calendar does not refresh very frequently and is often out of date by a few minutes.
what is your actual use case here? are you using google calandar to trigger stuff rapidly?
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.
can you show the yaml of your trigger?
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?
can you see the traces: does the trigger fire but fail or does it not fire at all?
if it fires there should be something in the trace log
should show if there are any errors
The UI for “this trigger fires” is displayed, but there are no trace logs.
what shows when you open the traces for the automations
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
What is the reason for this? Known limitation?
i do not know
I expected triggers to be fully event-driven, with a timer wheel (or similar) updated whenever the calendar is modified.
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.
How likely is this to be a HA bug?
i am not sure, hopefully someone else can jump in that knows a little more then me
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.
{{ ((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
Why the extra parentheses?
just habbit shouldnt need them