Because @DrZzs did a video on holiday lights referencing Falcon Player and Xlights he asked for me to share how I have it all configured since I made a comment on his post. I successfully at this point have integrated HA sending MQTT commands to Falcon Player which has just recently incorporated MQTT into their project for control of Playlist. I am currently using xLights to create sequence files for my RGB exterior lights for my house which will stay up with year-round looks.
The idea came from @CCOSTAN who has a script that depending on the day will pick a look. I stayed with his format to trigger the look, but instead of triggering a scene I have it sending an MQTT topic to the Falcon player.
Automation:
##### Exterior lights on at sunset #####
- alias: "Monthly Holiday Color Scene ON"
initial_state: True
# hide_entity: True
trigger:
- platform: sun
event: sunset
action:
- service: script.monthly_color_scene
##### Exterior lights OFF #####
- alias: "Monthly Holiday Color Scene OFF"
initial_state: True
# hide_entity: True
trigger:
- platform: sun
event: sunrise
action:
- service: script.monthly_color_off
Flag Sensor
- platform: rest
resource: http://www.webcal.fi/cal.php?id=335&format=json&start_year=current_year&end_year=current_year&tz=America%2FLos_Angeles
name: Flag
scan_interval: 14400
value_template: >-
{%- set now_string = now().strftime('%Y-%m-%d') %}
{% for day_val in value_json if day_val.date == now_string %}
True
{% else %}
False
{% endfor -%}
Updated flag sensor code since I got it working and tested
```
**Scripts**
######################################################################
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
# Youtube Video description of how I use this script
# https://www.vcloudinfo.com/2018/10/easy-smart-home-gadgets-i-use-for-my.html
######################################################################
######################################################################
# Falcon Player - FPP
# MQTT events will be published to "$prefix/falcon/player/$hostname/" with playlist events being in the "playlist" subtopic.
# FPP will respond to certain events:
# hassio/falcon/player/FPP/playlist/name/set -- Starts the plalist named in the payload
# hassio/falcon/player/FPP/playlist/repeat/set -- If payload is "1", will turn on repeat, otherwise it is turned off
# hassio/falcon/player/FPP/playlist/sectionPosition/set -- Payload contains an integer for the position in the playlist
# hassio/falcon/player/FPP/event/$MAJ_$MIN -- Starts the event identified by MAJ/MIN
# hassio/falcon/player/FPP/effect/start -- Starts the effect named in the payload
# hassio/falcon/player/FPP/effect/stop -- Stops the effect named in the payload or all effects if payload is empty
######################################################################
monthly_color_scene:
sequence:
- service: mqtt.publish
data_template:
topic: hassio/falcon/player/FPP/playlist/name/set
payload: >
monthly_
{%- if states.sensor.flag.state == "True" -%}
RWB
{%- elif now().strftime("%m%d")|int == 101 -%}
new_years_day
{%- elif now().strftime("%m%d")|int >= 210
and now().strftime("%m%d")|int <= 214-%}
valentine
{%- elif now().strftime("%m%d")|int == 228 -%}
marti_gras
{%- elif now().strftime("%m%d")|int == 314 -%}
pi
{%- elif now().strftime("%m%d")|int >= 315
and now().strftime("%m%d")|int <= 317-%}
st_patty
{%- elif now().strftime("%m%d")|int >= 328
and now().strftime("%m%d")|int <= 401-%}
easter
{%- elif now().strftime("%m%d")|int == 422 -%}
st_patty
{%- elif now().strftime("%m%d")|int == 504 -%}
starwars
{%- elif now().strftime("%m%d")|int == 505 -%}
cinco_de_mayo
{%- elif now().strftime("%m%d")|int >= 1001
and now().strftime("%m%d")|int <= 1031-%}
halloween
{%- elif now().strftime("%m%d")|int >= 1122
and now().strftime("%m%d")|int <= 1123-%}
thanksgiving
{%- elif now().strftime("%m%d")|int >= 1201
and now().strftime("%m%d")|int <= 1230-%}
christmas
{%- elif now().strftime("%m%d")|int == 1231 -%}
new_years_day
{%- else -%}
standard
{%- endif -%}_colors
- delay:
seconds: 5
- service: mqtt.publish
data_template:
topic: hassio/falcon/player/FPP/playlist/repeat/set
payload: '1'
retain: false
monthly_color_off:
sequence:
- service: mqtt.publish
data_template:
topic: hassio/falcon/player/FPP/playlist/name/set
payload: 'all_off'
retain: false
- delay:
seconds: 5
- service: mqtt.publish
data_template:
topic: hassio/falcon/player/FPP/playlist/repeat/set
payload: '0'
retain: false
```
Falcon was not originally repeating so I added the repeat set topic for on an off. For Falcon to stop immediately I added a sequence with all the lights off that way it would take immediately when I wanted the lights out.
Here is what I am using to get some feedback with FPP MQTTstate_topics
```
# Falcon Player MQTT Status Updates
- platform: mqtt
name: "FPP Repeat Status"
state_topic: "hassio/falcon/player/FPP/playlist/repeat/status"
- platform: mqtt
name: "FPP Status"
state_topic: "hassio/falcon/player/FPP/status"
- platform: mqtt
name: "FPP Version"
state_topic: "hassio/falcon/player/FPP/version"
```
This is my first post here and I have only been using HA for the last year so hopefully it all makes sense.