Yes thank you for following back up with me. I’m having just as many problems now with automations as I was the other day. It seems any time I had new automations or change other things some existing automations break without any changes being made to them. That’s handy that you meantion errors equal problems with actions and no errors points to the other. Seems simple but not a connection I had made.
I think you may be right about quotes being a no no under the for: of a trigger. From what I’ve googled most people agree with that. But I seem to remember reading to the contrary before but I’ve taken them out for now.
I have since learned that quotes ARE necessary for when used in a trigger like:
# Shut off the music at 7:20AM
- id: Morning Shutdown
alias: Shut off bathroom chromecast each morning
initial_state: 'on'
hide_entity: false
trigger:
- platform: time
at: '21:29:00'
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: media_player.turn_off
entity_id: media_player.all_devices_group
That one above works and so does my other one to turn it off later. Earlier tonight I didn’t have the quotes and was getting and error message. Just in case anyone else is reading this.
Where I’m still having problems is with the motion sensors turning OFF the lights on 2 of them. All 3 of the motion sensors turn ON their respective room’s lights just fine (well the bathroom one is delayed 10 seconds and some times doesn’t trigger) but only the front porch is successfully turning off after X minutes.
What’s strange is I’m using the same exact thing for all 3 of them and only 1 turns off.
I’m also having problems with my media player (in my case Fire TV) not dimming the lights like it should. I had those 2 automations working succesfully a week or 2 ago and I’m not sure what happened. Any ideas for those?
I tried sjee’s input slider to control delay time for turning the lights off too. I believe I have it set up correctly but it hasn’t worked yet. Here is what I’ve got for that:
# Bathroom Motion Stopped <--------- NOT WORKING :(
- id: Bathroom Motion Stopped
alias: Bathroom Motion Stopped
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.bathroom_motion
to: 'off'
condition:
- condition: state
entity_id: scene.bathroom_on
state: 'on'
action:
- delay: '00:{{ states.input_slider.sensor_delay_bathroom.state | int }}:00'
- service: scene.turn_on
entity_id: scene.bathroom_off
and in my input_sliders.yaml:
sensor_delay_bathroom:
name: Bathroom Sensor Delay
initial: 1
min: 1
max: 10
step: 1
I took your suggestion and looked through the logbook, what I’m seeing is all of the motions sensors triggering, all of the automations that turn all of the lights triggering, and only the front porch light off automation firing, not the bathroom one. The office one I haven’t tested as much because I am always in there working on there. If it matters, all of my lights are hue lights except the front porch. And 2 of my motion sensors or ecolink and the bathroom one is gocontrol.
In my error log, sometimes I am seeing these errors. sometimes they are there and most times they are not. It has to do with the input sliders I added to control volume for each device and my chromcast/google home groups. is it a cause for concern? I restarted hass right after typing this and no errors. Here they are:
2017-09-01 21:26:58 WARNING (SyncWorker_6) [netdisco.ssdp] Error fetching description at 127.0.0.1
2017-09-01 21:26:58 WARNING (SyncWorker_6) [netdisco.ssdp] Error fetching description at 192.168.1.159
2017-09-01 21:26:58 WARNING (SyncWorker_6) [netdisco.ssdp] Error fetching description at 192.168.1.248
2017-09-01 21:26:59 WARNING (SyncWorker_6) [netdisco.ssdp] Error fetching description at https://192.168.1.33:8888
2017-09-01 21:27:01 WARNING (SyncWorker_2) [pywemo.ssdp] Error fetching description at https://192.168.1.33:8888
2017-09-01 21:27:08 ERROR (MainThread) [homeassistant.core] Invalid service data for input_slider.select_value: expected float for dictionary value @ data['value']. Got ''
2017-09-01 21:27:08 ERROR (MainThread) [homeassistant.core] Invalid service data for input_slider.select_value: expected float for dictionary value @ data['value']. Got ''
2017-09-01 21:27:08 ERROR (MainThread) [homeassistant.core] Invalid service data for input_slider.select_value: expected float for dictionary value @ data['value']. Got ''
2017-09-01 21:27:08 ERROR (MainThread) [homeassistant.core] Invalid service data for input_slider.select_value: expected float for dictionary value @ data['value']. Got ''
2017-09-01 21:27:08 ERROR (MainThread) [homeassistant.core] Invalid service data for input_slider.select_value: expected float for dictionary value @ data['value']. Got ''
2017-09-01 21:29:00 ERROR (MainThread) [homeassistant.core] Invalid service data for input_slider.select_value: expected float for dictionary value @ data['value']. Got ''
2017-09-01 21:32:22 WARNING (SyncWorker_15) [netdisco.ssdp] Error fetching description at 192.168.1.199
Just curious, what does that error fetching description message mean? I see that from time to time as well.
Newest automations.yaml:
############################################
# THEMES
############################################
# Set Theme to Dark Mode on startup
- id: Theme Set to Dark Mode
alias: 'Set theme at startup'
initial_state: 'on'
trigger:
- platform: homeassistant
event: start
action:
- service: frontend.set_theme
data:
name: dark_mode
###########################################
# HARMONY HUB
###########################################
# Update Harmony Hub
- id: Remote Update Harmony Hub
alias: 'Remote update Harmony Hub'
initial_state: 'on'
trigger:
- platform: state
entity_id: remote.harmony_hub
action:
- service: input_select.select_option
data_template:
entity_id: input_select.harmony_hub
option: >
{{ states.remote.harmony_hub.attributes.current_activity }}
# Harmony Start Selected Activity
- id: Start Selected Activity
alias: 'Remote start activity from input select living room tv'
initial_state: 'on'
trigger:
- platform: state
entity_id: input_select.harmony_hub
action:
- service: script.turn_on
entity_id: script.input_select_harmony
###########################################
# MOTION
###########################################
# Office Motion On
- id: Office_Motion
alias: Turn on the office lights when movement is detected
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.office_motion
to: 'on'
condition:
- condition: state
entity_id: light.office
state: 'off'
action:
- service: scene.turn_on
entity_id: scene.office_on
# Bathroom Motion On
- id: Bathroom_Motion_On
alias: Turn on the bathroom lights when movement is detected
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.bathroom_motion
to: 'on'
action:
- service: scene.turn_on
entity_id: scene.bathroom_on
# Front Porch Motion On
- id: Front_Porch_Motion_On
alias: Turn on the front porch lights when movement is detected
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.front_porch_motion
to: 'on'
action:
- service: scene.turn_on
entity_id: scene.front_porch_on
# Office Motion Stopped
- id: Office Motion Stopped
alias: Office Motion Stopped
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.office_porch_motion
to: 'off'
for:
minutes: 1
action:
- service: scene.turn_on
entity_id: scene.office_off
# Bathroom Stopped <--------- NOT WORKING
# - id: Bathroom Motion Stopped
# alias: Bathroom Motion Stopped
# initial_state: 'on'
# trigger:
# - platform: state
# entity_id: binary_sensor.bathroom_porch_motion
# to: 'off'
# for:
# minutes: 5
# action:
# - service: scene.turn_on
# entity_id: scene.bathroom_off
# Bathroom Motion Stopped <--------- NOT WORKING :(
- id: Bathroom Motion Stopped
alias: Bathroom Motion Stopped
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.bathroom_motion
to: 'off'
condition:
- condition: state
entity_id: scene.bathroom_on
state: 'on'
action:
- delay: '00:{{ states.input_slider.sensor_delay_bathroom.state | int }}:00'
- service: scene.turn_on
entity_id: scene.bathroom_off
# Front Porch Motion Stopped
- id: Front Porch Motion Stopped
alias: Front Porch Motion Stopped
initial_state: 'on'
trigger:
- platform: state
entity_id: binary_sensor.front_porch_motion
to: 'off'
for:
minutes: 1
action:
- service: scene.turn_on
entity_id: scene.front_porch_off
# Shut off the music at 7:20AM
- id: Morning Shutdown
alias: Shut off bathroom chromecast each morning
initial_state: 'on'
hide_entity: false
trigger:
- platform: time
at: '21:29:00'
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: media_player.turn_off
entity_id: media_player.all_devices_group
#####################
# MORNING ROUTINE
#####################
# Start iHeartRadio in the morning
- id: Morning Startup
alias: Turns on the chromecast and plays iHeartRadio in the bathroom each morning
initial_state: 'on'
hide_entity: false
trigger:
- platform: time
at: '21:28:00'
condition:
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: media_player.play_media
entity_id: media_player.all_devices_group
data:
media_content_id: http://kbpi-fm.akacast.akamaistream.net/7/535/19810/v1/auth.akacast.akamaistream.net/kbpi-fm
media_content_type: audio/mp3
####################
# MEDIA PLAYING
####################
# Fire TV Paused <------------- NOT WORKING
- id: FireTV_Paused
alias: Media player paused/stopped
initial_state: 'on'
trigger:
- platform: state
entity_id: media_player.fire_tv
from: 'playing'
to: 'idle'
condition:
- condition: state
entity_id: sun.sun
state: below_horizon
action:
- service: scene.turn_on
entity_id: scene.living_room_on
# Fire TV Playing <------------- NOT WORKING
- id: Fire TV Playing
alias: "Fire TV is playing"
initial_state: 'on'
trigger:
- platform: state
entity_id: media_player.fire_tv
to: 'playing'
from: 'idle'
condition:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
action:
- service: scene.turn_on
entity_id: scene.living_room_dim
###################################################
# BRIGHTNESS SLIDERS
###################################################
# All Lights Brightness Slider
- id: All Lights Brightness Slider
alias: All Lights Brightness
initial_state: 'on'
trigger:
- platform: state
entity_id: input_slider.all_lights_light_brightness
action:
- service: light.turn_on
data_template:
entity_id: group.all_lights
brightness: '{{ states.input_slider.all_lights_light_brightness.state | int }}'
# Back Porch Brightness Slider - WORKING
- id: Back Porch Brightness Slider
alias: Back Porch Brightness
initial_state: 'on'
trigger:
- platform: state
entity_id: input_slider.back_porch_light_brightness
action:
- service: light.turn_on
data_template:
entity_id: light.back_porch
brightness: '{{ states.input_slider.back_porch_light_brightness.state | int }}'
# Bathroom Brightness Slider - WORKING
- id: Bathroom Brightness Slider
alias: Bathroom Brightness
initial_state: 'on'
trigger:
- platform: state
entity_id: input_slider.bathroom_light_brightness
action:
- service: light.turn_on
data_template:
entity_id: light.bathroom
brightness: '{{ states.input_slider.bathroom_light_brightness.state | int }}'
# Dining Room Brightness Slider - WORKING
- id: Dining Room Brightness Slider
alias: Dining Room Brightness
initial_state: 'on'
trigger:
- platform: state
entity_id: input_slider.dining_room_light_brightness
action:
- service: light.turn_on
data_template:
entity_id: light.dining_room
brightness: '{{ states.input_slider.dining_room_light_brightness.state | int }}'
# Front Porch Brightness Slider - WORKING
- id: Front Porch Brightness Slider
alias: Front Porch Brightness
initial_state: 'on'
trigger:
- platform: state
entity_id: input_slider.front_porch_light_brightness
action:
- service: light.turn_on
data_template:
entity_id: light.front_porch
brightness: '{{ states.input_slider.front_porch_light_brightness.state | int }}'
# Office Brightness Slider - WORKING
- id: Office Brightness Slider
alias: Office Brightness
initial_state: 'on'
trigger:
- platform: state
entity_id: input_slider.office_light_brightness
action:
- service: light.turn_on
data_template:
entity_id: light.office
brightness: '{{ states.input_slider.office_light_brightness.state | int }}'
# Living Room Brightness Slider - WORKING
- id: Living Room Brightness Slider
alias: Living Room Brightness
initial_state: 'on'
trigger:
- platform: state
entity_id: input_slider.living_room_light_brightness
action:
- service: light.turn_on
data_template:
entity_id: light.living_room
brightness: '{{ states.input_slider.living_room_light_brightness.state | int }}'
# Bedroom Brightness Slider - WORKING
- id: Bedroom Brightness Slider
alias: Bedroom Brightness
initial_state: 'on'
trigger:
- platform: state
entity_id: input_slider.bedroom_light_brightness
action:
- service: light.turn_on
data_template:
entity_id: light.bedroom_2
brightness: '{{ states.input_slider.bedroom_light_brightness.state | int }}'
# Volume Adjust - Bathroom Chromecast (Part 1)
- id: Bathroom Chromecast Volume Slider
alias: bathroom_chromecast_adjust_volume
initial_state: 'on'
trigger:
- platform: state
entity_id: input_slider.bathroom_chromecast_volume_slider
action:
- service: media_player.volume_set
data_template:
entity_id: media_player.bathroom
volume_level: '{{ trigger.to_state.state }}'
# Volume Adjust - Bedroom Home (Part 1)
- id: Bedroom Home Volume Slider
alias: bedroom_room_home_adjust_volume
initial_state: 'on'
trigger:
- platform: state
entity_id: input_slider.bedroom_home_volume_slider
action:
- service: media_player.volume_set
data_template:
entity_id: media_player.bedroom_home
volume_level: '{{ trigger.to_state.state }}'
# Volume Adjust - Living Room Home (Part 1)
- id: Living Room Home Volume Slider
alias: living_room_home_adjust_volume
initial_state: 'on'
trigger:
- platform: state
entity_id: input_slider.living_room_home_volume_slider
action:
- service: media_player.volume_set
data_template:
entity_id: media_player.living_room_home
volume_level: '{{ trigger.to_state.state }}'
# Volume Adjust - Home Group (Part 1)
- id: All Google Homes Volume Slider
alias: all_google_homes_adjust_volume
initial_state: 'on'
trigger:
- platform: state
entity_id: input_slider.all_google_homes_volume_slider
action:
- service: media_player.volume_set
data_template:
entity_id: media_player.home_group
volume_level: '{{ trigger.to_state.state }}'
# Volume Adjust - All Devices Group (Part 1)
- id: All Devices Volume Slider
alias: all_devices_adjust_volume
initial_state: 'on'
trigger:
- platform: state
entity_id: input_slider.all_devices_volume_slider
action:
- service: media_player.volume_set
data_template:
entity_id: media_player.all_devices_group
volume_level: '{{ trigger.to_state.state }}'
# Volume Adjust - Living Room Home (Part 2)
- id: Bedroom Home Volume Slider part 2
alias: Living Roome Volume Slider part 2
initial_state: 'on'
trigger:
- platform: state
entity_id: media_player.living_room_home
action:
- service: input_slider.select_value
data_template:
entity_id: input_slider.living_room_home_volume_slider
value: '{{ states.media_player.living_room_home.attributes.volume_level }}'
# Volume Adjust - Bedroom Home (Part 2)
- id: Bedroom Home Volume Slider part 2
alias: Bedroom Home Volume Slider part 2
initial_state: 'on'
trigger:
- platform: state
entity_id: media_player.bedroom_home
action:
- service: input_slider.select_value
data_template:
entity_id: input_slider.bedroom_home_volume_slider
value: '{{ states.media_player.bedroom_home.attributes.volume_level }}'
# Volume Adjust - Home Group (Part 2)
- id: All Google Homes (Part 2)
alias: All Google Homes (Part 2)
initial_state: 'on'
trigger:
- platform: state
entity_id: media_player.home_group
action:
- service: input_slider.select_value
data_template:
entity_id: input_slider.all_google_homes_volume_slider
value: '{{ states.media_player.home_group.attributes.volume_level }}'
# Volume Adjust - All Devices Group (Part 2)
- id: All Devices Group Volume Slider (Part 2)
alias: All Devices Group Volume Slider (Part 2)
initial_state: 'on'
trigger:
- platform: state
entity_id: media_player.all_devices_group
action:
- service: input_slider.select_value
data_template:
entity_id: input_slider.all_devices_volume_slider
value: '{{ states.media_player.all_devices_group.attributes.volume_level }}'
# Volume Adjust - Bathroom Chromecast (Part 2)
- id: Bathroom Chromecast Volume (Part 2)
alias: Bathroom Chromecast Volume (Part 2)
initial_state: 'on'
trigger:
- platform: state
entity_id: media_player.bathroom
action:
- service: input_slider.select_value
data_template:
entity_id: input_slider.bathroom_chromecast_volume_slider
value: '{{ states.media_player.bathroom.attributes.volume_level }}'
####### TEST JOIN
# - id: Test Join
# alias: Test Join
# trigger:
# platform: state
# entity_id: input_boolean.activate_join
# to: 'on'
# action:
# service: notify.join
# data:
# target:
# - 'Phone'
# title: Test Notification From Home Assistant
# message: 'text/This is a test!!!'
Thanks!