OpenHAB: Turn on heating whenever someone’s in the home office

Home automation is nothing without automation, so I set up my first rule yesterday.

As previously posted I have a testing environment consisting of a Devolo heat valve and a Fibaro wall plug. The wall plug is connected to my desktop computer which I often use when I’m working in my home office (like now).

Instead of having to manually turn on and of the heating whenever I’m in the home office I wanted to automate that. The following rule was born:

heizung_pc.rules

rule "heizung_pc"
when
    Item Wall_Plug_Power changed
then
    if(Wall_Plug_Power.state > 30.0)
    {
        sendCommand(Thermo_TempSet, 21)
    }
    else
    {
        sendCommand(Thermo_TempSet, 18)
    }
end

It’s nothing more than that with OpenHAB.

UPDATE: I reworked the rule and set up a more complex system that is much more flexible. The Sitemap now allows the user to set the temperatures they want for “PC is turned on” and “PC is turned off”. It is also possible to overwrite the temperature until the next time the PC is turned on/off.

I won’t paste the whole config into this post, because it’s a bit bigger. See Pastebin for how I did my setup:

Sorry for the german/english mixup in the files. I usually like to do everything programming-related in plain English, but this is a system used by Germans (me and my wife), so I have to account for that.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s