FHEM, FS20, FHZ1000 on Linux

Forum about the home automation suites by ELV etc

Moderator: jrkalf

Post Reply
User avatar
jrkalf
Member
Member
Posts: 291
Joined: Fri Nov 12, 2010 4:20 pm
Location: Nootdorp
Contact:

FHEM, FS20, FHZ1000 on Linux

Post by jrkalf »

Hi,

I've just started a little domotica project of myself. Basically with the silly notion of "Because I can" and because I'm bugged the hell out of the house the wife and I bought.
The previous owners (first owners) and builders had build very illogical design of the lightswitches:
- An attic with the light switch only up top? Not at the stairs below leading to it.
- A light switch for the hallway at the front door, but not at the door to the living room (5 meter span)

So I started with my little homeserver (running Ubuntu) and FHEM. It's a german program (which is hell for me, I'm dutch guy with an very bad degree in german language) which is primarilly written for use with FS20 equipment. I must say it's not the best looking program around, but it gets the job done and logs everything to a file. This is quite handy. It'll allow me to incorporate scripts able to filter the logfiles and present them in an orderly fashion.

FHEM gets the job done. As soon as I get something presentable to you all, I'll start linking it.
If you can't fix it with a hammer, you've got an electrical problem!

Fibaro HC2, various z-wave switching, alerting, detection modules.
ELV FHT80b heating system.
User avatar
jrkalf
Member
Member
Posts: 291
Joined: Fri Nov 12, 2010 4:20 pm
Location: Nootdorp
Contact:

Re: FHEM, FS20, FHZ1000 on Linux

Post by jrkalf »

Hi readers,

I've see the read count going up, but no responses. That figures as there wasn't much information to respond to.
I've been busy today, got my first setup to work and blogged a bit: http://jelle.kalf.org/2010/11/home-automation/.
I used to do some novice php programming, I'll have to brush those skills off again. I've gotten FHEM to log to a mysql database. That part I should be able to connect to the wordpress blog, so I can pull the latest state changes from that database without allowing anybody access to the actual FHEM program.

I've also had a small forums contact with Ron. His project DomotiGa seems very interesting to try as well, but support for FS20 is going to be tough. I'll be installing it in the next couple of days and checking it out. Perhaps I'll leave FHEM, but for now I'm quite happy with what it does. It's butt ugly on the front-end, but it does it's job perfectly.
If you can't fix it with a hammer, you've got an electrical problem!

Fibaro HC2, various z-wave switching, alerting, detection modules.
ELV FHT80b heating system.
User avatar
jrkalf
Member
Member
Posts: 291
Joined: Fri Nov 12, 2010 4:20 pm
Location: Nootdorp
Contact:

Re: FHEM, FS20, FHZ1000 on Linux

Post by jrkalf »

FS20 update again. (it's going to be a personal blog if nobody is responding to this topic)
Stardate: ... whatever, I like startrek, but I'm not a trekkie.

FHEM is up and running now with the first 4 switches installed. I have a mix of FS20-WS1 (build-in solution) and FS20-ST3 (wall socket solution)
Easiest way to get started is to install and start FHEM with a FHZ1000pc connected. After that start flipping a switch and it'll get registered in FHEM under the tab FS20.

Downside: naming schema. It'll get named like FS20_11a111 (the 11 and a stand for a code, which comprises the housecode and device number. NO, I'm ofc not giving you mine ;) )
To correct this:

Code: Select all

rename FS20_11a111 realname
After this it'll still be in the FS20 tab (FHEM calls it a "room"). You have to move the device to the correct room (if you want that to happen) by clicking on the device, select "room" in the dropdown menu and then alter the value and press attr. <-- this last bit is important. Pressing the enter key instead of clicking attr does something entirely different. The default action isn't mapped to the attr button!
after this add a type (like the room type) called "model" and give it the correct model name to prevent trying to dim a on/off switch etc ;)
If you can't fix it with a hammer, you've got an electrical problem!

Fibaro HC2, various z-wave switching, alerting, detection modules.
ELV FHT80b heating system.
User avatar
jrkalf
Member
Member
Posts: 291
Joined: Fri Nov 12, 2010 4:20 pm
Location: Nootdorp
Contact:

Re: FHEM, FS20, FHZ1000 on Linux

Post by jrkalf »

Next up FHEM and database logging:
Fhem is by default logging all of it's stuff to files and needs to for multiple modules are written for it.
But FHEM is also capable of logging to database, which makes the life of a none-programmer like me a lot easier. I've used PHP to extract the information from the database and present it on my domotica page: http://jelle.kalf.org/house-status/

To define a database in FHEM 2 steps have to be done outside fhem.
1. Copy the 93_DbLog.pm file into the FHEM direcory.
2. Create a database configuration file to which FHEM can link to retrieve it's credentials from
(in my example it's on /wedontcareaboutthelocation/fhem.cfg)

After this you can define database logs like this:

Code: Select all

define huppeldepup_dblog DbLog /wedontcareaboutthelocation/fhem.cfg huppeldepup
What does this mean?
1. All definitions start with define.
2. Then you give the log a UNIQUE name in my case I use the same name for every UNIQUE device with added _dblog or _filelog etc etc.
3. followed by the logtype: DbLog or FileLog. <case sensitive!>
4. followed by the configuration file. This has to be the full path to the cfg file and a hint: Don't place it inside your FHEM or webserver directory!
5. this is the UNIQUE device code you've given your device.

Et voila, your DB log is up and running.
---

What does this DbLog.pm exactly log? It maintains 2 tables inside a database. Current and History (obvious naming, no?)
The current only contains 1 entry per unique device giving you an option to query that table and get 1 result only. This result will cary the value of the last seen activity and the time/date it happened. (on/off/dim) at time blahblah blah (see the website output http://jelle.kalf.org/house-status/. It contains the word " at " in the middle, but that's an exact print from the database).
The history table covers the full history for all devices.
If you can't fix it with a hammer, you've got an electrical problem!

Fibaro HC2, various z-wave switching, alerting, detection modules.
ELV FHT80b heating system.
Post Reply

Return to “Homematic, FS20, FHT, ESA and ELV”