Skip to main content
 

How to use FHEM with Home Assistant

2 min read

I have started several years ago using FHEM to automate some of my devices. Last year though, I discovered Home Assistant. It fits much better my technology stack as it's written in Python instead of Perl, so I started to migrate to it.

As always I'm running against some walls. It was impossible to get my IR-bridge (which switches on the amp) running in Home Assistant, so I needed a way to use the existing FHEM within Home Assistant.

First I opened a new FHEMWEB port (bind only on localhost) with csrfToken check switched off:

fhem.cfg:

define WEBapi FHEMWEB 8086 global
attr WEBapi csrfToken none
attr WEBapi allowFrom 127.0.0.1

Now it's possible to add shell commands to Home Assistant, it could look like this:

configuration.yaml:

shell_command:
  fhem_shutdown_all: /usr/bin/wget -q http://127.0.0.1:8086/fhem?cmd.Stop_mediacenter=set%20Stop_mediacenter%20on 
  fhem_start_first: /usr/bin/wget -q http://127.0.0.1:8086/fhem?cmd.wz_XBMC=set%20wz_XBMC%20on

As I use homeatic I need to wire everything together in scripts.yaml:

# Use scripts with homeatic keypress as there is no delay
# https://github.com/danielperna84/pyhomematic/issues/106
turn_all_off:
  sequence:
    - service: light.turn_off
      entity_id: light.living_room
    - service: shell_command.fhem_shutdown_all

And here I bind the turn_all_off to my Homematic Switch:

- alias: "Alle Geraete Aus"
  trigger:
    platform: event
    event_type: homematic.keypress
    event_data:
       name: WohnzimmerSchalter
       channel: 1
       param: PRESS_SHORT
   action:
     - service: script.turn_on
       entity_id: script.turn_all_off

This is my second post of my home automation series, I hope it helps someone :)

 

My road to a privacy voice assistant

2 min read

Mycroft as voice assistantSince ages I have worked sporadicly on my home automation system. My first and biggest motivation was   to get ONE button to start the music system and play my music. Meanwhile I got a bigger plan: TELLING the system to play music.

And it should not be a kitchen radio with a lousy speaker.  I got the button-press-music working, and it does a lot:

  • Switches on the power plug from the amp
  • Switches on the amp with a IR-bridge
  • It sends a WOL packet to the mediasystem (Kodi)
  • It chooses a album from my media collection and sends a API call to Kodi to start playing

Right now it's buried into fhem (my old home automation software) and some custom python scripts. To be honest I don't know how it works anymore :)

So, to get the music played, I now only need to press ONE button :) But my plan is to tell the system "play music", just like Alexa in the tv spots. But of course, Alexa, Spotify and all the other cloud services are not an option as I want my system to be open source and to protect one's privacy.

That is why I've baked the Mycroft Mark II at Kickstarter and I plan to get my home automation setup ready for it! Here is what Mycroft wants to be:

The open answer to Amazon Echo and Google Home. Mycroft brings you the power of voice while maintaining privacy and data independence.

If all goes well Mycroft Mark II will be shipped by the end of the year. To get ready for it I plan to do a series of blog posts about it:

  • Describe the system I use and what i have learned
  • Integration of Kodi as a media center

...

 

 

Alben des Jahres 2017

1 min read

Best musik 2017

  • Spoon - Hot thoughts
  • Angus & Julia Stone - Snow
  • The War On Drugs - A Deeper Understanding
  • Daughter - Music from Before the storm
  • LCD Soundsystem - American Dream

 

Portknox Update March

1 min read

Just published a monthly update on Portknox.net.
My Nextcloud Hosting company.

 

10x10: Gloomhaven ist angekommen!

1 min read

Vergangenen Samstag ist Gloomhaven bei mir angekommen, das umfangreichste und auch teuerste Spiel meiner 10x10 Liste. Trotz früher Vorbestellung musste ich am Veröffentlichstag noch den Versender wechseln und ein wenig mehr bezahlen. Die Nachfrage ist wohl sehr hoch.

Das Removal Sticker Set ist zur Zeit ebenfalls schwer zu bekommen. Dieses Set ist sinnvoll, wenn man das Spiel irgendwann weitergeben oder komplett von vorne anfangen will. Ich hole es mir wohl später, vorerst klebe ich auch Kreppband wie der Austrian Boardgamer drauf.

Ein ganz anderes Thema sind die irre Menge an Karten, Figuren, Bögen und Marker. Ich kann vorerst alles auf meinen (extra dafür gebauten) Spieltisch liegen lassen aber irgendwann muss das Zeug sinnvoll sortiert werden. Bei Boardgamebuds habe ich schon mal ein paar Ideen gefunden.


Hier der Status meiner 10x10 Herausforderung.

 

Herausforderung 2018: Spiele 10 Brettspiele 10 mal

1 min read

Auf die Idee bin ich durch Boardgamegeek gekommen. Da ich sowas noch nie gemacht habe, kommt nur die Normal Challenge in Frage. Heißt, ich darf jederzeit Spiele austauschen. Bei der Hardcore Challenge legt man anfangs 10 Spiele fest und darf nur ein Spiel austauschen, dieses Alternativspiel ist aber ebenfalls festgelegt.

Meine vorläufige Liste:

1. Mansions of Madness: Second Edition
2. Gloomhaven
3. Shadowrun Crossfire
4. Magic The Gathering - Commander
5. Stone Age
6. 7 Wonders Duell
7. Letters from Whitechapel
8. Fabelsaft
9. Legends of Andor
10. El Grande

Damit nicht genug, außerdem möchte ich über den Fortschritt hier berichten und regelmässig Updates posten.

Update 23.1.2018

Ich habe eine Fortschrittseite 10x10 eingerichtet.

 

Alben des Jahres 2016

1 min read

  • Frightened Rabbit - Painting of a panic attack
  • Radiohead-Special - A moon shaped pool
  • Pantha Du Prince - The triad
  • The Jezabels - Synthia
  • Explosions In The Sky - The wilderness

 

Alben des Jahres 2015

1 min read

  • Chelsea Wolfe - Abyss
  • Steven Wilson - Hand. Cannot. Erase.
  • Beach House - Depression Cherry
  • Dan Mangan + Blacksmith - Club meds
  • Blur - The Magic Whip