Home Assistant

SSH-Zugriff auf Home Assistant

Voice Assistant

Home Assistant Konfiguration automatisch nach GitHub sichern

Share Your Home Assistant Configs on GitHub Automatically. (YouTube)

Im HA Terminal-Addon

  1. ssh-keygen -t rsa -b 4096 -C „christoph.schwaeppe@gmail.com
  2. git config core.sshCommand 'ssh -i UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa -F /dev/null'
  3. git config core.sshCommand „ssh -i /root/config/.ssh/id_rsa -F /dev/n
  4. git remote set-url origin git@github.com:gatonero/MyHomeAssistantConfig.git
  5. ssh-add /config/.ssh/id_rsa
  6. git config core.sshCommand 'ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i /config/.ssh/id_rsa -F /dev/null'

Common Tasks

In diesem Abschnitt finden Sie Anleitungen zu einigen allgemeinen Aufgaben und Informationen, die Sie zum Ausführen, Warten und Bearbeiten Ihres Home Assistant-Betriebssystems benötigen. Weitere Informationen zu einem bestimmten Thema finden Sie in der Dokumentation zu den hier aufgeführten spezifischen Add-ons oder Themen.

Home Assistant mit vscode(lokal) auf Samba-Share zugreifen

Eintrag lokal in /etc/fstab

//192.168.178.55/config /home/cs/homeassistant cifs _netdev,nofail,username=cs,password=19cs12 0 0

Home Assistant mit Docker

Installation

++++ Installation |

How to Install Home Assistant Supervised (KIril Peyanski)

sudo mkdir /etc/NetworkManager

erledigt

sudo mkdir /etc/NetworkManager/conf.d

erledigt

sudo nano /etc/NetworkManager/conf.d/100-disable-wifi-mac-randomization.conf

erledigt

[connection]
wifi.mac-address-randomization=1
[device]
wifi.scan-rand-mac-address=no

erledigt

sudo apt-get update && sudo apt-get upgrade -y

erledigt

sudo apt-get install jq wget curl avahi-daemon udisks2 libglib2.0-bin network-manager dbus apparmor -y

erledigt

sudo reboot

erledigt

curl -fsSL https://get.docker.com -o get-docker.sh

erledigt

sudo sh get-docker.sh

erledigt

sudo usermod -aG docker cs

erledigt

docker version

erledigt

wget https://github.com/home-assistant/os-agent/releases/download/1.2.2/os-agent_1.2.2_linux_armv7.deb

erledigt

sudo dpkg -i os-agent_1.2.2_linux_armv7.deb

erledigt

gdbus introspect -–system –-dest io.hass.os -–object-path /io/hass/os

erledigt

wget https://github.com/home-assistant/supervised-installer/releases/latest/download/homeassistant-supervised.deb

erledigt

sudo dpkg -i homeassistant-supervised.deb

erledigt

dann warten und http://homeassistant:8123 aufrufen. :-)

laaange warten…

Wenn dieser Screen auftaucht dann sichern! Siehe: http://192.168.178.200/dokuwiki/!mywiki/doku.php?id=elektronik:raspberry#sichern_und_wieder_herstellen|

++++

Einrichtung

++++ Einrichtung |

  1. File editor
  2. ESPHome
  3. Terminal & SSH
  4. OctoPrint

Samba Backup

host: 192.168.178.200
share: homes
target_dir: /cs/Drive/Dokumente/cloud/gdrive/HABackup
username: cs
password: uhpc49C5+#
keep_local: '5'
keep_remote: '20'
trigger_time: '04:00'
trigger_days:
  - Mon
  - Tue
  - Wed
  - Thu
  - Fri
  - Sat
  - Sun
exclude_addons: []
exclude_folders: []
backup_name: '{type} Backup {date}'

Samba Backup manuell oder Dashboard auslösen

service: hassio.addon_stdin
data:
  addon: 15d21743_samba_backup
  input: trigger

Wartung

  1. docker ps to get a list of containers
  2. note the first 3 characters or so of the container for homeassistant - for me it was cd0
  3. docker exec -it cd0 /bin/bash
  4. ls to make sure configuration.yaml is there
  5. vi configuration.yaml to edit the file
    Basic Vim commands - For getting started
  6. edit your mistake
  7. esc + :wq to save and exit
  8. exit then login to get back to hassio CLI
  9. hass check to make sure the conf is right this time
    hass restart

++++

Statistik

Nginx Proxy Manager

Export devices and entities

Create a script to call the service and link it to a button on your desktop for easy activation. Examining mine, you will see I use a ~ for column separation.

alias: print_entity_attributes
sequence:
  - service: notify.print_export
    data_template:
      message: |
        {% for state in states %}{{ state.entity_id }}~{{ state.domain }}~{{ state.object_id }}~{{ state.name }}~~{{ state.attributes.icon, state.attributes.friendly_name }}~~{{ state.state }}
        {% endfor %}
mode: single
icon: mdi:cloud-print-outline

Create the notify service (Called by the script). In your configuration.yaml under default_config:

default_config:
notify:
- name: print_export
  platform: file
  filename: /config/www/export.txt
  timestamp: false

Notes:
filename: /config/www/export.txt designates the destination and name of the file. If the file already exists and it is called again, it will append to the existing results. You could go directly to a .CSV but as you will notice, the first two lines need deleting; additionally, if there are any ,'s (commas) in the file, they need to be remedied before [Search and replace all ~ for ,] Finally you can save and rename the extension to .CSV and you should have everything you are looking for.

Problembehandlung

YAML