Richdem
(Richard Carter)
April 19, 2019, 11:52pm
1
Hi All,
I have been migrating all my lights over from my Wink Hub 2 directly to HA. I am trying to recreate the scenes I had in my Wink App. Here’s what I have done:
I created a scene.yaml then linked it to my config.yaml with the following:
scene: !include scene.yaml (I believe this is a way of keeping the config.yaml clean)
In the scene.yaml I have 2 entries but I can only see the 2nd when I restart HA.
name: Office Warm
entities:
light.office_table:
state: true
kelvin: 2700
brightness_pct: 50
light.office_lamp:
state: true
kelvin: 2700
brightness_pct: 50
name: Office Daylight
entities:
light.office_table:
state: true
kelvin: 5000
brightness_pct: 100
light.office_lamp:
state: true
kelvin: 5000
brightness_pct: 100
When I added the 1st scene on it’s own it worked. Have I got the formatting wrong? I thought I would start with something simple lol
The code needs to be formatted so we can see how it looks in your file. Look at the blue section at the top of the page for an example.
Paste > select > click
Richdem
(Richard Carter)
April 20, 2019, 12:00am
3
Sorry about that, I did copy it directly from notepad ++ but it didn’t retain the formatting. I have been trying different names that is why it’s different from what I posted just now
It will never retain the formatting. There is an example at the top of the page for future reference.
Each scene will need a ‘-’ to seperate them.
I think you might have to have a -
infront of each one’s name?
I’m using scene: !include_dir_merge_list Scenes/
and have a Scenes.yaml in there, which contains:
- name: going_to_bed
entities:
XXXXX
- name: movie
entities:
XXXXX
Etc.
I do not believe light
has an attribute called state
Use three “`” marks at the start and end of your code blocks
```
CODE
```
will be formatted as
CODE
It might not, but I use this in a few of my scenes, and it works:
light.inovelli_nzw31_dimmer_level_2:
state: true
brightness: 30
Richdem
(Richard Carter)
April 20, 2019, 12:19am
9
This works without issues
If I put the following I get an error when I check the config
Sorry if I am being a tad stupid here, I am on a steep learnng curve lol
That formatting still isn’t quite right. Take a look at the formatting in this scenes file .
After you put - name: XXX
everything else must be indented by two spaces to follow the pattern (since -
adds two spaces).
Yours would look like this:
Richdem
(Richard Carter)
April 20, 2019, 12:47am
11
OK let me give it another try
Thank you for the help
Richdem
(Richard Carter)
April 20, 2019, 12:53am
12
Success ! It was the formatting after all
Thank you, I have accomplished a great deal in the last 2 weeks and learnt even more thanks to this great community.
1 Like
123
(Taras)
April 20, 2019, 12:25pm
13
I’ve used Notepad++ for many years and still use it for general text editing. However, for editing Home Assistant’s configuration files, I’ve switched to Visual Studio Code . I suggest you consider using it as well to make life easier when configuring Home Assistant.
There are many plugins available. I use one to check YAML formatting (YAML Language Support ) and another specifically designed for Home Assistant called Home Assistant Config Helper
Here are your scenes with all indentation errors underlined with a wavy line (that’s automatically done by the YAML checker).
After being properly formatted the wavy underlining disappears.
VS Code supports themes so if you don’t like the appearance of what I’m using (One Dark Pro ) you can easily replace it with another theme.
Richdem
(Richard Carter)
April 20, 2019, 1:38pm
14
Thank you for the tip,
I will certainly look into this. Formatting the config files is extremely important as I have learnt lol