Creating Packages

Just on a side note.
I don’t get notifications unless you ‘reply to me’ or tag me or ‘quote’ me.
Just replying to the thread means that ONLY the OP gets a notification (which is redundant as you are the OP). If you ‘just’ reply to the thread you are relying on someone scanning the forum and saying "uh !, i posted on that and there’s new postings. I wonder what they are ? "

thanks, and sorry for the newbie mistakes

No problem, I made the same.

@anon43302295 has a point, look into the issue he highlighted

Edit: The forum is warning me about our ‘bromance’ so I’ve edited a previous post.
If there isn’t a little pain in the learning and a little benefit at the end, then the lesson doesn’t ‘stick’ as well. You are making the effort and you are making mistakes, it’s all good. We’ve all been there, I still am there. Any day I don’t learn something is a wasted day. Anyone who never made a mistake, never made anything.
Keep on just as you are doing, you’ll get there.

A warning about packages and the gui editors - they don’t play nice together at the moment @finity has a method to allow you to use the gui editor to create automations (which go to /config/automation.yaml) but allows ha to read your packages too.
I’m just an old fart who has always written stuff by hand. Ask him if you can’t live without the gui.

Working on making changes to align with the suggestions earlier, then post either fixed or examples of the offending config, I think this way I might learn, albeit maybe the hard way!

Thank you to @finity, @Mutt, and @anon43302295 for the suggestions and examples, they helped me to fix the indentation issues in my yaml.

I spent quite a lot of time trying to resolve an issue which vsc suggested existed, only to realise it did not effect the code validation in HA. I get an error on homeassistant: in the form of incorrect type. Expected object spent ages looking for the cause. But ultimately it did not make a difference.

Nice clean config and now can focus on improvements / additions.

Following on from the discussion with @sparkydave, it does not seem to matter whether I have homeassistant: at the top of the package files, as I forgot to add it to one and it seems to function ok. I assume it would be mandatory if I included customize elements in the package?

Thanks again.

No, you only need to add the headers (keys) you need, that allow you to add the elements you need.
I think I have just 3 packages with that in (Cos I just don’t need it elsewhere) and as sparkydave says you can do a lot from the frontend now.
But if I ‘give’ you a package for (say) an alarm clock, then everything you need is in there (other than maybe sensor.time (that you can only have one of).

It is. Are you sure you don’t have the customization in a customize.yaml?

I get those all the time. I just ignore them. They are unavoidable if you have a conversation with someone and it’s not like you want to exclude other people.

1 Like

I thought about leaving the customisations in a customise file but as I have only a couple and specific to a function it was easier to move them. But I may revert if I implement more.

Hey, what about scenes ? I would like to use the build-in scene editor but I use packages ? So if i create a new scene the scene is in the scenes.yaml in the main config-folder. But if I want to include the scenes in Home Assistant there aren’t there

I think thats because i use packages

homeassistant:


  # Name of the location where Home Assistant is running
#  name: Home
  # Location required to calculate the time the sun rises and sets
#  latitude: 
#  longitude: 
  # Impacts weather/sunrise data (altitude above sea level in meters)
#  elevation: 0
  # metric for Metric, imperial for Imperial
#  unit_system: metric
  # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
#  time_zone: Europe/Berlin
  # Customization file
  customize: !include customize.yaml
   # Integrations folder
  packages: !include_dir_named integrations


In the doc it says scene-editor that I have to include it in my configuration.yaml but I cant because of the usage of packages

Of course you can.

Just put

scene: !include scenes.yaml

In your configuration.yaml

1 Like