Klingelerkennung mit FHEM und 1-wire

Die Vorteile einer solchen Schaltung sind z.B.:

  • man kann sich per PushOver informieren lassen wenn es klingelt, auch wenn man auf dem Balkon sitzt und sonst die Klingel nicht hören würde
  • man weiß ob der Paketzusteller wirklich versucht hat das Paket zuzustellen!?
  • mann kann zu bestimmten Zeiten die Klingel einfach vollkommen deaktivieren, z.B. in der Nacht, wenn das Oktoberfest tobt 🙂

Hier ein Schaltplan zur Klingelsignalerkennung an einer 8V Wechselstromklingel mit 1-Wire:

Klingelerkennung Schaltplan

In Fhem eingebunden schaut das ganze dann so aus:

Per PushOver kann man sich dann bequem über Klingelevents informieren lassen:

Control LG Tv with FHEM

If you want to integrate your LG TV in the FHEM home automation solution, my 82_LGTV2011.pm and 82_LGTV2012.pm modules can help. Here a short tutorial on how to get it working:

First you have to find out which API your LG TV uses. In principle there are three different APIs (1.0/2.0/3.0) corresponding to the 2011, 2012 and 2013 series. The former should use the LGTV_2011 module whereas the latter should use the LGTV_2012 module. If you are not sure which series you have, you can also try the two LG Remote apps and see which one works (2011 / 2012).

Make sure these perl modules are installed:

LWP::UserAgent
HTTP::Request::Common
XML::SIMPLE

If you are on a linux box:

If you are on another machine with full perl:

Before you install XML::Simple, you must have an XML parser module like XML::Parser or XML::SAX installed. The easiest way then is to install with the CPAN shell:

If you are on an embedded system like the Fritzbox, you probably don’t have CPAN, so you have to download the modules by hand and put them in your perl installation.

Now you can define the TV in fhem for 2011 series :

and for 2012 series and up:

To power on, you can use a cec-client and define a poweroncmd:

And finally an example by Franz Tenbrock how to build a soft remote with the remotecontrol module:

remotecontrol

Furthermore the fhem discussion board members Kuzl & Franz developed an electronic program guide for fhem which can be integrated as follows:

Add the following definitions to your fhem.cfg

Download the channel icons from here and put them into /opt/fhem/www/images/default and do a shutdown restart.

Switching to channels in the EPG currently only works for the lgtv2011 module.
In 99_myUtils.pm add the function:

Make sure channelMap is adjusted to your sender positions.

Now you should be able to see the current and upcoming programs and switch to them by simply clicking on them.

EPG

Echo ROS topics from a remote roscore

I needed to display some topics registered to my the roscore on the raspi on my main computer for debugging and visualization. That should have been easy in theory, as simple as exporting the ROS_MASTER_URI on my main computer:

[code]export ROS_MASTER_URI=http://raspberrypi:11311[/code]

However after that I was able to list the topics with:

[code]rostopic list[/code]

But I couldn’t echo the topic with:

[code]rostopic echo /imu_quat[/code]

there was simply no output. Directly exporting the IP in the master uri to avoid the name resolution didn’t help either.

The trick was to use a name and to make sure it gets resolved locally ?!?
You can achieve that by editing your hosts file:
[code]sudo nano /etc/hosts[/code]
There you should add something like:
[code]192.168.181.12 raspberrypi[/code]

I hope this saves other people some time.

FritzBox debug.cfg editieren

Wenn man Befehle bei jedem FritzBox Start ausführen mag z.B. eigene Programme nachinstallieren, FritzLoad! oder FHEM kann man dies in der debug.cfg tun.

Das geht ganz einfach mit dem vi Derivat nvi:

dann vi typisch:

  • i für insert
  • dd um Zeile zu löschen
  • esc+:q zum abbrechen
  • esc+:wq zum speichern

Um zum Beispiel FHEM als root zu starten müsste die Zeile:

/var/InternerSpeicher/fhem/startfhemAsRoot

eingefügt werden. Das Ganze geht allerdings auch noch einfacher als One-Liner: