Konfiguration von Home Assistent

Contents

HA Backup

Befindet sich auf der NAS 2QNAP
Data/Documente/Backup/HomeAssistent_PRD

Shelly Konfiguration für HA

Den Shelly mit der HandyApp Grund Konfigurieren

Bei der Gen2 und Gen 3 muss
Enable CoIoT
CoIoT peer: 192.168.178.xx:5683
nicht mehr eingerichtet werden.

Home Assistant MariaDB installieren

Mit Add-on MariaDB installieren
Nicht starten sondern erst auf Konfigurieren drücken
User Name -> homeassistant und Password eintragen
Zurück auf info Watchdog aktivieren
Auf Protokoll drücken und schauen ob alles OK ist keine Fehler

recorder:
db_url: mysql://homeassistant:password@core-mariadb/homeassistant?charset=utf8mb4
purge_keep_days: 31
Diese Zeile in configuration-yaml einfügen

Danach mit dem File Editor die Datei

Daten Migrieren -> Ich habe es nicht gemacht
Zu Add-ons gehen Terminal & SSH starten
Benutzeroberfläche öffnen
Wenn es nicht klappt z.B. bei Promox gehen wir auf die Promox Konsole auf das Terminal
Eingeben:
apk add python3
apk add py3-pip
pip3 install sqlite3-to-mysql

Folgendes script ausführen
sqlite3mysql \ –sqlite-file /config/home-assistant_v2.db \ –mysql-database homeassistant \ –mysql-host core-mariadb \ –mysql-user homeassistant \ –mysql-password ‚[Passwort deiner MariaDB]‚ \ –ignore-duplicate-keys

recorder:
db_url: mysql://homeassistant:password@core-mariadb/homeassistant?charset=utf8mb4
purge_keep_days: 31
Diese Zeile in configuration-yaml einfügen

Konfiguration InFlux DB

  • Bei meiner Installation nicht notwendig! Repository hinzufügen: Öffne dein Home Assistant Dashboard und gehe zu Supervisor > Add-on Store. Klicke auf die drei Punkte in der oberen rechten Ecke und wähle Repositories. Füge das InfluxDB Repository hinzu: arduinoCode kopieren https://github.com/hassio-addons/repository
  • InfluxDB Add-on installieren: Suche nach dem InfluxDB Add-on und installiere es. Nachdem die Installation abgeschlossen ist, starte das Add-on und aktiviere die Optionen „Start on boot“ und „Watchdog“.
  • Auf die Krone drücken und eine neue Datenbank anlegen: homeassistant
  • Benutzer Anlegen User:
  • Passwort xxxxxxxxx
  • Rechte geben: Damit euer Nutzer jetzt auch lesen und schreiben darf, aktiviert WRITE und READ. Speichern und weiter gehts.

Konfigurieren im Home Assistent

  • Konfigurationsdatei bearbeiten: Öffne die configuration.yaml Datei deines Home Assistant und füge folgende Zeilen hinzu. Bitte passe zwingend deine IP und dein Passwort an!
influxdb:
  host: HOMEASSISTANTIP #Deine Home Assistant IP z.b. 192.168.1.10
  port: 8086
  database: homeassistant
  username: inflxha
  password: DEINSTARKESPasswort
      

Installation von Grafana

  • Grafana Add-on installieren:Öffne wieder den Add-on Store in Home Assistant und suche nach dem Grafana Add-on. Installiere es und starte das Add-on. Das habe ich oben bei Influx auch als Screenshot eingefügt.
  • Grafana konfigurieren:Gehe zu den Grafana Einstellungen und aktiviere „Start on boot“ und „Show in sidebar“. Öffne anschließend die Grafana Weboberfläche über die Sidebar.

  • Datenquelle hinzufügen:Öffne Grafana und gehe zu Connections > Data Sources. Klicke auf Add data source und wähle InfluxDB aus.
  • InfluxDB Konfiguration:Fülle die Felder wie folgt aus:
    • URL: http://192.168.18.xxx:8086
    • Falls das nicht geht, teste deine HA IP z.B. 192.168.1.13:8086
  • Auth alles deaktivieren außer “witch Credentials”
    • Database: homeassistant
    • User: inflxha
    • Password: DEINSTARKESPasswort
    Teste die Verbindung, um sicherzustellen, dass alles korrekt eingerichtet ist.

Erstellen von Dashboards in Grafana

Jetzt, da Grafana und InfluxDB miteinander verbunden sind, kannst du damit beginnen, Dashboards zu erstellen.

  1. Neues Dashboard erstellen:Gehe zu Create > Dashboard und füge ein neues Panel hinzu. Dann klicke auf “Add Visualization”
  2. Abfrage konfigurieren:Wähle InfluxDB als Datenquelle und konfiguriere deine Abfrage, um die gewünschten Daten anzuzeigen.
  3. Visualisierung anpassen:Passe die Visualisierung an, um die Daten auf ansprechende Weise darzustellen. Grafana bietet viele verschiedene Visualisierungsoptionen, die du ausprobieren kannst.
  4. Mein Tipp ist jetzt immer mit der Entität anzufangen. Das ist der eindeutige Name in Home Assistant. Hier am Beispiel des Temperatur Sensors. Die Entität ist

Einbinden von Grafana Dashbords in HA Dashboard

Der link der erzeugt wird ist schlicht und einfach falsch zumindest bei HA unter Promox

-> Falsch http://localhost:3000/api/hassio_ingress/BlFGAqbODmCUitNSq8H5A7TH2qOFu ….

-> Richtig ist http://192.168.xxx.xxx:8123/api/hassio_ingress/BlFGAqbODmCUitNSq8H5A7TH2qOFu91aDt1eNiSdBKA

- name: GF_AUTH_ANONYMOUS_ENABLED
  value: "true"
- name: GF_AUTH_ANONYMOUS_ORG_NAME
  value: Main Org.
- name: GF_AUTH_ANONYMOUS_ORG_ROLE
  value: Viewer
- name: GF_SECURITY_ALLOW_EMBEDDING
  value: "true"
- name: GF_AUTH_DISABLE_LOGIN_FORM
  value: "true"
- name: GF_AUTH_OAUTH_AUTO_LOGIN
  value: "true"
- name: GF_SECURITY_ALLOW_EMBEDDING
  value: "true"

Tibber Price Integration

Um diese Grafik erstellen zu lassen wird benötigt :

HACS
ApexCharts zu installieren über HACS
Die Tibber Integration
Tibber Api Key
File Editor Integration
Anpassungen an der configuration.yaml für die Sensoren
und dann die Grafik erstellen

-> sensor.xxxxxxxxxxxx_strompreis
# Tibber Integration Sensor Splitter
  - platform: template
    sensors:
      electricity_price_max_xx_xxxxxxxx_NN:
        friendly_name: Electricity Max price xx_xxxxxxx_NN
        unique_id: sensor.electricity_max_price xx_xxxxxxx_NN
        value_template: "{{ state_attr('sensor.xx_xxxxxxx_xx_strompreis','max_price') }}"
        unit_of_measurement: EUR/kWh
        icon_template: mdi:currency-eur

      electricity_price_min_im_apfelgarten_11:
        friendly_name: Electricity Min price xx_xxxxxxx_NN
        unique_id: sensor.electricity_min_price xx_xxxxxxx_NN
        value_template: "{{ state_attr('sensor.xx_xxxxxxxx_NN_strompreis','min_price') }}"
        unit_of_measurement: EUR/kWh
        icon_template: mdi:currency-eur
        
      electricity_price_avg_im_apfelgarten_11:
        friendly_name: Electricity Avg price xx_xxxxxxx_NN
        unique_id: sensor.electricity_avg_price_im_apfelgarten_11
        value_template: "{{ state_attr('sensor.xx_xxxxxxx_NN_strompreis','avg_price') }}"
        unit_of_measurement: EUR/kWh
        icon_template: mdi:currency-eur

# Tibber API
  - platform: rest
    name: "Electricity price Prognose xx_xxxxxxxxx_NN"
    unique_id: sensor.electricity_price_prognose_xx_xxxxxxxxx_NN
    resource: https://api.tibber.com/v1-beta/gql
    method: POST
    payload: '{ "query": "{ viewer { homes { currentSubscription { status priceInfo { current { total } today { total } tomorrow { total } } } } } }" }'
    json_attributes_path: "$.data.viewer.homes[0].currentSubscription.priceInfo"
    json_attributes:
      - today
      - tomorrow
    value_template: "{{ value_json.data.viewer.homes[0].currentSubscription.priceInfo.current.total | float }}"
    scan_interval: 300
    headers:
      Authorization: –>TIBBER-API-KEY-HIER-EINTRAGEN<–
      Content-Type: application/json
      User-Agent: REST
    unit_of_measurement: EUR/kWh


Wenn die Anpassungen vorgenommen wurden muss einmal Home Assistant neu gestartet werden. Das kann gleich beim File Editor oben rechts beim Zahnrad erledigt werden.

Dann wechsel wir zum Dashbord und erstellen eine neue Karte.
Hier könnt ihr gerne erstmal mittes Sensor Karte die neuen Sensoren suchen.

Im zweiten Teil bei „platform: rest“ rufen wir die Tibber Api auf um dort an die Daten für die nächsten Tage zu kommen.
Bei Authorization: –>TIBBER-API-KEY-HIER-EINTRAGEN<– Bitte durch Euren Tibber Api Key ersetzen

Und in dem Quellcode Bereich ersetzen wir den Inhalt mit diesem.
Auch hier muss wieder bei den Sensoren die ADRESSE durch eure Adresse / Sensor Namen ersetzt werden
also
„- entity: sensor.electricity_price_prognose_ADRESSE“ mit
„- entity: sensor.electricity_price_prognose_xxxxxxxxxxx„
und so weiter.

type:
      
   
 

--------------------------------------------------------------------------------------


Veröffentlicht unter Installation | Verschlagwortet mit | Kommentare deaktiviert für Konfiguration von Home Assistent

Installation DHCP Server PiHole and KEA with Gui

NTP Aktivieren
sudo nano /etc/systemd/timesyncd.conf
NTP=ntp.uni-osnabrueck.de
timedatectl set-ntp 1
systemctl status systemd-timesyncd


sudo curl -sSL https://install.pi-hole.net | bash
start pi-hole http://192.168.1xx:80/admin

Contents

Install Kea dhcp Server

Ubuntu instalieren

NTP Aktivieren
sudo nano /etc/systemd/timesyncd.conf
NTP=ntp.uni-osnabrueck.de
timedatectl set-ntp 1
systemctl status systemd-timesyncd

sudo apt install net-tools
ip address show
sudo snap install curl
Brave installierem curl -fsS https://dl.brave.com/install.sh | sh


Fest IP einstellen
192.168.178.5
Gateway 192.168.178.1
DNS1 213.178.70.1
DNS2 82.97.145.3
hostname -I
ifconfig -a

Kea DHCP
sudo su root
apt update && apt upgrade -y
apt install kea
Passwort für den Control Agenten setzen
// sudo nano /etc/kea/kea-dhcp4.conf


sudo nano /etc/kea/kea-dhcp4.conf

Beispiel
{
    "Dhcp4": {
        "interfaces-config": {
            "interfaces": ["eno1"]
        },
        "control-socket": {
            "socket-type": "unix",
            "socket-name": "/run/kea/kea4-ctrl-socket"
        },
        "lease-database": {
            "type": "postgresql",
            "name": "kea",
            "user": "kea",
            "password": "kea",
            "host": "localhost"
        },
        "valid-lifetime": 600,
        "max-valid-lifetime": 7200,
 // Changes



        "subnet4": [{
         "id": 1,
     "subnet": "192.168.178.0/24",
     "pools": [ { "pool": "192.168.178.10 - 192.18.178.14" } ],
       
              "option-data": [{
                    "name": "routers",
                    "data": "192.168.178.1"
                },
                {
                    "name": "domain-name-servers",
                    "data": "213.178.70.1, 82.97.145.3"
                },
                {
                    "name": "domain-name",
                    "data": "slubahn.local"
                }
            ]
        }]
    }
}






kea-shell --host 127.0.0.1 --port 8000 --auth-user kea-api --auth-password $(cat /etc/kea/kea-api-password) --service dhcp4 config-reload

journalctl -u kea-dhcp4-server -e

sudo nano /usr/local/etc/kea/keactrl.conf
dhcp4=yes
dhcp6=no
keactrl status



sudo mv /etc/kea/kea-dhcp4.conf /etc/kea/kea-dhcp4.conf.bak
sudo nano /etc/kea/kea-dhcp4.conf
sudo systemctl start kea-dhcp4
Zum Stoppen verwenden Sie: sudo systemctl stop kea-dhcp4
Zum Neustarten verwenden Sie: sudo systemctl restart kea-dhcp4
sudo su root
su postgres
psql postgres
CREATE USER kea WITH PASSWORD 'kea';
CREATE DATABASE kea;
GRANT ALL PRIVILEGES ON DATABASE kea TO kea;
\c kea
create extension pgcrypto;
exit;
exit
exit
sudo su root
su postgres
psql postgres
ALTER DATABASE kea OWNER TO kea;
exit;
exit

kea-admin db-init pgsql -u kea -p kea -n kea

Install hook libries



sudo su root
apt update && apt upgrade -y
apt install postgresql postgresql-contrib -y
su postgres
psql postgres
CREATE USER stork WITH PASSWORD 'stork';
CREATE DATABASE stork;
GRANT ALL PRIVILEGES ON DATABASE stork TO stork;
\c stork
create extension pgcrypto;
exit;
exit
exit
strg d
reboot

sudo su root
install pgAdmin
Test the stork DB with pqAdmin






Install the Stork Server
sudo su root
curl -1sLf 'https://dl.cloudsmith.io/public/isc/stork/cfg/setup/bash.deb.sh' | sudo bash
sudo apt install isc-stork-server
sudo nano /etc/stork/server.env
STORK_DATABASE_HOST=localhost
STORK_DATABASE_PORT=5432
STORK_DATABASE_NAME=stork
STORK_DATABASE_USER_NAME=stork
STORK_DATABASE_PASSWORD=stork

STORK_REST_HOST=0.0.0.0
STORK_REST_PORT=8080
STORK_LOG_LEVEL=INFO
reboot
cd /usr/lib/
sudo mkdir stork-server
cd stork-server
sudo mkdir hooks

sudo systemctl restart isc-stork-server
sudo systemctl enable isc-stork-server
sudo systemctl start isc-stork-server
sudo systemctl status isc-stork-server
journalctl -u isc-stork-server.service -e
Cannot start the Stork Server: problem initiating database: ERROR #42501 permission ...
sudo -u postgres stork-tool db-create --db-name stork --db-user stork-server
sudo su root
su postgres
psql postgres
ALTER USER stork WITH PASSWORD 'stork';
exit;
sudo systemctl stop isc-stork-server   ----> for debugging
reboot
journalctl -u isc-stork-server.service -e
Install the Stork agent only with no errors of the Stork Server
--------------------------------------------------------------------------------------------
cd /usr/share/stork/www
assets/pkgs

curl -o /tmp/isc-stork-agent.deb "localhost:8080/assets/pkgs/isc-stork-agent_1.11.0.230606131857_amd64.deb"

--------------------------------------------------------------------------------------------

stork agent
sudo curl -1sLf 'https://dl.cloudsmith.io/public/isc/stork/cfg/setup/bash.deb.sh' | sudo bash
sudo apt install isc-stork-agent

sudo nano /etc/stork/agent.env
STORK_AGENT_HOST=127.0.0.1
STORK_AGENT_PORT=8081
STORK_AGENT_LISTEN_STORK_ONLY=false
STORK_AGENT_SERVER_URL=http://localhost:8080
STORK_LOG_LEVEL=INFO
STORK_AGENT_DB_URL=postgresql://kea:kea@localhost/kea

sudo systemctl restart isc-stork-agent
sudo systemctl enable isc-stork-agent
sudo systemctl start isc-stork-agent
sudo su stork-agent -s /bin/sh -c 'stork-agent register --server-url http://127.0.0.1:8080'

stork-agent -s /bin/sh -c 'stork-agent register -u http://192.168.178.5:8080'

sudo systemctl status isc-stork-agent
sudo nano /etc/stork/agent.env


http://localhost:8080

Troble

sudo -i -u postgres
psql
sudo systemctl status postgresql
sudo systemctl is-active postgresql
sudo systemctl is-enabled postgresql
sudo pg_isready

systemctl stop firewalld
sudo nano /etc/stork/server.env
sudo -u postgres stork-tool db-create –db-name stork –db-user stork-server


journalctl -u isc-stork-server.service -e

journalctl -u isc-stork-server.service
cd /usr/lib/
sudo mkdir stork-server
cd stork-server
sudo mkdir hooks
curl http://127.0.0.1:8080/api/version
{"date":"2023-01-16 11:06","version":"1.8.0"}



INFO[2025-07-16 13:23:36] main.go:99 Created database and user for the server with the following credentials database_name=“stork“ password=“UD13el8q4HQv9ElOeLagutFZnD+XCaso“ user=“stork“








/usr/local/sbin/kea-dhcp4 -c /usr/local/etc/kea/kea-dhcp4.conf




The kea-dhcp4 service can be configured by editing /etc/kea/kea-dhcp4.conf

{
  "Dhcp4": {
	"interfaces-config": {
  	"interfaces": [ "eth4" ]
	},
	"control-socket": {
    	"socket-type": "unix",
    	"socket-name": "/run/kea/kea4-ctrl-socket"
	},
	"lease-database": {
    	"type": "memfile",
    	"lfc-interval": 3600
	},
	"valid-lifetime": 600,
	"max-valid-lifetime": 7200,
	"subnet4": [
  	{
    	"id": 1,
    	"subnet": "192.168.1.0/24",
    	"pools": [
      	{
        	"pool": "192.168.1.150 - 192.168.1.200"
      	}
    	],
    	"option-data": [
      	{
        	"name": "routers",
        	"data": "192.168.1.254"
      	},
      	{
        	"name": "domain-name-servers",
        	"data": "192.168.1.1, 192.168.1.2"
      	},
      	{
        	"name": "domain-name",
        	"data": "mydomain.example"
      	}
    	]
  	}
	]
  }
}

-----------------------------------------------------------------------------------------

kea-shell --host 127.0.0.1 --port 8000 --auth-user kea-api --auth-password $(cat /etc/kea/kea-api-password) --service dhcp4 config-reload

Strg – d drücken

systemctl restart kea-dhcp4-server

{
    "Dhcp4": {
        "interfaces-config": {
            "interfaces": ["eth4"]
        },
        "control-socket": {
            "socket-type": "unix",
            "socket-name": "/run/kea/kea4-ctrl-socket"
        },
        "lease-database": {
            "type": "memfile",
            "lfc-interval": 3600
        },
        "valid-lifetime": 600,
        "max-valid-lifetime": 7200,
        "subnet4": [{
            "id": 1,
            "subnet": "192.168.1.0/24",
            "pools": [{
                "pool": "192.168.1.150 - 192.168.1.200"
            }],
            "option-data": [{
                    "name": "routers",
                    "data": "192.168.1.254"
                },
                {
                    "name": "domain-name-servers",
                    "data": "192.168.1.1, 192.168.1.2"
                },
                {
                    "name": "domain-name",
                    "data": "mydomain.example"
                }
            ]
        }]
    }
}

Experimentell
sudo add-apt-repository ppa:isc/bind-esv sudo apt update

https://www.veuhoff.net/dhcp-server-kea-installation-fuer-linux-ubuntu-22-04-und-debian-

{
  "Dhcp4": {
    "interfaces-config": {
      "interfaces": [ "eth0" ]
    },
    "subnet4": [
      {
        "id": 1,
        "subnet": "192.168.1.0/24",
        "range": [
          {
            "start": "192.168.1.100",
            "end": "192.168.1.200"
          }
        ],
        "option-data": [
          {
            "name": "routers",
            "data": "192.168.1.1"
          },
          {
            "name": "domain-name-servers",
            "data": "192.168.1.1"
          }
        ]
      }
    ],
    "reservations": [
      {
        "hw-address": "f0:9e:4a:9a:b8:c5",
        "ip-address": "192.168.178.12",
        "hostname": "my-device"
      }
    ]
  }
}
-------------------------------------------------------------------------------------
sudo nano /etc/kea/kea-dhcp4.conf
sudo systemctl restart kea-dhcp4-server

journalctl -u kea-dhcp4-server -e
{
  "Dhcp4": {
    "reservations-global": [
      {
        "hw-address": "aa:bb:cc:dd:ee:ff",
        "ip-address": "192.0.2.10"
      }
    ],
    "reservations-in-subnet": [
      {
        "subnet-id": 1,
        "hw-address": "11:22:33:44:55:66",
        "ip-address": "192.0.2.11"
      }
    ]
  }
}

—————–orignale config ————————————————————

{
    "Dhcp4": {
        "interfaces-config": {
            "interfaces": ["eth4"]
        },
        "control-socket": {
            "socket-type": "unix",
            "socket-name": "/run/kea/kea4-ctrl-socket"
        },
        "lease-database": {
            "type": "memfile",
            "lfc-interval": 3600
        },
        "valid-lifetime": 600,
        "max-valid-lifetime": 7200,
        "subnet4": [{
            "id": 1,
            "subnet": "192.168.1.0/24",
            "pools": [{
                "pool": "192.168.1.150 - 192.168.1.200"
            }],
            "option-data": [{
                    "name": "routers",
                    "data": "192.168.1.254"
                },
                {
                    "name": "domain-name-servers",
                    "data": "192.168.1.1, 192.168.1.2"
                },
                {
                    "name": "domain-name",
                    "data": "mydomain.example"
                }
            ]
        }]
    }
}

Kea Host reservation in Database

{
  "Dhcp4": {
    "server-id": "my-server-id",
    "subnet4": [
      {
        "subnet": "192.0.2.0/24",
        "pools": [
          {
            "pools" "192.0.2.10-192.0.2.200"
          }
        ],
       "option-data": [
          {
            "name": "routers",
            "data": "192.0.2.1"
          },
          {
            "name": "domain-name-servers",
            "data": "192.0.2.10, 192.0.2.11"
          }
        ],
        "host-reservation-mode": "database"
      }
    ],
   "host-reservation-database": {
      "type": "postgresql",
      "user": "kea",
      "password": "kea",
      "host": "localhost",
      "name": "kea"
    },
    "host-reservation-identifiers": ["hw-address"]
  }
}
"subnet4": [
  {  "subnet": "192.0.2.0/24",
     "pools": [ { "pool": "192.0.2.1 - 192.0.2.200" } ],
     "reservations": [
        {
           "hw-address": "52:54:00:01:5f:33",
           "ip-address": "192.0.2.201"
        }
      ]
  }
]


==========================================================================================
Veröffentlicht unter Installation | Verschlagwortet mit , , , | Kommentare deaktiviert für Installation DHCP Server PiHole and KEA with Gui

Home Assistent unter Promox VE installieren

Promox nach Standard installieren
pve shell aufrufen
Dieses script dort hin kopieren

bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/vm/haos-vm.sh)"

Auswählen last stable eg 15.2

Version kann abweichen aber immer Stable
Virtual Machine ID, Machine Type so lassen
Write Through Disk Cache default

VM’s Hostname Empfehlung so lassen.
CPU Model ist Host

Anzahl Kerne 2
RAM 6 GB (Promox sollte eh auf min 32GB laufen)
Bridge, MAC Address, VLAN, MTU Size auf Standard lassen.
Start VM nach Installation -> Yes
Unbedingt auf die local-lvm instalieren!

Die Installation dauert c a 5 Minuten, danach auf der console anmelden.


Eingeben in Browser „http://IP:8123

Ich empfehle auch den Promox Backup Server zu installieren.

Sonnen Batterie Integration

rest:
  - resource: http://192.168.1.xx:80/api/v2/latestdata
    method: GET
    headers:
      User-Agent: Home Assistant
      Content-Type: application/json
      Auth-Token: DEIN TOKEN
    scan_interval: 60
    timeout: 15
    sensor:
      - name: solar_power_w
        value_template: '{{ value_json["Production_W"] }}'
        unit_of_measurement: W
        device_class: power
      - name: battery_soc
        value_template: '{{ value_json["USOC"] }}'
        unit_of_measurement: '%'
        device_class: battery
      - name: battery_consumption_production_diff
        value_template: '{{ value_json["Pac_total_W"] }}'
        unit_of_measurement: W
        device_class: power
      - name: house_consumption
        value_template: '{{ value_json["Consumption_W"] }}'
        unit_of_measurement: W
        device_class: power
      - name: battery_capacity
        value_template: '{{ value_json["FullChargeCapacity"] }}'
        unit_of_measurement: Wh
        device_class: energy
      - name: battery_soc_energy
        value_template: '{{ (value_json["USOC"]|float / 100 * value_json["FullChargeCapacity"]|float)|round(0)|int }}'
        unit_of_measurement: Wh
        device_class: energy 

Vielleicht aber auch über -> https://github.com/weltmeyer/ha_sonnenbatterie
   
   
Dem Sensor fehlt die Richtige state_class, device_class und die Einheit. Diese kannst über Customize beheben. Erstelle Dir in der configuration.yaml unterhalb der Zeile homeassistant die Zeile homeassistant: customize: !include customize.yaml Dann erstelle Dir im gleichen Verzeichnis, wo auch die configuration.yaml zu finden ist die Datei customize.yaml In diese Datei trägst Du dann für jeden Sensor einen Eintrag, nach diesem Schema: sensor.xyz_energy: state_class: total_increasing u… 

sensor.solaredge_aktuelle_leistung:
   device_class: Energy


sensor.sonnenbatterie_XXXXX_state_production:
   device_class: Energy

sensor.sonnenbatterie_97484_state_consumption_current:
   device_class: Energy

sensor.gartenhaus_total_ausgangsleistung:
   device_class: Energy

sensor.tibber_pulse_im_apfelgarten_11_einspeiseleistung:
   device_class: Energy

sensor.tibber_pulse_im_apfelgarten_11_leistung:
   device_class: Energy
Veröffentlicht unter Installation | Kommentare deaktiviert für Home Assistent unter Promox VE installieren

Installing Home Assistant Core on Ubuntu 22.04 (Promox VE)

sudo -s

Wichtig USB Bluethoth aktivieren (Promox)

Und im Ubuntu einschalten.

apt install bluetooth
apt install bluez libbluetooth-dev libudev-dev libcap2-bin

dpkg --configure -a
apt install -f
apt-get --fix-broken install
apt-get update --fix-missing
apt update && apt upgrade

add-apt-repository ppa:deadsnakes/ppa
apt update
apt install wget build-essential
apt install wget libncursesw5-dev
apt install wget libssl-dev

sudo apt-get install sqlite3 libsqlite3-dev
apt install wget tk-dev
apt install wget libgdbm-dev
apt install wget libc6-dev
apt install wget libbz2-dev
apt install wget libffi-dev
apt install wget zlib1g-dev
!!!!!!!!!!!!!!!!!!!!!!!!!!! Snapshot vor Python install !!!!!!!!!!!!!
apt install python3.13 python3.13-dev python3.13-venv python3-pip

 python3 --version

Change the first line in files “/usr/bin/pip” & “/usr/bin/pip3” to “#!/usr/bin/python3.13.3”
nano /usr/bin/pip
nano /usr/bin/pip3

apt install bluez
apt install libffi-dev
apt install libssl-dev
apt install libjpeg-dev
apt install zlib1g-dev
apt install autoconf
apt install build-essential
apt install libopenjp2-7
apt install libtiff6apt install libturbojpeg0-dev
apt install tzdata

apt install ffmpeg
apt install liblapack3
apt install liblapack-dev
apt install libatlas-base-dev  
--------------------------------------------------------------------------------

useradd -rm homeassistant -G dialout
mkdir /srv/homeassistant
chown homeassistant:homeassistant /srv/homeassistant
sudo -u homeassistant -H -s
cd /srv/homeassistant
python3.13 -m venv .
source bin/activate
python3.13 -m pip install wheel
pip3 install homeassistant==2025.1.3
 
hass
   Create file (init.d script) “/etc/init.d/homeassistant”
sudo nano /etc/init.d/homeassistant

#!/bin/sh
# For Ubuntu:
# description: Home Assistant
# processname: hass

### BEGIN INIT INFO
# Provides:          hass
# Required-Start:
# Required-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Home Assistant service
# Description:       Home Assistant
### END INIT INFO

name="HomeAssistant"
pid_file="/var/run/$name.pid"

case "$1" in
    start)
		su - homeassistant -c '/srv/homeassistant/bin/python3.13
 /srv/homeassistant/bin/hass' &>/dev/null &
		echo $(pgrep python3.13) > "$pid_file"
		echo "Running with PID: $(pgrep python3.13)"
    ;;
    stop)
        echo -n "Stopping $name.."
        kill $(pgrep python3.13)
	rm "/var/run/$name.pid"

    ;;
    restart)
        stop
		start
    ;;
    status)
        if $(pgrep hass); then
            echo "Running with PID: $(pgrep python3.13)"
        else
            echo "$name is not running"
            exit 1
        fi

    ;;
    *)
    echo "Usage: $0 {start|stop|restart|status}"
    exit 1
    ;;
esac
exit 0

-> End File

sudo chmod 0755 /etc/init.d/homeassistant
sudo update-rc.d homeassistant defaults
reboot
service homeassistant status

 python --version
  • For Ubuntu 23.04-24.10sudo apt install libtiff6
  • For Ubuntu 14.04-22.04sudo apt install libtiff5
  • For Ubuntu 12.04-13.10sudo apt-get install libtiff4

Für den Start ohne Service

sudo -u homeassistant -H -s
cd /srv/homeassistant
python3.12 -m venv .
source bin/activate
hass

Update
pip3 install --upgrade homeassistant
sudo ufw allow 8123/tcp
hostname -I
http://localhost:8123
bash -c "$(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/vm/haos-vm.sh)"

Contents

Update Phyton Version

Version überprüfen ***** did not work ****

python3 --version
sudo apt update && sudo apt upgrade -y
sudo add-apt-repository ppa:deadsnakes/ppa
sudo apt update
apt list | grep python3.13
sudo apt install python3.13
python3.13 --version

Update Home Assistent auf neue Phyton Version

Check ob alles io ist
sudo apt --fix-broken install
sudo apt install python3-minimal grub2-common
sudo python3 -m ensurepip --upgrade
sudo python3 -m pip install --upgrade pip
sudo apt update && sudo apt upgrade
sudo apt autoremove --purge
sudo apt clean

--------------------------------------------------------------------------------
sudo -s
cd /home/homeassistant/.homeassistant
sudo -u homeassistant -H -s
source /srv/homeassistant/bin/activate
pip3 freeze –local > requirements-2024.12.txt
exit
To create the backup do the following:

Stop your HASS instance:

service homeassistant status
service homeassistant stop

Go to the SRV folder, and copy the homeassistant program directory to your backup folder:

cd /srv
sudo mv homeassistant homeassistantold-20241226

sudo mkdir homeassistant
sudo chown -R homeassistant:homeassistant homeassistant
sudo -u homeassistant -H -s
cd /srv/homeassistant
python3.13 -m venv .

Konfiguration

Einbinden der Sonnen Batterie

rest:
  - resource: http://192.168.1.xx:80/api/v2/latestdata    <--- 
    method: GET
    headers:
      User-Agent: Home Assistant
      Content-Type: application/json
      Auth-Token: DEIN TOKEN             <---------------
    scan_interval: 60
    timeout: 15
    sensor:
      - name: solar_power_w
        value_template: '{{ value_json["Production_W"] }}'
        unit_of_measurement: W
        device_class: power
      - name: battery_soc
        value_template: '{{ value_json["USOC"] }}'
        unit_of_measurement: '%'
        device_class: battery
      - name: battery_consumption_production_diff
        value_template: '{{ value_json["Pac_total_W"] }}'
        unit_of_measurement: W
        device_class: power
      - name: house_consumption
        value_template: '{{ value_json["Consumption_W"] }}'
        unit_of_measurement: W
        device_class: power
      - name: battery_capacity
        value_template: '{{ value_json["FullChargeCapacity"] }}'
        unit_of_measurement: Wh
        device_class: energy
      - name: battery_soc_energy
        value_template: '{{ (value_json["USOC"]|float / 100 * value_json["FullChargeCapacity"]|float)|round(0)|int }}'
        unit_of_measurement: Wh
        device_class: energy    

Pirate Weather

sudo apt install git
sudo -s
git clone https://github.com/Pirate-Weather/pirate-weather-ha
cd /home/homeassistant/.homeassistant
mkdir custom_components
cd custom_components
mkdir pirateweather
cd pirateweather
sudo cp -r pirate-weather-ha/custom_components/* /home/homeassistant/.homeassistant/custom_components
Veröffentlicht unter Installation, Troubleshooting | Verschlagwortet mit , | Kommentare deaktiviert für Installing Home Assistant Core on Ubuntu 22.04 (Promox VE)

Plasticity wie geht was

Solid löschen -> Mit der linken Maustaste markieren dann Taste X löscht es

Veröffentlicht unter 3D CAD, Anleitungen | Verschlagwortet mit | Kommentare deaktiviert für Plasticity wie geht was

Installation RustDesk

Ubuntu Server installieren
OpenSSH mit installieren

Server Desktop installieren
sudo apt update && sudo apt upgrade

sudo apt-get update && sudo apt-get upgrade && sudo apt-get dist-upgrade


sudo reboot
Display Manager installieren
sudo apt install lightdm
sudo apt install ubuntu-desktop
Falls wir während der Installation gefragt werden, welchen Display Manager wir verwenden möchten, wählen wir hier lightdm aus.
sudo reboot
Partitions Manager
GParted per Verwaltung installieren. Wir benötigt um Festplatten für Timeshift vorzubereiten.
sudo apt-get install gparted
sudo apt-get install timeshift

Contents

Installation Server
Firewall Einstellungen

sudo ufw allow 21114:21119/tcp
sudo ufw allow 8000/tcp
sudo ufw allow 21116/udp
sudo ufw enable

Status Firewall sudo ufw status

Node js installation
sudo apt install nodejs
sudo apt install npm
sudo apt install curl

Install pm2
sudo npm install pm2 -g

wget https://raw.githubusercontent.com/techahold/rustdeskinstall/master/install.sh
chmod +x install.sh
./install.sh

Packet Installation sudo apt-get -f rustdesk-server-hbbr_1.1.14_amd64.deb
sudo dpkg -i rustdesk-server-hbbr_1.1.14_amd64.deb
sudo dpkg -i rustdesk-server-hbbs_1.1.14_amd64.deb

./hbbs
./hbbr

pm2 start hbbs
pm2 start hbbr
Check PM2 pm2 list
pm2 save
pm2 startup

Ip Adresse: hostname -I

Restart Server:
sudo systemctl restart rustdesksignal
sudo systemctl restart rustdeskrelay

Client Installationen

192.168.xx.xx:8000 ruft die install scripte auf
Windows client installieren
Power Shell starten als Administrator
How to Enable windowsagentaioinstall.ps1
# Get-ExecutionPolicy-List
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process
./WindowsAgentAIOInstall.ps1

sudo snap install curl
Linux install via script
Achtung bei MX-Linux bootoption auf systemctl umstellen.
chmod +x linuxclientinstall.sh
sudo ./linuxclientinstall.sh

Autostart Linux client
sudo systemctl enable rustdesk

Ubuntu wayland ausschalten
sudo nano /etc/gdm3/custom.conf
Um den Fehler zu beseitigen die Datei /etc/gdm3/custom.conf editieren

[daemon] # Enabling automatic login AutomaticLoginEnable=true AutomaticLogin=$USERNAME (mit dem Anmeldenamen ersetzen) # Uncomment the line below to force the login screen to use Xorg WaylandEnable=false

Uninstall AnyDesk

sudo apt-get purge anydesk
sudo apt-get autoclean
sudo apt-get autoremove
sudo apt update
sudo apt list --upgradable
sudo apt upgrade -y

Uninstall Teamvievwer

Überprüfen ob installiert
dpkg -l | grep teamviewer
sudo apt-get remove teamviewer
sudo apt autoremove

Upgrade client

Update Windows in Administrator PowerShell
winget install rustdesk.rustdesk

Update on MAC OS
/bin/bash -c „$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)“


brew upgrade rustdesk

Update Linux
sudo apt-get install build-essential procps curl file git
Install Hombrew
/bin/bash -c „$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)“

sudo dpkg -i rustdesk-1.3.9-x86_64.deb


test -d ~/.linuxbrew && eval „$(~/.linuxbrew/bin/brew shellenv)“
test -d /home/linuxbrew/.linuxbrew && eval „$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)“
echo „eval \“\$($(brew –prefix)/bin/brew shellenv)\““ >> ~/.bashrc

Veröffentlicht unter Anleitungen, Installation | Verschlagwortet mit | Kommentare deaktiviert für Installation RustDesk

Was mache ich wie in Fusion 360 <> FreeCad

Schale erstellen Fusion 360

Schale erstellen FreeCad

Veröffentlicht unter 3D CAD | Verschlagwortet mit , , | Kommentare deaktiviert für Was mache ich wie in Fusion 360 <> FreeCad

Meine FreeCad Einrichtung 1.0.0

Start -> Helles Thema wählen
Datei neu wählen
Werkzeuge -> Add-on Manager OpenThemes installieren
Bearbeiten Einstellungen-> Applikation einstellen OpenLight
Beim Apfel auf FreeCad -> Einstellungen
FreeCad neu Starten dann nochmal Einstellungen
OpenPreferences anwenden Anzeige FreeCad neu starten
Anzeige BIM ignorieren und Start nochmal weg x en.
Einstellungen -> Arbeitsbereiche abwählen

BIM
FEM
CAM
MESH
Surface
Anwenden und OK
Einstellungen Sketcher Raster EIN
Neu Starten
Neue Datei und einen Grundkörper Einfügen
Fenster Links und Rechts Überlagerung Modus umschalten
Ausgabefenster unter Ansicht Fenster -> Ausgabefenster nach rechts ziehen.

Symbolleisten entsperren Rechtsklick in die Symbolleiste und hacken sperren entfernen

Veröffentlicht unter 3D CAD, Anleitungen, Installation | Verschlagwortet mit | Kommentare deaktiviert für Meine FreeCad Einrichtung 1.0.0

WordPress auf anderen Server einrichten

FTP Server installieren
sudo apt install vsftpd
Hostnamen ermitteln -> hostnamectl

MySql Server installieren
sudo apt install mysql-server
Status überprüfen -> sudo service mysql status QUIT mit der Eingabe q
Netzwerkstatus -> sudo ss -tap | grep mysql
Die Datei /etc/mysql/
/etc/mysql/mysql.conf.d/mysqld.cnf den Bind Eintrag anpassen auf die Server IP
bind-address = 192.168.0.5

DBeaver ce Installieren

sudo snap install curl

Abhängigkeiten Installieren
sudo apt update
sudo apt install apache2 \
ghostscript \
libapache2-mod-php \
php \
php-bcmath \
php-curl \
php-imagick \
php-intl \
php-json \
php-mbstring \
php-mysql \
php-xml \
php-zip

Install WordPress

sudo mkdir -p /srv/www
sudo chown www-data: /srv/www
curl https://wordpress.org/latest.tar.gz | sudo -u www-data tar zx -C /srv/www

Create Apache site for WordPress. Create /etc/apache2/sites-available/wordpress.conf with following lines:

cd /etc/apache2/sites-available
$ sudo nano wordpress.conf

<VirtualHost *:80>
    DocumentRoot /srv/www/wordpress
    <Directory /srv/www/wordpress>
        Options FollowSymLinks
        AllowOverride Limit Options FileInfo
        DirectoryIndex index.php
        Require all granted
    </Directory>
    <Directory /srv/www/wordpress/wp-content>
        Options FollowSymLinks
        Require all granted
    </Directory>
</VirtualHost>


sudo a2ensite wordpress
systemctl reload apache2
sudo a2enmod rewrite
systemctl reload apache2
sudo a2dissite 000-default
systemctl reload apache2
sudo service apache2 reload

Configure database

$ sudo mysql -u root
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 7
Server version: 5.7.20-0ubuntu0.16.04.1 (Ubuntu)

Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved.

Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

mysql> CREATE DATABASE wordpress;
Query OK, 1 row affected (0,00 sec)

mysql> CREATE USER wordpress@localhost IDENTIFIED BY '<your-password>';
Query OK, 1 row affected (0,00 sec)

mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER
    -> ON wordpress.*
    -> TO wordpress@localhost;
Query OK, 1 row affected (0,00 sec)

mysql> FLUSH PRIVILEGES;
Query OK, 1 row affected (0,00 sec)

mysql> quit
Bye


Enable MySQL with -> sudo service mysql start

sudo -u www-data cp /srv/www/wordpress/wp-config-sample.php /srv/www/wordpress/wp-config.php


Next, set the database credentials in the configuration file (do not replace database_name_here or username_here in the commands below. Do replace <your-password> with your database password.):

sudo -u www-data sed -i ’s/database_name_here/wordpress/‘ /srv/www/wordpress/wp-config.php

sudo -u www-data sed -i ’s/username_here/wordpress/‘ /srv/www/wordpress/wp-config.php


sudo -u www-data sed -i ’s/password_here//‘ /srv/www/wordpress/wp-config.php

sudo -u www-data nano /srv/www/wordpress/wp-config.php
Find the following:
define( ‚AUTH_KEY‘, ‚put your unique phrase here‘ );
define( ‚SECURE_AUTH_KEY‘, ‚put your unique phrase here‘ );
define( ‚LOGGED_IN_KEY‘, ‚put your unique phrase here‘ );
define( ‚NONCE_KEY‘, ‚put your unique phrase here‘ );
define( ‚AUTH_SALT‘, ‚put your unique phrase here‘ );
define( ‚SECURE_AUTH_SALT‘, ‚put your unique phrase here‘ );
define( ‚LOGGED_IN_SALT‘, ‚put your unique phrase here‘ );
define( ‚NONCE_SALT‘, ‚put your unique phrase here‘ );

Delete those lines (ctrl+k will delete a line each time you press the sequence). Then replace with the content of https://api.wordpress.org/secret-key/1.1/salt/. (This address is a randomiser that returns completely random keys each time it is opened.) This step is important to ensure that your site is not vulnerable to “known secrets” attacks.

Save and close the configuration file by typing ctrl+x followed by y then enter

Das bedeutet die Zeilen define(‚AUTH_KEY …. bis define(‚NONCE -> löschen und mit der ausgabe von https://api.wordpress.org/secret-key/1.1/salt/ ersetzen.

Einfacher jedoch mit dem Texteditor da Nano eine eigene Zwischenablage hat.



Veröffentlicht unter Installation | Verschlagwortet mit | Kommentare deaktiviert für WordPress auf anderen Server einrichten

CMOS Batterie tauschen Terra PC Nettop

Anleitung zum Austausch der CMOS Batterie im Terra PC Model 1008073

Leider ist die CMOS Batterie unter der Laufwerks Abdeckung angebracht. Der Stecker ist ohne gesamt Öffnung der Gehäuses nicht erreichbar. Die Batterie ist echt stark mit Kleber befestig.

Danke fürs anschauen.
Veröffentlicht unter Anleitungen | Verschlagwortet mit , , | Kommentare deaktiviert für CMOS Batterie tauschen Terra PC Nettop