{"id":22352097,"url":"https://github.com/bertreb/plafonds","last_synced_at":"2025-10-26T01:06:57.948Z","repository":{"id":143812005,"uuid":"585605028","full_name":"bertreb/plafonds","owner":"bertreb","description":"Home-assistant python script for the Dutch energy plafonds in 2023","archived":false,"fork":false,"pushed_at":"2023-01-08T07:26:45.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-26T12:11:25.897Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bertreb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-05T15:44:25.000Z","updated_at":"2023-01-05T15:45:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"afd0afe6-fa27-4c77-bc14-278f6b517ad2","html_url":"https://github.com/bertreb/plafonds","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bertreb/plafonds","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertreb%2Fplafonds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertreb%2Fplafonds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertreb%2Fplafonds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertreb%2Fplafonds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bertreb","download_url":"https://codeload.github.com/bertreb/plafonds/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bertreb%2Fplafonds/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":281044088,"owners_count":26434565,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-25T02:00:06.499Z","response_time":81,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-04T12:17:08.576Z","updated_at":"2025-10-26T01:06:57.942Z","avatar_url":"https://github.com/bertreb.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Dutch energy plafonds\nHome-assistant python script for the Dutch energy plafonds in 2023.\n\nThis script can generate 6 todays plafonds for gas and electricity. \n- gas, today\n- gas, today - cummulative for the month\n- gas, today - cummulatief for the year\n- electricity, today\n- electricity, today - cummulative for the month\n- electricity, today - cummulatief for the year\n\nYou can select which of the plafond you want to use.\n\nInstructions for using this script\n1. Put the script 'plafond.py' in the HA directory /config/python_scripts (create, if it doesn't exist)\n2. Add the content of 'services.yaml' to the file 'services.yaml' in the HA directory /config/python_scripts\n3. Reload the 'python_script' in HA (development tool-\u003eyaml-configuration -\u003e reload python scripts)\n4. Create the plafond sensors you want. I used a template sensor with the following structure for the daily gas plafond (template.yaml)\n```\n- sensor:\n  - name: gasplafond dag\n    unit_of_measurement: \"m³\"\n    icon: \"mdi:fire\"\n    device_class: gas\n    state: \u003e\n      {% if states('sensor.gasplafond_dag')|float(0) \u003e 0 %}\n        {{ '{:.2f}'.format(states('sensor.gasplafond_dag')|float(0)) }}\n      {% endif %}\n```\nThis way you can format the presentation in the dashboard (2 decimals in the case) and prevent 0's in the history due to unknown values on startup.\n\nDon't forget to put an include to template.yaml in your config.yaml. This is one way to do this:\n```\ntemplate: !include template.yaml\n```\n\n5. Create and automation the runs every day just after midnight, runs on reload of the template sensors or automations and restart of HA.\n```\nalias: plafonds update\ndescription: \"\"\ntrigger:\n  - platform: event\n    event_type: event_template_reloaded\n    event_data: {}\n  - platform: event\n    event_type: automation_reloaded\n    event_data: {}\n  - platform: homeassistant\n    event: start\n  - platform: time\n    at: \"00:01:00\"\ncondition: []\naction:\n  - service: python_script.plafonds\n    data:\n      gasplafond_dag: sensor.gasplafond_dag\n      gasplafond_maand_cummulatief: sensor.gasplafond_maand\n      gasplafond_jaar_cummulatief: sensor.gasplafond_dag_cummulatief\n      electriciteitplafond_jaar_cummulatief: sensor.electriciteitsplafond_maand_cummulatief\n      electriciteitplafond_maand_cummulatief: sensor.electriciteitsplafond_maand\n      electriciteitplafond_dag: sensor.electriciteitsplafond_dag\nmode: restart\n```\nThe example above is with all the 6 sensors. Use in the data list only the sensor entities you have created.\n\n6. Reload the automation (development tool-\u003eyaml-configuration -\u003e reload automations)\n7. The sensor values should be updated to todays plafond values\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertreb%2Fplafonds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbertreb%2Fplafonds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbertreb%2Fplafonds/lists"}