Hello,
So several years ago, you guys help me write the script for LIFX automation. It was basically an automation for the LIFX to run a light script on a specific day and time.
I was happy with it and it’s been working for years, that I just left it as it was and never touched it, until today I noticed it wasn’t working anymore.
Do you think the recent updates of the the core or the entire Hassio broke the script and automation? Because this is the only thing I only thing I do, keeping the Hassio up to date.
So to help you understand what the automation do. The LIFX bulbs are triggered to run specific color patterns depending on the date. Let’s say for Halloween, it will trigger specific color patterns on repeat, from 17:30 till the next day at 4:00.
Here’s my code:
Automation:
#Halloween Lights Theme
- id: halloweenlights_theme
alias: Halloween Lights Theme
trigger:
- platform: template
value_template: '{{ states(''sensor.date'')[-5:] == ''10-20'' and is_state(''sensor.time'', ''17:30'')}}'
- platform: template
value_template: '{{ states(''sensor.date'')[-5:] == ''10-21'' and is_state(''sensor.time'', ''17:30'')}}'
- platform: template
value_template: '{{ states(''sensor.date'')[-5:] == ''10-22'' and is_state(''sensor.time'', ''17:30'')}}'
- platform: template
value_template: '{{ states(''sensor.date'')[-5:] == ''10-23'' and is_state(''sensor.time'', ''17:30'')}}'
- platform: template
value_template: '{{ states(''sensor.date'')[-5:] == ''10-24'' and is_state(''sensor.time'', ''17:30'')}}'
- platform: template
value_template: '{{ states(''sensor.date'')[-5:] == ''10-25'' and is_state(''sensor.time'', ''17:30'')}}'
- platform: template
value_template: '{{ states(''sensor.date'')[-5:] == ''10-26'' and is_state(''sensor.time'', ''17:30'')}}'
- platform: template
value_template: '{{ states(''sensor.date'')[-5:] == ''10-27'' and is_state(''sensor.time'', ''17:30'')}}'
- platform: template
value_template: '{{ states(''sensor.date'')[-5:] == ''10-28'' and is_state(''sensor.time'', ''17:30'')}}'
- platform: template
value_template: '{{ states(''sensor.date'')[-5:] == ''10-29'' and is_state(''sensor.time'', ''17:30'')}}'
- platform: template
value_template: '{{ states(''sensor.date'')[-5:] == ''10-30'' and is_state(''sensor.time'', ''17:30'')}}'
- platform: template
value_template: '{{ states(''sensor.date'')[-5:] == ''10-31'' and is_state(''sensor.time'', ''17:30'')}}'
action:
- service: script.turn_on
data:
entity_id: script.halloweenlights_s
- service: notify.ios_phones
data:
title: Home Automation Message
message: Halloween Lights Theme has started.
Script:
#Halloween Theme
halloweenlights_s:
alias: Halloween Lights
sequence:
#sequence 1
- service: light.turn_on
data:
entity_id: light.balcony_left
transition: '2'
color_name: darkorchid
brightness_pct: '90'
- service: light.turn_on
data:
entity_id: light.balcony_right
transition: '2'
color_name: darkgreen
brightness_pct: '90'
- delay: '00:00:05'
#sequence 2
- service: light.turn_on
data:
entity_id: light.balcony_left
transition: '2'
color_name: darkgreen
brightness_pct: '90'
- service: light.turn_on
data:
entity_id: light.balcony_right
transition: '2'
color_name: darkorchid
brightness_pct: '90'
- delay: '00:00:05'
#sequence 3
- service: light.turn_on
data:
entity_id: light.balcony_left
transition: '2'
color_name: orange
brightness_pct: '25'
- service: light.turn_on
data:
entity_id: light.balcony_right
transition: '2'
color_name: red
brightness_pct: '25'
- delay: '00:00:05'
#sequence 4
- service: light.turn_on
data:
entity_id: light.balcony_left
transition: '2'
color_name: red
brightness_pct: '25'
- service: light.turn_on
data:
entity_id: light.balcony_right
transition: '2'
color_name: orange
brightness_pct: '25'
- delay: '00:00:05'
- service: script.themesloop_s
data:
entity_id: script.halloweenlights_s
#Themes Loop Code
themesloop_s:
alias: Themes Loop
sequence:
- delay: '00:00:00'
- service_template: >
{% if states('sensor.time') > '16:00' or states('sensor.time') < '04:00' %}
{{ entity_id }}
{% elif is_state('script.light_themes_off_s', 'off') %}
script.light_themes_off_s
{% endif %}
#Themes Auto Off
light_themes_off_s:
alias: Light Themes Off
sequence:
- service: light.turn_off
entity_id:
- light.balcony_left
- light.balcony_right
- service: notify.ios_phones
data:
title: Home Automation Message
message: Holiday Themes Lights has ended.
It was supposed to run starting yesterday, but I just realized, it’s not working anymore. I checked the codes, and they all seem to be ok. Also the iOS notification isn’t working at all too.
Do you think it’s because of the recent updates? Should I just roll it back to the previous version?
Also if I execute the halloween lights manually, the lights script won’t loop anymore, it will run only once, and stop. It seemed like the “themes loop” get triggered, but it’s not repeating the lights theme. I don’t know what broke the entire script, because I haven’t edited this until I got it all working as I want them to be.
Thanks in advanced.