(1) Alexa and (2) Light issues (automations)

I have been F****ng around with HASS for awhile today and can’t seem to get these two items to work.

First off is Alexa:

I just updated my Home Assistant OS and Core to the latest versions as of this posting, since then it seems as Alexa won’t work for TTS. Generally it does not error out but it doesn’t speak. This is driving me nuts and is blocking my automations from being setup.

I have already googled the hell out of this and no luck. I even tried tweaking the notify.py script with no success. I have since reverted to the original script.

Secondly, I am trying to get lights to flash during an alarm event. I use Lifx lights and also have Abode. No matter what I do, the light i’m testing with will only turn colors or “flash” very slowly (IE: change colors every few seconds).

Any help would be greatly appreciated, I can paste yaml if needed.

Can’t help with your alexa, but for the lifx bulbs, there’s a separate service as opposed to light.turn_on + flash.

service: lifx.effect_pulse
entity_id: light.lamp
data:
  entity_id: light.lamp
  mode: strobe
  brightness: 255
  rgb_color:
    - 121
    - 0
    - 255
  period: 0.1
  cycles: 200

They do “strobe” very quickly, so be careful if anyone around has photosensitive epilepsy.

The pulse effect is slower than the strobe effect.

You can also control the speed of the strobe by modifying period I have one set up for 0.5 seconds and it’s pretty comfortable.

I’ve tried both the turn on + flash and pulse blink. My goal is to have the lights flash for the duration of the event and then return to normal. I setup a scene at the beginning to return the lights to the previous state. So far my testing on the one light isn’t going well enough to add others.

you could use lifx.effect_pulse instead of light.turn_on. Secondly, for the automation, you could use something like this

- alias: Flash Lights
  mode: single
  trigger:
  - platform: state
    entity_id: alarm_control_panel.home_alarm
    to: triggered
  action:
  - repeat:
      while:
      - condition: state
        entity_id: alarm_control_panel.home_alarm
        state: triggered
      sequence:
      - service: lifx.effect_pulse
        target:
          entity_id: light.lamp
        data:
          mode: strobe
          brightness: 255
          cycles: 10
          period: 0.5
          color_name: red
      - delay:
          hours: 0
          minutes: 0
          seconds: 5
          milliseconds: 0

IME lifx doesn’t need a script to return to normal after an effect. Once the effect stops, it’ll return to how it was before the effect.

This is the last variation I had tried, does anything seem glaring wrong to you?

alias: Motion Detected
description: ''
trigger:
  - type: motion
    platform: device
    device_id: 2cae8cb32ced52d5070a5e7ec3a9a20e
    entity_id: binary_sensor.downstairs_wx_motion
    domain: binary_sensor
condition: []
action:
  - service: scene.create
    data:
      scene_id: beforealarm
      snapshot_entities: light.gaming
  - repeat:
      while:
        - type: is_motion
          condition: device
          device_id: 2cae8cb32ced52d5070a5e7ec3a9a20e
          entity_id: binary_sensor.downstairs_wx_motion
          domain: binary_sensor
      sequence:
        - service: light.turn_on
          target:
            entity_id: light.gaming
          data:
            flash: long
            color_name: red
            brightness: 254
  - service: scene.turn_on
    target:
      entity_id: scene.beforealarm
mode: single

well, flash: long is a very slow flash. so if it works for you, just change that to flash: short. If you want an even faster flast, use lifx.effect_pulse.

if it doesn’t work at all, just use state for the motion sensor

  - platform: state
    entity_id: binary_sensor.downstairs_wx_motion
    to: on

another benefit of lifx.effect_pulse is you don’t have to mess around creating scenes and restoring them. when the effect stops, the light will return to the way it was before the effect started.

edit: without a delay in your repeat section, the light.turn_on is getting called repeatedly without being given time to complete.

edit2: I would do it like this

- alias: Flash Lights
  mode: single
  trigger:
  - platform: state
    entity_id: binary_sensor.downstairs_wx_motion
    to: on
  action:
  - repeat:
      while:
      - condition: state
        entity_id: binary_sensor.downstairs_wx_motion
        state: on
      sequence:
      - service: lifx.effect_pulse
        target:
          entity_id: light.gaming
        data:
          mode: strobe
          brightness: 255
          cycles: 5
          period: 0.5
          color_name: red
      - delay:
          hours: 0
          minutes: 0
          seconds: 2
          milliseconds: 500

adjust cycles, period, and delay according to your needs.