(solved) Beginner need help!

Hello everyone, I’m still relatively new to home assistant, for about 3 months. In the beginning I often had to reinstall HA “incorrect configuration, problems with integrations, sometimes no backup, etc.”

Now I’ve worked my way up to the point where “I also make daily backups that are stored externally, I learned from mistakes”

Now I would like to know if there are still beginner errors in my configuration,

could you take a look and help me.
Thank you in advance

configuration.yaml

# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

# Text to speech
tts:
  - platform: google_translate
  
#######################################
#                                     #
#              INCLUDES               #
#     last file modify: 2023-01-12    #
#                             a.amend #
#######################################

# backup cleanup, discovery: not able to sort out to discovery.yaml
# discovery: !include discovery.yaml
# Kalender
# calendar: !include calendar.yaml
# Automatitonen
automation: !include automations.yaml
# Skripte
script: !include scripts.yaml
# Szenen
scene: !include scenes.yaml
# Groups
group: !include groups.yaml
# nextcloud
nextcloud: !include nextcloud.yaml
# homematic ccu2
homematic: !include homematic.yaml
# scrape, "moon, moonphase,"
scrape: !include scrape.yaml
# template sensors
template: !include template.yaml
# sensors
sensor: !include sensor.yaml

# Systemgesundheit
system_health:
# Mobile Aplikationen
mobile_app: 
# Browser
browser:
# Sternzeichen
zodiac:
# Sonne
sun:

# homeassistant
homeassistant:
  customize_glob:
  
# IR Stromzähler total
    sensor.stromnetz_mt681_gesamt:
      unit_of_measurement: "kWh"
      device_class: energy
      state_class: total_increasing
      last_reset: 1970-01-01T00:00:00+00:00

# IR Stromzähler total Tarif_1
    sensor.stromnetz_mt681_tarif_1:
      unit_of_measurement: "Wh"
      device_class: energy
      state_class: total_increasing
      last_reset: 1970-01-01T00:00:00+00:00

# IR Stromzähler aktuell
    sensor.stromnetz_mt681_aktuelle_last: 
      unit_of_measurement: "Wh"
      device_class: energy
      state_class: total
      last_reset: 1970-01-01T00:00:00+00:00

# Buderus KM200 Power kWh
    sensor.recording_ractualpower:
      unit_of_measurement: "kWh"
      device_class: gas
      state_class: total_increasing
      last_reset: 1970-01-01T00:00:00+00:00

# Buderus KM200 HK kWh
    sensor.recording_ractualchpower:
      unit_of_measurement: "kWh"
      device_class: gas
      state_class: total_increasing
      last_reset: 1970-01-01T00:00:00+00:00

# Buderus KM200 WW kWH
    sensor.recording_ractualdhwpower:
      unit_of_measurement: "kWh"
      device_class: gas
      state_class: total_increasing
      last_reset: 1970-01-01T00:00:00+00:00

# Gas_Verbrauch Buderus
    sensor.buderus_gas:
      unit_of_measurement: "m³"
      device_class: gas
      state_class: total_increasing
      last_reset: 1970-01-01T00:00:00+00:00
      
# clenup snapshot service for backup
discovery:
clean_up_snapshots_service:
  host: http://192.168.178.230:8123
  token: !secret backup_tocken
  number_of_snapshots_to_keep: 8

# Kalender
calendar:
  - platform: caldav
    username: !secret nextcloud_username
    password: !secret nextcloud_password
    url: !secret nextcloud_url

sensor.yaml

# sensors

# Einkaufsliste Bring!
  - platform: command_line
    scan_interval: 10
    name: Shopping List
    unique_id: sensor.shopping_list
    command: python3 /config/python_scripts/shopping_list_json.py
    json_attributes:
      - not_complete
      - content
    value_template: "{{ value_json.state }}"

# email
  - platform: imap
    name: imap_state_req
    server: imap.gmx.net
    port: 993
    username: !secret email_username
    password: !secret email_password

# Rspberry Pi 4
  - platform: systemmonitor
    resources:
      - type: disk_use_percent
        arg: /config
      - type: disk_use
      - type: disk_free
      - type: memory_use_percent
      - type: memory_use
      - type: memory_free
      - type: swap_use_percent
      - type: swap_use
      - type: swap_free
      - type: load_1m
      - type: load_5m
      - type: load_15m
      - type: network_in
        arg: eth0
      - type: network_out
        arg: eth0
      - type: throughput_network_in
        arg: eth0
      - type: throughput_network_out
        arg: eth0
      - type: packets_in
        arg: eth0
      - type: packets_out
        arg: eth0
      - type: ipv4_address
        arg: eth0
      - type: ipv6_address
        arg: eth0
      - type: processor_use
      - type: processor_temperature
      - type: last_boot

# Date & Time
  - platform: time_date
    display_options:
      - 'time'
      - 'date'
      - 'date_time'
      - 'date_time_utc'
      - 'date_time_iso'
      - 'time_date'
      - 'time_utc'
      - 'beat'

templat.yaml

# tamplate

# Formatierte Zeit und Datum
  - sensor:
    - name: "Datum Uhrzeit"
      unique_id: datum_uhrzeit
      state: >
        {% set wochentag = ["Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag", "Sonntag"] %}
        {% set monat = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"] %}
        {% set wochentag = wochentag[now().weekday()] %}
        {% set monat = monat[now().month - 1] %} {{ wochentag }}, der {{ now().day }} {{ monat }} {{now().year}}, {{now().timestamp() | timestamp_custom('%-X')}} Uhr 
      icon: "mdi:calendar-clock"

# Formnatirte Uhrzeit Reichelzer Zeit "Es ist kurz vor virtel 8"
  - sensor:
    - name: "Reichelzer Uhrzeit"
      unique_id: reichelzer_uhrzeit
      state: >
          {% set hour = now().strftime("%-H") | int %}
          {% set minute = now().strftime("%-M") | int %}		
          {% set hour = hour if minute < 8 else hour + 1 if hour + 1 < 24 else 0 %}
          {% set hour = hour if hour < 13 and hour > 0 else hour - 12 if hour > 0 else 12 %}
          {% set i = minute // 15 - 1 %}
          {% set quarters = ['viertel', 'halb', 'dreiviertel' ] %}
          {% set quarter = quarters[i] if i >= 0 else '' %}
          {% set remainder = minute % 15 %}
          {% set end = 'Uhr' if i == -1 and remainder in [0,1] or i == 2 and remainder == 14 else '' %}
          {% set shortly = 'kurz' if remainder not in [14,0,1] else '' %}
          {% if remainder == 14 %}
            {% set quarter = quarters[i+1] if i + 1 < quarters | length else '' %}
          {% endif %}
          {% set beforeafter = '' %}
          {% if shortly %}
            {% set beforeafter = 'nach' if remainder in range(2,8) else 'vor' %}
            {% if beforeafter == 'vor' %}
              {% set quarter = quarters[i+1] if i + 1 < quarters | length else '' %}
            {% endif %}
          {% endif %}
          {% set items = ['Es ist', shortly, beforeafter, quarter, hour | string , end] %}
          {{ items | reject('eq','') | list | join(' ') }}
      icon: "mdi:calendar-clock"

# Formatierte Zeit "Di, 23 Jan 2023"
  - sensor:
    - name: "Formatierte Zeit"
      unique_id: formatierte_uhrzeit
      state: >
          {% set wochentag = ["Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"] %}
          {% set monat = ["Jan", "Feb", "Mär", "Apr", "Mai", "Jun", "Jul", "Aug", "Sep", "Okt", "Nov", "Dez"] %}
          {% set wochentag = wochentag[now().weekday()] %}
          {% set monat = monat[now().month - 1] %}
          {{ wochentag }}, {{ now().day }} {{ monat }} {{now().year}}, {{ now().timestamp() | timestamp_custom('%H:%M') }}
      icon: "mdi:calendar-clock"
#        icon_template: mdi:calendar-clock

# Mondphase Bild_version_01
  - sensor:
    - name: 'der Mond'
      unique_id: der_mond
      state: >
        {% if is_state('sensor.moon_phase', 'new_moon') %}
           Neumond
        {% elif is_state('sensor.moon_phase', 'waxing_crescent') %}
           Zuhnemender Sichelmond     
        {% elif is_state('sensor.moon_phase', 'first_quarter') %}
           Zunehmender Halbmond
        {% elif is_state('sensor.moon_phase', 'waxing_gibbous') %}
           Zuhnemender Dreiviertelmond
        {% elif is_state('sensor.moon_phase', 'full_moon') %}
           Vollmond
        {% elif is_state('sensor.moon_phase', 'waning_gibbous') %}
           Abnehmender Deiviertelmond
        {% elif is_state('sensor.moon_phase', 'last_quarter') %}
           Abnehmender Halbmond
        {% elif is_state('sensor.moon_phase', 'waning_crescent') %}
           Abnehmender Sichelmond
        {% endif %}
      picture: >
        {% set state = states('sensor.moon_phase') %}
        /local/moon_phases/{{state}}.png

# Mondphase Bild_version_02 neu
  - sensor:
    - name: 'mein Mond'
      unique_id: mein_mond
      state: >
        {% set phase = states('sensor.moon_phase') %}
        {% set mapper = {'new_moon':'Neumond',
                         'waxing_crescent':'zunehmender Mond',
                         'first_quarter':'Erstes Viertel',
                         'waxing_gibbous':'Halbmond',
                         'full_moon':'Vollmond',
                         'waning_gibbous':'Abnehmender Mond',
                         'last_quarter':'Letztes Viertel'} %}
        {{mapper.get(phase,'Aschgrauer Mond')}}
      picture: >
        {% set state = states('sensor.moon_phase') %}
        /local/moon_phases/{{state}}.png

# Sternzeichen Elemente
  - sensor:
    - name: 'Sternzeichen Element'
      unique_id: zodiac_element
      state: >
        {% set cond = state_attr('sensor.zodiac', 'element') %}
        {% if cond == 'earth' %}
          Erde
        {% elif cond == 'fire' %}
          Feuer
        {% elif cond == 'air' %}
          Luft
        {% elif cond == 'water' %}
          Wasser
        {% endif %}
      picture: >
        {% set state = state_attr('sensor.zodiac', 'element') %}
        /local/zodiac/element/{{state}}.png

# Sternzeichen Modalität
  - sensor:
    - name: 'Sternzeichen Modalität'
      unique_id: zodiac_modality
      state: >
          {% set cond = state_attr('sensor.zodiac', 'modality') %}
          {% if cond == 'cardinal' %}
            Kardinalzeichen
          {% elif cond == 'fixed' %}
            Feste Zeichen
          {% elif cond == 'air' %}
            Bewegliche Zeichen
          {% endif %}

# Sternzeichen Energie
  - sensor:
    - name: 'Sternzeichen Energie'
      unique_id: zodiac_enegrie
      state: >
          {% if is_state('sensor.zodiac', 'aries') %}
             Männlich
          {% elif is_state('sensor.zodiac', 'taurus') %}
             Weiblich     
          {% elif is_state('sensor.zodiac', 'gemini') %}
             Männlich
          {% elif is_state('sensor.zodiac', 'cancer') %}
             Weiblich
          {% elif is_state('sensor.zodiac', 'leo') %}
             Männlich
          {% elif is_state('sensor.zodiac', 'virgo') %}
             Weiblich
          {% elif is_state('sensor.zodiac', 'libra') %}
             Männlich
          {% elif is_state('sensor.zodiac', 'scorpio') %}
             Weiblich
          {% elif is_state('sensor.zodiac', 'sagittarius') %}
             Männlich     
          {% elif is_state('sensor.zodiac', 'capricorn') %}
             Weiblich
          {% elif is_state('sensor.zodiac', 'aquarius') %}
             Männlich
          {% elif is_state('sensor.zodiac', 'pisces') %}
             Weilich
          {% endif %}
      picture: >
        {% set state = states('sensor.zodiac') %}
        /local/zodiac/energie/{{state}}.png

# RNC Listen Lukify
  - sensor:
    - name: "RNC Helferliste"
      unique_id: rnc_helferliste
      state: >
        {{ states('input_text.rnc_helfer') }}
      picture: /local/icon/rnc.png

# Buderus Gas gesamt
  - sensor:
    - name: "Buderus Gas"
      device_class: "gas"
      unit_of_measurement: "m³"
      state: >
        {% set kwh = states('sensor.recording_ractualpower') | float %}
        {% set normdichte_value = states('input_number.gas_normdichte') | float %}
        {% set mengengewichtet_value = states('input_number.gas_mengengewichtet') | float %}
        {{ '%.4f' | format( kwh/(normdichte_value * mengengewichtet_value) ) | round(4) }}

# Buderus Gas Heizkreis
  - sensor:
    - name: "Buderus HK Gas"
      device_class: "gas"
      unit_of_measurement: "m³"
      state: >
        {% set kwh = states('sensor.recording_ractualchpower') | float %}
        {% set normdichte_value = states('input_number.gas_normdichte') | float %}
        {% set mengengewichtet_value = states('input_number.gas_mengengewichtet') | float %}
        {{ '%.4f' | format( kwh/(normdichte_value * mengengewichtet_value) ) | round(4) }}

# Buderus Gas Warmwasser
  - sensor:
    - name: "Buderus WW Gas"
      device_class: "gas"
      unit_of_measurement: "m³"
      state: >
        {% set kwh = states('sensor.recording_ractualdhwpower') | float %}
        {% set normdichte_value = states('input_number.gas_normdichte') | float %}
        {% set mengengewichtet_value = states('input_number.gas_mengengewichtet') | float %}
        {{ '%.4f' | format( kwh/(normdichte_value * mengengewichtet_value) ) | round(4) }}

Your config looks :+1:
Also if you don’t want to make daily backups manually, then use Google drive backup for hass. You can set it up to upload a full backup one a day at like 12 am, or something like that

John, thanks for your feedback :fu:

Currently, to feel safe “and trust my self”, I’m copying the nightly backup manually to my NAS, this should be done in the next few days by the “Samba Backup” integration.
Yes, I’ve also looked at the google drive backup, but I don’t want to save my backup on the cloud, but it’s more to do with the fact that I decided years ago for Nextcloud, and now for home assistant instead of various cloud-dependent sart home solutions.

But thanks again for looking at my configurations. That gives me a good feeling to continue from here.

Got it, probably a little smarter to keep a local copy as well, thanks for the idea :+1:

Yeah the Samba backup addon is a great solution that works perfectly. Highly recommended.