https://github.com/benjamin-dcs/home-assistant
Repository of some of my automations, integrations, scripts and other HA related code.
https://github.com/benjamin-dcs/home-assistant
Last synced: 5 months ago
JSON representation
Repository of some of my automations, integrations, scripts and other HA related code.
- Host: GitHub
- URL: https://github.com/benjamin-dcs/home-assistant
- Owner: benjamin-dcs
- Created: 2024-08-06T12:10:10.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2024-11-21T14:23:38.000Z (over 1 year ago)
- Last Synced: 2025-03-08T23:47:35.547Z (about 1 year ago)
- Homepage:
- Size: 211 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
README
In this repository I provide Automations, Integrations, Scripts and other files for Home Assistant.
### Notes
- The code in this repo is often a slightly modified (and untested) version of my personal version. In case of any issues, feel free to create an [issue](https://github.com/benjamin-dcs/home-assistant/issues)
- As I am Dutch, some files will contain Dutch text. My guess is that most of you should be able to find your way to Google Translate ;)
# Table of Contents
- [Automations](#automations)
- [Birthday Notifier](#birthday-notifier)
- [Notification Action Handler](#notification-action-handler)
- [Purge Entities](#purge-entities)
- [Robust Light Motion Controller](#robust-light-motion-controller)
- [Addons](#addons)
- [Multiple 'Official Zigbee2MQTT Home Assistant addons'](#multiple-official-zigbee2mqtt-home-assistant-addons)
- [Integrations](#integrations)
- [File++](https://github.com/benjamin-dcs/File-plusplus)
- [Itho WiFi Add-on (Sensor Integration)](https://github.com/jasperslits/haithowifi/)
- [Scripts](#scripts)
- [Notify Me](#notify-me)
- [Get ChatGPT Response](#get-chatgpt-response)
- [Set Input Text with ChatGPT](#set-input-text-with-chatgpt)
- [Snippets](#snippets)
- [ChatGPT TTS Goodbye Message 🇳🇱](#chatgpt-tts-goodbye-message-)
- [Error Handling for a Wait For Trigger Action](#error-handling-for-a-wait-for-trigger-action)
- [Dashboard cards](#dashboard-cards)
- [Afvalwijzer Card 🇳🇱](#afvalwijzer-card-)
- [ApexCharts Sunrise Sunset](#apexcharts-sunrise-sunset)
- [Button Card Header Button](#button-card-header-button)
- [Compact Energy Card](#compact-energy-card)
- ESPHome
- [Custom Zuidwijk doorbell firmware](https://github.com/benjamin-dcs/esphome-doorbell)
# [Automations](automations)
### [Birthday Notifier](automations/birthday_notifier.yaml)
Uses a Home Assistant calender to send several notifications for someone's birthday. For Calendar events ending with `(YYYY)` (including the brackets) the age is calculated and added to the notification.
**Features:**
- Sends a notification at 12:00 **_2 days_** prior to the birthday
- Sends a notification at 12:00 **_1 day_** prior to the birthday
- Sends a notification **_every hour_**, starting at day of birth until the notification is _Marked as done_ (You have send a celebration message to the person 🎉).
**Prerequisites:**
- Switch Helper: input_boolean.birthday_celebration_sent
**Dependencies:**
- Uses the [`Notify Me`](scripts/notify_me.yaml) script to send the notifications
- Uses the [`Notification Action Handler`](automations/notification_action_handler.yaml) automation to handle the _'Mark as done'_ action
### [Notification Action Handler](automations/notification_action_handler.yaml)
Generic Automation to handle all my [Actionable Notifications](https://companion.home-assistant.io/docs/notifications/actionable-notifications/).
### [Purge Entities](automations/purge_entities.yaml)
Simple automation to purge entites after 1, 3 or 7 days.
**Tip!** Use a tool like [DbStats](https://github.com/jehy/hass-addons/tree/master/dbstats) to analyse your Home Assistant Database. Use the automation for entities that use a lot of disc-space to keep your database as small as possible.
### [Robust Light Motion Controller](automations/robust_light_motion_controller.yaml)
Robust automation to control a light based on motion and illuminance.
**Features:**
- Keep the light on for xx seconds (input_number.illuminace_threshold_motion_sensors) after no motion is detected anymore
- Multiple short-running trigger to turn on and off the light. No waiting (running automations) between turn on and turn off.
- Will keep the light and on reset the timer when motion is detected again (between 'no motion detected' and 'turn light off')
- Turn light off when HA restarts
**Prerequisites:**
- Timer Helper: timer.light_turn_off
- Input Number Helper: input_number.illuminace_threshold_motion_sensors
# Addons
### Multiple 'Official Zigbee2MQTT Home Assistant addons'
Multiple forks from the [`Official Zigbee2MQTT Home Assistant addon`](https://github.com/zigbee2mqtt/hassio-zigbee2mqtt) for running multiple coordinators. The forks are automatically synced with the base repository.
- https://github.com/multi-z2m-1/hassio-zigbee2mqtt
- https://github.com/multi-z2m-2/hassio-zigbee2mqtt
- https://github.com/multi-z2m-3/hassio-zigbee2mqtt
- https://github.com/multi-z2m-4/hassio-zigbee2mqtt
- https://github.com/multi-z2m-5/hassio-zigbee2mqtt
- https://github.com/multi-z2m-6/hassio-zigbee2mqtt
- https://github.com/multi-z2m-7/hassio-zigbee2mqtt
- https://github.com/multi-z2m-8/hassio-zigbee2mqtt
- https://github.com/multi-z2m-9/hassio-zigbee2mqtt
- https://github.com/multi-z2m-10/hassio-zigbee2mqtt
I'm able to succesfully add multiple repositories in the addons store:

For further instructions you can follow these Youtube tutorials. For the url's use the list above:
- https://www.youtube.com/watch?v=QOx733CU1p8
- https://www.youtube.com/watch?v=ZBbl0I-Zpuk
# [Scripts](scripts)
### [Notify Me](scripts/notify_me.yaml)
Provides a user friendly (visual editor) interface to send a notification to one or multiple notification providers, including Home Assistant Persistent Notifications.
**Features:**
- (Multi-)Selector for Notification Service(s)
- Templatable message field
- Templatable title field
- Data object
- Templatable url field
**Screenshot:**

### [Get ChatGPT Response](scripts/get_chatgpt_response.yaml)
Provides a user friendly (visual editor) interface to get a ChatGPT response.
**Features:**
- Templatable prompt field
- Selector for language
- Templatable instruction field
- Selector for ChatGPT model. The model(s) should be exactly the same as your OpenAI Conversation entity. For example model `gpt_4o_mini` uses `conversation.gpt_4o_mini` as conversation agent.
**Screenshot:**

### [Set Input Text with ChatGPT](scripts/set_input_text_with_chatgpt.yaml)
In the majority of my use-cases for a ChatGPT response, I store the result in a Text-Helper. I then use this Text-Helper as the source for my Automation/Script when it runs. At the end of the Automation/Script, I run this `Set Input Text with ChatGPT`-script to renew the Text-Helper. This has two advantages:
- No extra wait-time from ChatGPT before I need the response. For example, in my doorbell automation I want the notifcation to be send as quickly as possible.
- When ChatGPT isn't responding for whatever reason, my automation/script will still continue to run because the text is already stored.
**Features:**
- Templatable prompt field
- Selector for language
- Templatable instruction field
- Selector for ChatGPT model.
- Entity-Selector
- Remove First And Last Quotes Switch. For some prompts, ChatGPT's response is quoted. This option removes the first and last quote from the response.
**Screenshot:**

**Dependencies:**
- Uses the [`Get ChatGPT Response`](scripts/get_chatgpt_response.yaml) script to generate the ChatGPT response
# [Snippets](snippets)
### [ChatGPT TTS Goodbye Message 🇳🇱](snippets/chatgpt_goodbye.yaml)
Genereert ludieke teksten met ChatGPT voor je smart speaker om af te spelen om het moment dat je 'afsluit'
Geeft leuke teksten als:
- Dat was weer een geweldig moment met mij. Vergeet niet, zonder mij is je leven gewoon een beetje minder leuk. Tot ziens!
- Nou, wat een eer dat je mij gaat uitschakelen. Geniet van de stilte, ik weet dat je me mist.
- Dank voor je gezelschap! Denk aan me als je weer in de stilte van je eigen keuzes zit. Tot nooit!
- Tot de volgende keer, wanneer je weer mijn geniale stem nodig hebt. Vergeet me niet te missen!
- Bedankt voor het luisteren, maar ik moet je verlaten. Jij hebt tenslotte ook rust nodig van mijn genialiteit. Tot nooit!
**Dependencies:**
- Uses the [`Get ChatGPT Response`](scripts/get_chatgpt_response.yaml) script to generate the ChatGPT response
- Uses the [`Set Input Text with ChatGPT`](scripts/set_input_text_with_chatgpt.yaml) script to set the value of a Text Helper based on a ChatGPT prompt
### [Error Handling for a Wait For Trigger Action](snippets/error_handling_wait_for_trigger.yaml)
Snippet with a _success_ and _fail_ path for a [`wait for trigger`](https://www.home-assistant.io/docs/scripts/#wait-for-a-trigger) action
# [Dashboard cards](dashboard)
### [Afvalwijzer Card 🇳🇱](dashboard/afvalwijzer.yaml)
_Based on other cards from the community. I improved the readable text._

**Features:**
- Uses `auto-entities` card from HACS to **sort** the upcoming dates for the HACS `afvalwijzer` integration
- Readable (🇳🇱) sentence for the upcoming pickup dates
- Vandaag
- Morgen
- Overmorgen
- Aanstaande ``
- Volgende week ``
- `` over `` week/weken
**Prerequisites:**
- auto-entities card from HACS:
[](https://my.home-assistant.io/redirect/hacs_repository/?repository=https%3A%2F%2Fgithub.com%2Fthomasloven%2Flovelace-auto-entities&category=Dashboard&owner=Thomas+Lov%C3%A9n+)
### [ApexCharts Sunrise Sunset](dashboard/apexcharts_sunrise_sunset.yaml)

**Features:**
- Adjust the begin and end of the x-axis of your ApexChart to the sunrise and sunset times
**Prerequisites:**
- Config Template Card from HACS:
[](https://my.home-assistant.io/redirect/hacs_repository/?owner=Ian+Richardson&repository=https%3A%2F%2Fgithub.com%2Fiantrich%2Fconfig-template-card&category=Dashboard)
### [Button Card Header Button](dashboard/button_card_header_button.yaml)

### [Compact Energy Card](dashboard/compact_energy_card.yaml)
Probably requires some tweaking of the `grid-template-columns` percentages in order to get right on your own dashboard/screen

**Prerequisites:**
- card-mod from HACS:
[](https://my.home-assistant.io/redirect/hacs_repository/?repository=https%3A%2F%2Fgithub.com%2Fthomasloven%2Flovelace-card-mod&owner=Thomas+Lov%C3%A9n+&category=Dashboard)
- layout-card from HACS:
[](https://my.home-assistant.io/redirect/hacs_repository/?repository=https%3A%2F%2Fgithub.com%2Fthomasloven%2Flovelace-layout-card&owner=Thomas+Lov%C3%A9n+&category=Dashboard)
# Support