Skip to content

swa72/home-assistant

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

590 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

home-assistant

My first attempt at running a home automation system was a Shelly device integrated to HomeKit - worked nicely. Then I fiddled around with running https://homebridge.io/ on my Raspberry 4, moved over to https://hoobs.org/ and realized that there must be something better. Luckily I found Home Assistant.

This file is intended for me to document the quirks I had during setup and for others to learn and avoid them.

My setup

DSS VoIP Notifier

tts:
  - platform: google_translate
    language: 'de'
    service_name: google_translate_say
    --base_url: https://xxx.duckdns.org-- # deprecated since 2022.5‚
  • configuration (note that 192.168.178.1 is the IP address of my Fritzbox, and 192.168.178.83 is the IP address of my Raspberry
sip_parameters:
  caller_id_uri: 'sip:homeassistant@192.168.178.1:5060'
  realm: '*'
  username: homeassistant
  password: '<replace-me-with-digits-only>'
pjsua_custom_options: '--ip-addr=192.168.178.83'
  • steps to do on Fritzbox:, see https://superuser.com/questions/829824/android-wont-register-sip-on-Fritzbox-router
    • log on to your Fritzbox
    • select Telefoniegeräte (phone | devices)
    • Add Phone
    • LAN/WLAN (IP Phone), named 'homeassistant'
    • enter username homeassistant, passwort ONLY digits
    • pick a number (any number will do)
    • don't accept any outside calls (not required in my case)
    • my Fritzbox registered a new device with internal number *622
  • start the "DSS VoIP Notifier" add-on and check the logs
  • now try calling the service like (e.g. from the "Developer Tools" section in HA)
- service: hassio.addon_stdin
  data_template:
	addon: 89275b70_dss_voip
	input: {"call_sip_uri":"sip:**614@192.168.178.1:5060","message_tts":"Hallo Stefan"}
  • in the above case **614 is my internal office number
  • for playing audio files (or DTMF tones), use something like
{"call_sip_uri":"sip:**1@192.168.178.1:5060","audio_file_url":"https://xxx.duckdns.org/local/open_door_short.mp3", "call_duration":"6"}

and store mp3 files in folder \config\www. Note that the call is automagically ended after six seconds.

Samba share

  • to be able to access and edit files on the Raspberry from a Windows machine
workgroup: WORKGROUP
username: ##replaceme##
password: ##replaceme##
interface: ''
allow_hosts:
  - 10.0.0.0/8
  - 172.16.0.0/12
  - 192.168.0.0/16
  - 'fe80::/10'
veto_files:
  - ._*
  - .DS_Store
  - Thumbs.db
  - icon?
  - .Trashes
compatibility_mode: false

Amazon Echo Dot and Spotify

  • see above for the Alexa Media Player stuff
  • to connect Spotify, I followed the stock description at https://www.home-assistant.io/integrations/spotify/
  • I could not connect to Spotify using https as Redirect URI, my Redirect URI is http://192.168.178.83:8123/auth/external/callback and I also added one user under Users and Access (my spotify login).
  • Before using the Echo Dot as a device for spotify, you have to run
alias: Spotify setup
description: ''
trigger:
  - platform: homeassistant
    event: start
condition: []
action:
  - service: media_player.select_source
    target:
      entity_id: media_player.spotify_swa72
    data:
      source: Stefans Echo Dot
mode: single

Note that spotify_swa72 is my media player. You can simply add another media player to lovelace. Or use a script to play a certain playlist

alias: Spotify play playlist
sequence:
  - service: media_player.play_media
    data:
      media_content_id: >-
        https://open.spotify.com/playlist/37i9dQZF1DXaIrEwuQ3hyy?si=887717bbbc1f46e9
      media_content_type: playlist
    target:
      entity_id: media_player.spotify_swa72
mode: single

motionEye

Reolink E1 pro camera

  • on IP 192.168.178.75; access to the internet normally blocked by the router

  • motionEye add-on

    motion_webcontrol: true
    ssl: true
    certfile: fullchain.pem
    keyfile: privkey.pem
    action_buttons: []
    
  • Now to the tricky part: the latency. To avoid that, I integrate the Reolink camera with the normal camera integration like that

    - platform: mjpeg
      name: melivingroom
      still_image_url: !secret melivingroom_still_image_url
      mjpeg_url: "http://homeassistant:8082/mjpeg"
    
  • The stream is in turn provided by motionEye (see configuration of the camera, section "Video Streaming")

  • to get the PTZ controls of the camera to work, I integrated the camera also thru the ONVIF integration

  • snapshots are located under \\192.168.178.83\share\motioneye\Camera2

Reolink RLC-511WA camera

  • on IP 192.168.178.32; access to the internet normally blocked by the router

  • integrated using https://github.com/fwestenberg/reolink_dev/

    • provides switches to turn functions on and off
    • the key for me to get motion detection running, was to make sure that I could access HA locally with HTTP
    • make sure that the camera has a normal user (not just admin)
    • make sure that http and ONVIF are enabled in network settings
  • processing the image is done thru motioneye like above

    • the camera has two streams
      • Clear (high-res) at 2560x1920, 20 fps, 4096, 2
      • Fluent (low-res) at 640x480, 10fps, 256, 4
    • motioneye is configured
      • rtsp://192.168.178.32:554/h264Preview_01_sub at 640x480, 10fps
      • section "Video streaming" at 10fps, 100%, Off, 8083, disabled, off

ftp add-on

  • to receive images and movies from the RLC-511WA camera, I've setup the ftp add-on
port: 21
data_port: 20
banner: Welcome to the Hass.io FTP service.
pasv: true
pasv_min_port: 30000
pasv_max_port: 30010
pasv_address: ''
ssl: false
certfile: fullchain.pem
keyfile: privkey.pem
implicit_ssl: false
max_clients: 5
users:
  - username: camera
    password: ## some password ##
    allow_chmod: false
    allow_download: false
    allow_upload: true
    allow_dirlist: true
    addons: false
    backup: false
    config: false
    media: true
    share: true
    ssl: false
log_level: debug

Fritzbox smart home

  • add the integration "AVM FRITZ!SmartHome"
  • use the user and password combination of the Fritzbox istelf to authenticate

Fritzbox Tools

  • no entries anymore in yaml files, all setup with the integrations UI
  • enabled entities switch.<ipad-xyz> to monitor kids WIFI

Fritzbox call monitor

  • see https://www.home-assistant.io/integrations/fritzbox_callmonitor/
  • Host: 192.168.178.1
  • Port 1012
  • Username hacallmon (using user hacallmon on Fritzbox)
  • Passwort of user XXX
  • you may need to enable the call monitor after a restart of the Fritzbox using "To activate the call monitor on your FRITZ!Box, dial #965 from any phone connected to it."
  • hacallmon has rights to ...
    • FRITZ!Box Einstellungen
      • Sprachnachrichten, Faxnachrichten, FRITZ!App Fon und Anrufliste
      • Smart Home

Influxdb

  • installed with default settings
auth: true
reporting: true
ssl: true
certfile: fullchain.pem
keyfile: privkey.pem
envvars: []

Grafana

  • installed with configuration (note the plugin to visualize discrete values)
plugins:
  - natel-discrete-panel
env_vars: []
ssl: true
certfile: fullchain.pem
keyfile: privkey.pem

Useful stuff

Template

  • Prints out all entities
{% for state in states %}
{{ state.entity_id }}
{%- endfor -%}

or

{% for state in states %}
{{ state.entity_id }}, {{ states(state.entity_id) }}
{%- endfor -%}

Push automation to github

- id: l1k3
  alias: push HA configuration to GitHub repo
  trigger:
    - at: '23:23'
      platform: time
  action:
    - service: shell_command.push_to_github
  mode: single

And there is an entry in my configuration.yaml file with

shell_command:
  push_to_github: /config/gitpush.sh
  • note to myself: check your .gitignore files if something doesn't get pushed. Images need to be added manually with git add -f foo.jpg

notepad++ tips

Garage

  • Garage has one Shelly 1
    • http://s2/
    • Name in Shelly: shelly1_garage
    • Timer: Auto-off after 1s
    • Detached Switch - Set Shelly device to be in "Detached" switch mode - switch is separated from the relays.
  • in HA
    • Device shelly1_garage
    • Entities
      • switch.shelly1_garage (opens or closes the garage)
      • binary_sensor.shelly1_garage_input (had to enable the entity manually; indicates whether garage is open or closed)
        • cover.garage_door, see covers.yaml

Naming conventions for shelly devices

  • The shelly device itself has a name (set in the UI of the shelly)
    • <device-type>_<location>
    • The same name is given to the device for the static ip adress in the fritzbox
      • <device-type>-<location>
  • Naming conventions for the channels
    • <device-type>_<location>_switch (for the shelly1 and plugs)
    • <device-type>_<location>_<function> (for the shelly25)
    • note: haven't done this consistently :-/
  • How to add a new shelly?
    • wire the shelly
    • connect to shelly's hotspot
    • for roller-shutter, select roller shutter
    • calibrate
    • connect to local WIFI
    • set DNS in fritzbox
    • update firmware of shelly using http://archive.shelly-tools.de
    • add device name
  • I had a mess of devices and entities ...
    • delete all shelly integrations one by one .. (after having completed the renaming orgy)
    • restarted HA
    • HA discovers new shelly devices and shows them with "shellyswitch25-XXX". As soon as you click on "Configure" it replaces the device name with the one set in the shelly directly. Pick the right area and you're done.
    • watch out: if you have changed the channel names for a shelly25, the entities are named after the channel names!

Too many homekit bridges

  • I noticed two homekit bridges in my HA and, upon any restart, HA discovered yet another one.
  • Removed all bridges from HA
  • Deleted all bridges on the iPad
  • Restartet HA
  • Paired the bridge
  • All configuring now thru yaml
  • Re-doing the stuff is actually pretty quick

Using MQTT explorer

  • install it on a Windows machhine
  • connect to the broker with
    • username swamq
    • passwort
    • host homeassistant-eth
    • port 1883

About

No description or website provided.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors