I am trying to figure out why my HA isn’t reacting to my config files the way I expect.
I’ve got two things going one:
a) a Fan that should run for 2 minutes when a particular light is triggered (example from Motion detected -> lights on. no motion within 10mins, turn lights off )
- However, although the code does turn the fan on when I turn on the light, I don’t think the timer (defined in configuration.yaml) is ever activated, or at least, the fan doesn’t turn off as expected.
b) lights that should come on at bedtime don’t come on. For some reason, nothing seems to happen.
I am coming from Vera, and find the HA config a little steep to learn.
Thanks for any help!
Here is my automation.yaml
- id: bedtime_m_f
alias: ‘Turn off lights at bedtime M-F’
trigger:
platform: time
at: '22:00:00'
condition:
- condition: time
weekday:
- sun
- mon
- tue
- wed
- thu
action:
service: light.turn_off
entity_id: group.g_outdoor_lights
- id: bedtime_weekend
alias: ‘Turn off lights at bedtime - weekend’
trigger:
platform: time
at: '23:00:00'
condition:
- condition: time
weekday:
- fri
- sat
action:
service: light.turn_off
entity_id: group.g_outdoor_lights
- id: family_lamp_at_dusk
alias: ‘Family Room Lamp when the sun starts to dim’
trigger:
platform: numeric_state
entity_id: sun.sun
value_template: '{{ state.attributes.elevation }}'
below: 6
action:
service: light.turn_on
entity_id: group.g_outdoor_lights
- id: outdoor_lights_at_dusk
alias: ‘Outdoor lights on when the sun starts to dim’
trigger:
platform: numeric_state
entity_id: sun.sun
value_template: '{{ state.attributes.elevation }}'
below: 3.5
action:
service: light.turn_on
entity_id: group.g_outdoor_lights
## sensor.alarm_display - When switch.g_counter_fl turns on, turn on G-fan for 2 minutes
- id: g_fan_automation_on
alias: 'Fan on if counter lights on'
trigger:
platform: state
entity_id: switch.switch_8
to: 'on'
action:
service: timer.start
entity_id: timer.timer_g_fan
service: switch.turn_on
entity_id: switch.switch_9
- id: g_fan_automation_off
alias: 'Turn off lights at end of timer'
trigger:
platform: event
event_type: timer.finished
event_data:
entity_id: timer.timer_g_fan
action:
service: switch.turn_off
entity_id: switch.switch_9
and my configuration.yaml
homeassistant:
# Name of the location where Home Assistant is running
name: 638
# Location required to calculate the time the sun rises and sets
latitude: 47.7396
longitude: -122.3426
# Impacts weather/sunrise data (altitude above sea level in meters)
elevation: 129
# metric for Metric, imperial for Imperial
unit_system: imperial
# Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
time_zone: America/Los_Angeles
# Customization file
customize: !include customize.yaml
# Show links to resources in log and frontend
introduction:
# Enables the frontend
frontend:
# Enables configuration UI
config:
http:
# Secrets are defined in the file secrets.yaml
# api_password: !secret http_password
# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
# base_url: example.duckdns.org:8123
# Checks for available updates
# Note: This component will send some information about your system to
# the developers to assist with development of Home Assistant.
# For more information, please see:
# https://home-assistant.io/blog/2016/10/25/explaining-the-updater/
updater:
# Optional, allows Home Assistant developers to focus on popular components.
# include_used_components: true
# Discover some devices automatically
discovery:
# Allows you to issue voice commands from the frontend in enabled browsers
conversation:
# Enables support for tracking state changes over time
history:
# View all events in a logbook
logbook:
# Enables a map showing the location of tracked devices
map:
# Track the sun
sun:
# Weather prediction
sensor:
- platform: yr
- platform: command_line
name: cpu_temp
command: "cat /sys/class/thermal/thermal_zone0/temp"
# If errors occur, remove degree symbol below
unit_of_measurement: "°C"
value_template: '{{ value | multiply(0.001) | round(1) }}'
# Text to speech
tts:
- platform: google
# Cloud
cloud:
ios:
zwave:
usb_path: /dev/ttyACM0
network_key: "0x08, 0x06, 0x03, 0x04, 0x05, 0x06, 0x07, 0x02, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10"
alarmdecoder: ## !include alarm_decoder.yaml
device:
type: usb
##baudrate: 115200
##usb_path: /dev/ttyUSB0
panel_display: On
zones:
01:
name: 'Smoke Detector'
type: 'smoke'
rfid: '0123456'
02:
name: 'Front Door'
type: 'opening'
timer:
timer_g_fan:
duration: '00:02:00'
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
sensor: !include sensors.yaml
panel_iframe:
configurator:
title: Config-internal
icon: mdi:wrench
url: http://192.168.7.218:3218