I just installed Hass.io on a Ubuntu 64bit VirtualBox a few days ago and have been trying to get this one automation I found to work. I did a lot of Googling and I have a very basic grasp of formatting and such. All I’ve done outside of installing was link my Hue bridge and set my location for the weather.
Here’s my configuration.yaml
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
# Text to speech
tts:
- platform: google_translate
group: !include groups.yaml
script:
sunrise:
alias: Simulate sunrise
description: 'fade lights to simulate sunrise'
sequence:
- alias: Sun Bulb On
service: light.turn_on
data:
entity_id: light.bedroom
brightness_pct: 10
color_temp: 500
- delay:
seconds: 30
- alias: Sun Bulb On
service: light.turn_on
data:
entity_id: light.bedroom
brightness_pct: 20
color_temp: 465
- delay:
seconds: 30
- alias: Sun Bulb On
service: light.turn_on
data:
entity_id: light.bedroom
brightness_pct: 30
color_temp: 430
- delay:
minutes: 3
- alias: Sun Bulb On
service: light.turn_on
data:
entity_id: light.bedroom
brightness_pct: 40
color_temp: 395
- delay:
minutes: 3
- alias: Sun Bulb On
service: light.turn_on
data:
entity_id: light.bedroom
brightness_pct: 50
color_temp: 360
- delay:
minutes: 3
- alias: Sun Bulb On
service: light.turn_on
data:
entity_id: light.bedroom
brightness_pct: 60
color_temp: 330
- delay:
minutes: 3
- alias: Sun Bulb On
service: light.turn_on
data:
entity_id: light.bedroom
brightness_pct: 70
color_temp: 295
- delay:
minutes: 3
- alias: Sun Bulb On
service: light.turn_on
data:
entity_id: light.bedroom
brightness_pct: 80
color_temp: 260
- delay:
minutes: 3
- alias: Sun Bulb On
service: light.turn_on
data:
entity_id: light.bedroom
brightness_pct: 90
color_temp: 225
- delay:
minutes: 3
- alias: Sun Bulb On
service: light.turn_on
data:
entity_id: light.bedroom
brightness_pct: 100
color_temp: 185
input_boolean:
sunrise_enabled:
name: "Morning Sunrise"
initial: on
icon: mdi:weather-sunset
sunrise_weekend:
name: "Weekend Sunrise"
initial: off
icon: mdi:calendar-blank
input_datetime:
sunrise_time:
name: "Start sunrise at"
has_time: true
has_date: false
automation:
- alias: "Cool artificial sunrise"
trigger:
platform: template
value_template: "{{ states('sensor.time') ==(states.input_datetime.sunrise_time.attributes.timestamp | int | timestamp_custom('%H:%M', False)) }}"
condition:
- condition: state
entity_id: input_boolean.sunrise_enabled
state: 'on'
- condition: or
conditions:
- condition: state
entity_id: input_boolean.sunrise_weekend
state: 'on'
- condition: time
weekday:
- mon
- tue
- wed
- thu
- fri
action:
- service: script.turn_on
entity_id: script.sunrise
It’s an automation to make the lights gradually turn on at a set time, with controls for it on your dashboard. I’m not sure if this is the best way to do it, but after checking 5 different ones on Google it seemed like exactly what I was after.
using the file editor I got from the add-on store it finally got it to where it say’s my syntax is all correct. The way the automation’s controlled is you create a card and there are 3 entities that should show up in the drop down when you type sunrise when adding the entities to the new card. When I type sunrise into the entity box though nothing comes up. Just to see, added all 3 manually, these are the 3 that it shows should come up on the web site I found the tutorial on.
input_boolean.sunrise_enabled
input_datetime.sunrise_time
input_boolean.sunrise_weekend
and on my dashboard I get “Entity not available:” for all of them.
I see all 3 in the code, and from what I’m picked up, the scripting looks like it should be okay. All I can think of is the formatting’s off, but if it is I don’t see where. And if it’s something different I’m just lost. I copied the code from the web site with the tutorial. Outside of changing the light entries to my light name, it’s a line for line copy. I re-read the tutorial 3 times and went over the code line by line numerous times. No idea what I should be looking for. I want to learn how to write scripts from scratch, but that’s going to take me a good while. So in the mean time I’m trying to figure this out.
I know this is a very n00bish thing but after playing with it for 2 days I’m not seeming to make any progress and I’m out of ideas. So I thought I’d come ask for help.
If anyone wishes to help me out, thanks in advance.