Is this a valid configuration

Hi,

I have just started using the Sky Q integration from the HACS repository and I have generated switches to use with Alexa. I then added the command as per the help file to include the generated switches. However I already have a switch command in my configuration.yaml and when I also edited an existing switch the changes I made were not recognised. I then swapped the order around of the two switch commands and the last one seems to take priority. So my question is can you call switch: twice in the configuration.yaml and if not how do I include two files instead of just the last one.

I hope this makes sense, sorry I am not a coder.

switch:

  • platform: template
    switches: !include skyqLivingRoom.yaml
    switch: !include broadlink.yaml

In the above changes to broadlink.yaml are recognised

If I use

switch: !include broadlink.yaml
switch:

  • platform: template
    switches: !include skyqLivingRoom.yaml

Changes to broadlink.yaml are ignored

Thanks for any advice.

Please use the code formatting option for your pasted code, not quotations.

1 Like

To elaborate further on Toms note: if you use the wrong formatting type, you are destryoing the important part of your code. YAML, that is what is used in the configuration files, is very, very picky about indentation. If you use the “quotation” type, the forum uses it’s own rules, so the formatting of the YAMl gets lost => one (we) can’t see, if there’s something wrong with the code. :slight_smile:

But in theory, no, what you’re doing looks (can’t say for sure, the formatting you know :rofl:) not right. You can’t have it both ways. Either include a file under a domain (=switch) or use the file you’re in. But as with most things in life, there are numerous ways here, so you might be using packages and then it would be possible. :slight_smile:

In the end we need a properly formatted code and more information about your setup. :slight_smile:

And you might want to take a look at this:

@tom_l Nice drawing! :+1: :rofl:

Thanks Tom, I,m still learning. I’ll reformat.

Thanks Paddy,

I managed to combine the two files I had and just called the one file from configuration.yaml Check config passes and I can see the new switches and the edited one. I appreciate the pointers it certainly helped.

Paul.

1 Like