I am new to HA and setup a basic automation from one of the tutuorials on the HA website. Basically it dims my bedroom light when i play a moving. This works perfect. However if i try adding some more automation, it breaks my automation. I believe it a spacing issue. You can see below ### Not working ###To edit my Yaml files i am on Ubuntu and use notepadqq. Do you see any issues below? Also can you recommend an editor that does a good job with Yaml for is notepadqq ok for this?
Working
- platform: state
entity_id: media_player.gbox
from: 'playing'
condition:
- condition: state
entity_id: sun.sun
state: 'below_horizon'
action:
service: scene.turn_on
entity_id: scene.Bedroom_normal
- alias: âMedia player playingâ
trigger:- platform: state
entity_id: media_player.gbox
to: âplayingâ
condition: - condition: state
entity_id: sun.sun
state: âbelow_horizonâ
action:
service: scene.turn_on
entity_id: scene.Bedroom_dim
- platform: state
Not working
-
alias: Turn on kitchen lights when there is movement
trigger:- platform: state
entity_id: binary_sensor.ecolink_pir_motion_sensor_sensor_4_0
to: âonâ
action:
service: homeassistant.turn_on
entity_id: script.timed_lamp
script:
timed_lamp:
alias: âTurn on lamp and set timerâ
sequence:Cancel ev. old timers
- service: script.turn_off data: entity_id: script.timer_off
- service: light.turn_on
data:
entity_id: light.bathroom_light
Set new timer
- service: script.turn_on
data:
entity_id: script.timer_off
- platform: state
timer_off:
alias: âTurn off lamp after 10 minutesâ
sequence:
- delay:
minutes: 10
- service: light.turn_off
data:
entity_id: light.bathroom_light