Alarm Integration with Google TTS problems - please help!

Okay so I have a Yale Smart Sync Alarm integrated nicely with HA via their API.

I’m trying to write a script that activates when a command on my Google Home Mini is heard - which I have got working, however I wanted the feedback from the GHM to be a bit more dynamic. See below from my scripts.yaml file:

>  arm_alarm:
>   alias: Arm Alarm
>   sequence:
>    - service: tts.google_say
>      entity_id: media_player.stes_room_speaker
>      data_template: 
>       message: >
>         {% if is_state("alarm_control_panel.yale_smart_alarm", "armed_away") %}
>         "Alarm is already armed"
>         {% endif %}
>         "STEVEN"
>    - condition: state
>      entity_id: alarm_control_panel.yale_smart_alarm
>      state: 'disarmed'
>    - service: alarm_control_panel.alarm_arm_away
>      data:
>       entity_id: 
>        alarm_control_panel.yale_smart_alarm
>    - wait_template: "{{is_state('alarm_control_panel.yale_smart_alarm', 'armed_away') }}"
>    - service: tts.google_say
>      entity_id: media_player.stes_room_speaker
>      data_template:
>        message: >
>         {% if is_state("alarm_control_panel.yale_smart_alarm", "armed_away") %}
>         "Alarm is now armed"
>         {% endif %}

The problem I am having is that the first `tts.google_say` call throws an error, as per below (ignore the messages, this is just for testing purposes):

> Error executing service <ServiceCall tts.google_say (c:15de4878b5eb4e8dbc5bac0a72b4726e): message="STEVEN", entity_id=['media_player.stes_room_speaker']>
> Traceback (most recent call last):
>   File "/usr/local/lib/python3.6/site-packages/homeassistant/core.py", line 1177, in _event_to_service_call
>     await service_handler.func(service_call)
>   File "/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/__init__.py", line 137, in async_say_handle
>     options=options
>   File "/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/__init__.py", line 306, in async_get_url
>     engine, key, message, use_cache, language, options)
>   File "/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/__init__.py", line 318, in async_get_tts_audio
>     message, language, options)
>   File "/usr/local/lib/python3.6/site-packages/homeassistant/components/tts/google.py", line 83, in async_get_tts_audio
>     token.calculate_token, part)
>   File "/usr/local/lib/python3.6/concurrent/futures/thread.py", line 56, in run
>     result = self.fn(*self.args, **self.kwargs)
>   File "/usr/local/lib/python3.6/site-packages/gtts_token/gtts_token.py", line 28, in calculate_token
>     seed = self._get_token_key()
>   File "/usr/local/lib/python3.6/site-packages/gtts_token/gtts_token.py", line 57, in _get_token_key
>     tkk_expr = re.search(".*?(TKK=.*?;)W.*?", line).group(1)
> AttributeError: 'NoneType' object has no attribute 'group'

The second tts.google_say works perfectly and I get a response once the alarm status has changed in HA, so doubt anything to do with tokens / credentials and stuff?

I’m just starting out with scripts, and my gut feeling is that this script probably isn’t the most efficient way to achieve what I want, so am open to suggestions.

Any help out there? Thanks in advance!

Update: I have setup a test script and some extremely strange behavior, I get the error depending upon the message. It seems the only thing I can get tts google to say is “Alarm is now armed” - If I put “alarm is now armed” (so make it a lowercase ‘a’ for alarm) - I get the error.

Bamboozled, any help appreciated.

Never mind - this was resolved with the latest 0.83.0 update!

How have you got the alarm working with HA?

I have the Yale smart alarm (not the sync version)

The official ha component has stopped working and a github issue was raised to see if someone (more skilled then me) can get it working again

Alright mate, it’s dead easy. I do have the sync version, but I doubt that changes anything as you only get Amazon Alexa integration.

I would make sure you firstly are running the most up to date version of HA or Hass.io, which ever method you are using. They may have updated the alarm_control_panel component, or the yale_smart_alarm platform with an updated API.

Then just add this to config.yaml:

alarm_control_panel:
 platform: yale_smart_alarm
 username: yourusername
 password: yourpassword

I have only just purchased mine, and it works fine. I would suggest possibly registering for a new Yale account and setting the system up from scratch and see if that works.

That’s the same one that doesn’t work for everyone.
I’m surprised to see it working for you, just added it back in and it only shows disarm

The only thing I can think at this point is that Yale have disabled the API working if your account has a ‘non Sync’ device registered against the account potentially? Not sure, can you verify other users with the Sync are also affected?