Updated Sensor YAML for 2023/24: Adding National Grid’s DFS Dates to Home Assistant

You may also like...

6 Responses

  1. Jason says:

    Hi Jamie,

    I’m relatively new to HA and trying to get packages setup and working for the first time.

    When I first tried to follow your guide I got an invalid slug error message when I tried to restart HA. I think I have fixed that: in the text in your article it says “The code below should be placed in file called national_grid_dfs–202324.yaml located” which I copied and pasted but I think it should be an underscore not a hyphen/dash before the 202324 as per line 1 of the YAML?

    Anyway, that got rid of that error for me. Now when I try to restart HA I get a different error message: “Failed to reload configuration exceptions must derive from BaseException”

    I didn’t have a homeassistant: block at the start of my config.yaml, the first section was default_config: so I just inserted the following ahead of it

    homeassistant:
    packages: !include_dir_named packages/

    Any ideas?

    Many thanks for the blog & keep up the good work!

    • Jamie says:

      Assuming you’re using a folder called packages located in the same directory as the config.yaml file, then the following should work at the beginning of the config file:

      homeassistant:
      packages: !include_dir_merge_named packages/

      Regarding the difference in names, as I’ve used dir_merge_named rather than dir_merged, it means that it ignores the folder name and uses the specified name at the top of the package file to reference sensors etc. This may be why I didn’t spot the difference in names!

  2. marc says:

    I have just set this up now, after an event. It has not created any sensors in home assistant that I can find. I am looking in developer tools for sensor.2324_national_grid_eso_latest_event_dfs_start. Is this expected behavior and will create them once a session is planned or is this an error on my part?

    • Jamie says:

      Hi marc – it should create the sensor once you’ve restarted HA / reloaded the yaml, however the sensor won’t have a value until the next session is posted.

  3. Bruce says:

    Thanks !

  4. Thomas says:

    Thank you very much for this!

Leave a Reply

Your email address will not be published. Required fields are marked *