Sharing openHAB config (rules etc)

4,265 views
Skip to first unread message

Ben Jones

unread,
Oct 7, 2013, 7:56:08 PM10/7/13
to ope...@googlegroups.com
Hi,

I am very interested to learn how others are using openHAB. In particular what rules/config you have setup, and what ways you are automating your home. I am finding that now I have most things 'connected'  to openHAB I need to come up with clever and useful ways of automating and linking devices together to make life easier. I am sure there are many uses that I haven't even considered yet, hence this email, to try and learn from all the other openHAB users out there!

Attached is a full set of my config, including all item definitions and rules. I have removed all user names, passwords and email addresses (hopefully!).

I would welcome any feedback or suggestions relating to my rules etc, but more so I would love to see other peoples configs to try and learn how you are using openHAB and get some inspiration for my own setup.

Many thanks!
Ben


configurations.zip

karsten.k...@gmail.com

unread,
Oct 8, 2013, 6:20:37 AM10/8/13
to ope...@googlegroups.com
hi,
 
I am far behind you - but would be interested as well.
 
One question - in your zip you have splitzted your items in differnt files - is this working with only one sitemap? I thought naming of item, sitemap and rules file need to be similar.
 
thx
Karsten
 
 

Chris Jackson

unread,
Oct 8, 2013, 6:49:27 AM10/8/13
to ope...@googlegroups.com
Items can be split across multiple model files - there's no link between sitemap files and item files.

Chris

Ben Jones

unread,
Oct 8, 2013, 3:10:55 PM10/8/13
to ope...@googlegroups.com
As Chris said - there is nothing tying item file names together. Anything in the /configuration/items/ folder with an extension .items will be loaded and parsed. Same for rules, sitemaps, scripts and transforms.
--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/kS-gfOkBqfI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/groups/opt_out.

Ben Jones

unread,
Oct 10, 2013, 7:25:41 PM10/10/13
to ope...@googlegroups.com
So no one is keen to share?!

hlw3...@gmail.com

unread,
Oct 11, 2013, 12:59:24 AM10/11/13
to ope...@googlegroups.com
Well, yes, I am but I think there's more to it than posting the configuration.

I started a similar thread on the German forum a while ago and got about the same activity.

Nevertheless, I think it's best to post detailed descriptions rather than full configs.

I 'll put some life into this this weekend :-)

Kr, Sascha

Ben Jones

unread,
Oct 11, 2013, 1:09:11 AM10/11/13
to ope...@googlegroups.com
It is a good starting point tho ;). Once your config is posted I am sure discussion will follow...and if anyone has questions about mine then fire away!

Pauli Anttila

unread,
Oct 11, 2013, 1:33:30 AM10/11/13
to ope...@googlegroups.com
Thanks Ben for the sharing. I got few nice ideas from your rules.

My configurations a far away from complete. I'm still developing the last binding (open energy monitor binding). After 1,5 years hard development and 8th bindings, I can now start to concentrate the rules, sitemaps, etc. So currently I don't have anything to share, but bindings :)

Btw, you seems to have many weather items, which fetch the same information. I have added cache feature on the http binding, so you could use that to fetch information more frequently, but still not "overloading" the server.

Regards,
Pali


2013/10/11 Ben Jones <ben.j...@gmail.com>
It is a good starting point tho ;). Once your config is posted I am sure discussion will follow...and if anyone has questions about mine then fire away!

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.

Cyril Jaquier

unread,
Oct 11, 2013, 1:34:48 AM10/11/13
to ope...@googlegroups.com
I also plan to share mine but it is currently a bit "messy" and I hate sharing messy things ;-) I will reorganize the whole configuration a bit and share it as you did.

Cheers,
Cyril

Ben Jones

unread,
Oct 11, 2013, 4:51:33 AM10/11/13
to ope...@googlegroups.com
Thanks for the tip Pali - I will look into using that caching.

I look forward to seeing your config one day!

RGL

unread,
Oct 11, 2013, 7:01:04 AM10/11/13
to ope...@googlegroups.com
I really like the idea of sharing some configuration files. It is a real good starting point, especially for openHAB beginners like me.
Could you guys put this into the openHAB Samples Wiki? In a few days from now  nobody will find this data in such a thread anymore :o)
Thanks,
Ronny

Greg

unread,
Oct 11, 2013, 10:49:38 AM10/11/13
to ope...@googlegroups.com
Ben, 

I'm a bit reluctant since my configurations are a continual work in progress and would need A LOT of cleaning up (which I'm planning on doing of course - some day), and there is a lot of private things that would have to be stripped out of course.

I will post a few of the more interesting configs shortly though.

Greg

Ben Jones

unread,
Oct 11, 2013, 4:04:05 PM10/11/13
to ope...@googlegroups.com
To be honest guys, I am more interested in concepts and ideas, rather than beautifully crafted/presented configs - I am most interested in what people have automated and how they are using and linking devices together to make their lives/homes better and more efficient.

I look forward to seeing what you guys have!

PS - I am not sure if we can upload zipped files to the WIKI - anyone know? Don't really want to be uploading the scripts as raw text. 

Ben Jones

unread,
Oct 11, 2013, 4:12:12 PM10/11/13
to ope...@googlegroups.com
BTW - Pali I just created a pull request with a fix for the HTTP binding. Once I added some cached bindings I was seeing exceptions when openHAB started up. Have a look at my change and see what you think - it has resolved my exceptions but wanted you to run your more experience eye over it if possible!


On Friday, 11 October 2013 18:33:30 UTC+13, Pali wrote:

Greg

unread,
Oct 11, 2013, 5:14:07 PM10/11/13
to ope...@googlegroups.com
I have a rule that calculates evapotranspiration ETo for grass using the Hargreaves equation.  This is an extremely simpified calculation of ETo to calculate the moisture loss in mm/day.  The idea is that at midnight, you would know how many mm water was lost.  You would have to calibrate your sprinklers in mm/minute which is easy to do with a bucket.  So if at the end of the day there, say there is 2mm of moisture loss, I can then have a rule that will run your sprinklers x minutes it takes to water 2mm on my lawn so there is no net moisture loss.    If you have rainfall amounts, you can adjust your rule as well.

I have an item:
Number ETo "ETo [%.1f mm]" <evaporation> (Weather)  //Evapotranspiration
Number Weather_Temp_Max "Todays Maximum [%.1f °C]" <temperature> (Temperature,Weather_Chart,Weather)  //standard source and rule to calculate this
Number Weather_Temp_Min "Todays Minimum [%.1f °C]" <temperature> (Temperature,Weather_Chart,Weather)  //standard source and rule to calculate this


and the rule:
import org.openhab.core.library.types.*
import java.lang.Math
import java.util.Calendar

/** 
 * Rules for calculating reference evapotranspiration ETo for
 * grass using the Hargreaves equation
*/


var double PI = 3.14159265
var double solar_const = 0.0820

var double latitude = xx.xxxx  //Latitude of location in decimal degrees

rule "Hargreaves ETo"  //evapotranspiration in mm / day
when
Time cron "0 59 23 * * ?" //runs just before midnight
then
var double tmin = Weather_Temp_Min.state as DecimalType
var double tmax = Weather_Temp_Max.state as DecimalType
var tDiff = tmax - tmin //difference between max and min temperatures
var tmean = (tmax + tmin) / 2 //mean temperature
var doy = Calendar::DAY_OF_YEAR  //day of the year
var lat_rad = latitude  * (PI / 180)
var sd = 0.409 * Math::sin(((2 * PI / 365) * doy - 1.39).doubleValue()) // solar declination (rad)
var sha = Math::acos((-Math::tan((latitude * (PI / 180)).doubleValue()) * Math::tan(sd.doubleValue())).doubleValue())  //sunset hour angle
var irl = 1 + (0.033 * Math::cos(((2 * PI / 365)* doy).doubleValue()))   //inverse relative distance earth-sun [dimensionless]
        //the next three lines break down the incoming solar energy equation so I could read it in my text editor
var tmp2 = sha * Math::sin(lat_rad.doubleValue()) * Math::sin(sd.doubleValue())                   
var tmp3 = Math::cos(lat_rad.doubleValue()) * Math::cos(sd.doubleValue()) * Math::sin(sha)  
var Ra = (1440 / PI) * solar_const * irl * (tmp2 + tmp3)  //incoming solar energy
var hETo = 0.0023 * (tmean.doubleValue() + 17.8) * Math::pow(tDiff.doubleValue(),0.5) * Ra
ETo.postUpdate(hETo.doubleValue())
end


Greg

On Monday, October 7, 2013 6:56:08 PM UTC-5, Ben Jones wrote:

Ben Jones

unread,
Oct 11, 2013, 5:47:56 PM10/11/13
to ope...@googlegroups.com
That is what I am talking about! Nice one Greg - that is very clever!! I will look to implement something like that for sure. 

Greg

unread,
Oct 11, 2013, 6:43:56 PM10/11/13
to ope...@googlegroups.com
I have another rule that monitors a local weather warning rss feed and will notify me if severe weather is coming.  My feed was very local, I've modified it here for meteoalarm.eu which seems to cover a much larger area.  The idea is if severe weather is coming, besides notifications, other rules/scripts can be executed (close garage doors, shut blinds etc).  Yes, I know I could have done this with the http binding, but at the time I was looking at a way to parse an xml page at a specific time of day (ie. just before going to work) but just ended up running it all of the time.

Item:
String wx_Warning

rule:
import org.openhab.model.script.actions.*
import org.openhab.core.library.types.*
import java.util.regex.Pattern
import java.util.regex.Matcher

rule "Get Wx Warning"
when
System started or
Time cron "0 0/2 * * * ?" //update every 2 minutes
then
logInfo("Wx Rules","Getting Wx Warinings")
var String RawWrng = sendHttpGetRequest("http://www.meteoalarm.eu/documents/rss/uk/UK016.rss")  //this is just an example, you can get your own local rss feed from www.meteoalarm.eu
var Pattern pWrng = Pattern::compile("<td width="28"><\\/td><td>(.*?)<\\/td><\\/tr>")  //common delimiter - subject to change (note, that is not backslash then a V, but two backslashes and a forward slash)
var Matcher mWrng = pWrng.matcher(RawWrng)
if (mWrng.find()){
var String wxWarning = mWrng.group(1)
logInfo("wx Rules","Found wx Regex Match")
if (wxWarning != wx_Warning.state.toString ) {
postUpdate(wx_Warning,wxWarning)
logInfo("wx Rules","Updating Wx Warning")
if(wxWarning != "No special awareness required"){
logInfo("wx Rules","Sending wx warning email: " + wxWarning)
sendXMPP("<your contact>","wx Warning: " + wxWarning)
sendMail("<your email>","wx Warning",wxWarning)
                        // add any other rules
}
}
}
end

That's about the only other unique one I have working so far.

Greg


On Monday, October 7, 2013 6:56:08 PM UTC-5, Ben Jones wrote:

Romain Bourdy

unread,
Oct 12, 2013, 5:57:06 AM10/12/13
to ope...@googlegroups.com
Nice package,

My energy cost calculation differs a bit from yours, I'm using jodatime & persistance for such.


import org.openhab.core.library.types.*
import org.openhab.model.script.actions.*
import java.lang.Math
import java.util.Calendar
import java.util.Date



rule "EDF Chart"
when
        Item EDF_HP received update or
Item EDF_HC received update
then
var DecimalType startHP 
var Number startHC
var Number stopHP
var Number stopHC
var Number tmp
var Number prix_hc = 0.0000678132  // 0.0567/1000*1.196
var Number prix_hp = 0.0001095536  // 0.0916/1000*1.196

        if (EDF_HP.state instanceof DecimalType && EDF_HC.state instanceof DecimalType) {
                stopHP  = EDF_HP.maximumSince(now.toDateMidnight).state as DecimalType
                stopHC  = EDF_HC.maximumSince(now.toDateMidnight).state as DecimalType

// Today
                startHP = EDF_HP.minimumSince(now.toDateMidnight).state as DecimalType
                startHC = EDF_HC.minimumSince(now.toDateMidnight).state as DecimalType
tmp = stopHP+stopHC-startHP-startHC
                postUpdate(EDF_Today, tmp)
tmp = (stopHP-startHP)*prix_hp+(stopHC-startHC)*prix_hc
                postUpdate(EDF_Today_Euro, tmp)
// Month                
                startHP = EDF_HP.minimumSince(now.toDateMidnight.withDayOfMonth(1)).state as DecimalType
                startHC = EDF_HC.minimumSince(now.toDateMidnight.withDayOfMonth(1)).state  as DecimalType             
                tmp = stopHP+stopHC-startHP-startHC
                postUpdate(EDF_Month, tmp)                
                tmp = (stopHP-startHP)*prix_hp+(stopHC-startHC)*prix_hc
                postUpdate(EDF_Month_Euro, tmp)
// Year

                startHP = EDF_HP.minimumSince(now.toDateMidnight.withDayOfMonth(1).withMonthOfYear(1)).state as DecimalType
                startHC = EDF_HC.minimumSince(now.toDateMidnight.withDayOfMonth(1).withMonthOfYear(1)).state  as DecimalType             
                tmp = stopHP+stopHC-startHP-startHC
                postUpdate(EDF_Year, tmp)
                tmp = (stopHP-startHP)*prix_hp+(stopHC-startHC)*prix_hc
                postUpdate(EDF_Year_Euro, tmp)
}        
end

Ben Jones

unread,
Oct 12, 2013, 6:20:15 AM10/12/13
to ope...@googlegroups.com
Thanks Romain - could you provide some explanation as to how your calculations work?

Romain Bourdy

unread,
Oct 12, 2013, 9:23:52 AM10/12/13
to ope...@googlegroups.com
Hi,

Unsure of what isn't clear for you so I'll try the basic explanation. Here in France we can have 2 or even more cost for the current, peak hours ( HP, heures pleines ) & and lower rate hours ( HC = Heures creuses ) in my case.

Both values are counter based on what is read from the energy provider counter ( Serial port alike ), both index are EDF_HP & EDF_HC.

Those values are persisted in a db4o database aswell as the prices ( prix_hc & prix_hp ). The rest of the rule is, I guess self explanatory, read index at a given point in time, calculate the delta until now ( stop_H* ) and multiply by the price for each counter before posting the update in Number items.

HTH,
-Romain B.

Chris Jackson

unread,
Oct 12, 2013, 9:45:16 AM10/12/13
to ope...@googlegroups.com

Hi Ben,

Thanks for sharing :)

 

Currently, my setup is quite minimal as I'm spending quite a bit of time putting together HABmin to make it easier (for me) to use openHAB. It's interesting however that you sent out this mail about sharing configs - especially rules - since the feature I'm working on in HABmin at the moment is a rule "library".

 

The library is stored in an XML file, and you can "simply" apply a rule to an item by clicking a couple of buttons - at least that's the plan! It won't cover all the fancy rules that people have, but my personal interest is for all the "simple" rules that I think I need (deriving the maximum temperature today, or calculating the power used by a light...).

 

Anyway, I'll post more on this shortly - it should be ready for use in the next day or so (it's mostly working, so I just need to test it a bit more), but I thought I'd mention it here as it's sort of linked to the discussion about sharing rules...

 

Cheers

Chris

 

Ben Jones

unread,
Oct 13, 2013, 7:23:31 PM10/13/13
to ope...@googlegroups.com
Romain - ok I follow you now - unfortunately my energy monitor only gives me instantaneous readings of current usage (W) and tariff (since I also have peak/off-peak rates). Therefore for me to keep a running total of the energy usage/cost I need to manually calculate every few seconds based on the current usage - i.e. not very accurate!

So every 15s I check the current usage and assume it has been constant for the last 15s, calculate the cost of that usage, and add to my daily/monthly totals.

Not ideal but gives me a rough idea of how much energy I am using/costing which is fine for my needs.

Yours is a far more accurate approach, but unfortunately I cannot copy this since I don't have the necessary inputs from my monitor.

Romain Bourdy

unread,
Oct 17, 2013, 1:52:43 PM10/17/13
to ope...@googlegroups.com
Hi Ben,

 Don't you have some blinking light every kwh or something alike ?

Rgds,
-RB

Ben Jones

unread,
Oct 17, 2013, 3:16:38 PM10/17/13
to ope...@googlegroups.com
There is a flashing LED in my meter box which I considered attaching some sort of opto-sensor to. But the Owl CM160 clamp is much simpler and just sits around the incoming phase wire. The Owl receiver has a running total but it only outputs the instantaneous power usage to the USB port. The receiver also stores all readings and dumps them to the USB port but this isn't much use to me. This is used by the PC based software for the Owl which lets you periodically download the usage data to your computer and graph it etc.

Ralph Borchers

unread,
Oct 18, 2013, 2:28:36 AM10/18/13
to ope...@googlegroups.com
Hi Ben,

there is a very nice device made my some guys in the Netherlands - youless.nl. This device sits on the flashing LED on the meter and has a minimal http server that gives access to a JSON file with a current power usage and a running meter. (thanks to Jan-Piet Mens for pointing me towards it).

Ralph

Jan-Piet Mens

unread,
Oct 18, 2013, 2:34:55 AM10/18/13
to ope...@googlegroups.com
> This device sits on the flashing LED on the meter and has a
> minimal http server that gives access to a JSON file with a current power
> usage and a running meter.

Unfortunately it doesn't do native MQTT. I talked to the guys at
YouLess, who were interested, but it seems they cannot "fit" a
full-blown TCP stack onto the thing. I pointed out MQTT-SN and they said
they'd consider it. (Don't hold your breath.)

What I do is poll the JSON every couple seconds and publish that over
MQTT -- not 'sexy' but workable.

-JP

Ben Jones

unread,
Oct 18, 2013, 2:43:55 AM10/18/13
to ope...@googlegroups.com
Looks like a clever little device. Unfortunately I don't have a power plug or LAN connection in my meter box - it is an external meter box. The current Owl CM160 works pretty well, is battery powered and wireless so suits my needs pretty well.

Thanks for the tip tho.

Nico Lembrechts

unread,
Oct 18, 2013, 2:52:39 AM10/18/13
to ope...@googlegroups.com
Hi JP,

I just ordered one.
Are you willing to share your polling script/code ?

Regards.
Nico


2013/10/18 Jan-Piet Mens <jpm...@gmail.com>

Romain Bourdy

unread,
Oct 18, 2013, 3:04:11 AM10/18/13
to ope...@googlegroups.com
Hi,
I was more thinking of this kind of gadget with one-wire.

http://www.bwired.nl/How_stroom.asp

Rgds,
-RB

--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/kS-gfOkBqfI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.

Jan-Piet Mens

unread,
Oct 18, 2013, 3:07:35 AM10/18/13
to ope...@googlegroups.com
Nico,

> Are you willing to share your polling script/code ?

of course -- it's pretty trivial. Publishes look like this:

hw/youless 500
hw/youless 503
hw/youless 502
...

Script attached. (If it's scrubbed, yell, and I'll send it to you
directly.)

-JP
youless2mqtt.py

Ben Jones

unread,
Oct 18, 2013, 6:04:41 AM10/18/13
to ope...@googlegroups.com
Gotta love the simplicity of python + MQTT. Almost wish I could get my hands on one of these now!

Jan-Piet Mens

unread,
Oct 18, 2013, 6:28:06 AM10/18/13
to ope...@googlegroups.com
> Gotta love the simplicity of python + MQTT.

+100

-JP

Pauli Anttila

unread,
Oct 18, 2013, 9:56:48 AM10/18/13
to ope...@googlegroups.com
Did I miss something or why don't you just poll YouLess device by http binding? Then python script and MQTT broker is not needed.

Br,
Pali

Jan-Piet Mens

unread,
Oct 18, 2013, 11:48:08 AM10/18/13
to ope...@googlegroups.com
> Did I miss something or why don't you just poll YouLess device by http
> binding? Then python script and MQTT broker is not needed.

The Python and the MQTT thing for the YouLess predates my hearing of
openHAB. :-)

-JP

Frederico

unread,
Oct 24, 2013, 1:50:45 PM10/24/13
to ope...@googlegroups.com
Hi!

I am getting data from my Owl CM160 clamp using RFXCOM. It works neatly. I get both an instantaneous power usage and a running total (I then keep separate openhab "virtual" items for the daily and weekly usage)

regards,
   Frederico

Ben Jones

unread,
Oct 24, 2013, 3:09:11 PM10/24/13
to ope...@googlegroups.com
Unfortunately my Owl CM160 clamp is too far away from my RFXCOM receiver so I have to rely on the Owl RX module and its USB interface to get the energy data. This doesn't seem to send a running total however! Just instantaneous power and current tariff.

Frederico Mangas

unread,
Oct 24, 2013, 3:15:27 PM10/24/13
to ope...@googlegroups.com
Hi!

Well, in my case I receive the running total as "Total Amp Hours":
Inline images 1

In your case do you have any chance of extending the cable from the clamp to the transmitter so that you can place it in a "cleaner" line with your rfxcom receiver? It seemed to me like a simple cable.

Regards,
    Frederico


--
You received this message because you are subscribed to a topic in the Google Groups "openhab" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openhab/kS-gfOkBqfI/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openhab+u...@googlegroups.com.
image.png

Ben Jones

unread,
Oct 24, 2013, 3:19:51 PM10/24/13
to ope...@googlegroups.com
Yeah I have tested the RFXCOM binding with the Owl CM160 and have tried to get it to work - along with the running total there is also the battery indicator which is very useful for sending alerts in openHAB when it gets low. I would much prefer to use this interface rather than the receiver module + USB!
 
Unfortunately my clamp is in my meter box which is on the exterior of my house. And I am unable to get in behind the internal meter box (although I haven't tried properly...).
 
I can't move my openHAB server so the only other option is to have the RFXCOM receiver running on another device (I have a Raspberry Pi in the garage very near to the external meter box), but I don't fancy re-writing the RFXCOM binding to run stand alone just to handle this!
 
 

Frederico Mangas

unread,
Oct 24, 2013, 3:25:39 PM10/24/13
to ope...@googlegroups.com
Before using the rfxcom transciever I used to get consumption data to openhab by querying the OWL's windows service's mysql database. You have all the history there (no real time status though)

Regards,
   Frederico


--

Ben Jones

unread,
Oct 24, 2013, 3:26:44 PM10/24/13
to ope...@googlegroups.com
Yeah I am running Ubuntu so no windows service here sorry!

Gilbert B.

unread,
Oct 24, 2013, 4:15:22 PM10/24/13
to ope...@googlegroups.com
Hi Ben,

i'm just getting started on the openhab, and i started so i could do a graph of my IHC temperatures/heating, but i will defently use it with my squeezebox with a pir or wall switch to control music in kitchen, bathroom etc..

Ben Jones

unread,
Oct 25, 2013, 10:37:13 PM10/25/13
to ope...@googlegroups.com
I have just pushed some changes to the squeezebox binding/action to add more support and simplify the binding config. This should be available in the next release of openHAB.

David

unread,
Oct 26, 2013, 3:52:14 AM10/26/13
to ope...@googlegroups.com, Ben Jones
Hi Ben,

If you need the rfxcom transceiver to run on the Raspberry Pi you could also try to use ser2net or socat. The communication with the serial device is rerouted through a tcp port. The server with openHAB can listen on the TCP port of the RPi or you can define another socat rule to map the tcp port to a tty port. Then you can connect to a "virtual" serial port on your openHAB machine. And you don't need much software on the RPi.
I did some experiments with this setup (not Rpi) and it worked. Not sure on the long run, but you could give it a try. In the issue list I've also seen ser2net mentioned (I think Jan Willem).
If you are interessted I can post the config I used for this.

Cheers,
David

Op donderdag 24 oktober 2013 21:19:51 UTC+2 schreef Ben Jones:

Ben Jones

unread,
Oct 26, 2013, 7:01:03 AM10/26/13
to ope...@googlegroups.com
Thanks David but I managed to move my owl clamp to my internal switch board which is close enough to my RFXCOM receiver to pick up the energy messages. So everything is humming along nicely now!

Jonathan Giles

unread,
Oct 26, 2013, 7:41:15 PM10/26/13
to ope...@googlegroups.com
Ben,

I'm curious if you could explain what you're doing in the weather.items file - in particular it appears you're pulling down the weather graphic into Weather_TodayIcon and Weather_TomorrowIcon, but it isn't clear to me how you're using that. What does <w> mean for example? And do you have a collection of the weather graphics you can share if you're displaying them?

Thanks,
Jonathan

Ben Jones

unread,
Oct 26, 2013, 9:29:53 PM10/26/13
to ope...@googlegroups.com
Yep - I can't claim credit for the idea but basically by setting up the item like that and then creating a load of icons matching the weather report strings (see attached) you get a nice icon in the UI which changes depending on the weather report. Wunderground has a number of different icon sets from memory, I just picked the ones I liked best and renamed them to suit. 

The icon <w> doesn't actually exist - but the openHAB framework will automatically look for an icon which matches the item value appended to the icon in the binding - i.e. for 'cloudy' it will match 'w-cloudy' and display this. 

Works very nicely!
weather-icons.zip

Jonathan Giles

unread,
Oct 26, 2013, 9:34:44 PM10/26/13
to ope...@googlegroups.com
Very nice, thanks - once I dropped in those image files it works nicely.
The only thing I wish now is that we could make the text prettier -
'chancerain' really should be cleaned up to be 'Chance of rain', etc. I
might look into it if time permits.

-- Jonathan

Ben Jones

unread,
Oct 26, 2013, 9:36:54 PM10/26/13
to ope...@googlegroups.com, Jona...@jonathangiles.net
I think you can possibly do this with mappings? Although I have never tried, I think it should work ok.

Ben Jones

unread,
Jun 25, 2014, 8:53:46 PM6/25/14
to ope...@googlegroups.com, Jona...@jonathangiles.net
Anyone care to share their rules/config? Always interesting to see how others are 'automating' their lives!

dan cunningham

unread,
Jun 25, 2014, 11:14:33 PM6/25/14
to ope...@googlegroups.com
I was thinking about this as well!  I'm not sure what the best format to do this is; this group, the wiki, etc...


On Wed, Jun 25, 2014 at 6:53 PM, Ben Jones <ben.j...@gmail.com> wrote:
Anyone care to share their rules/config? Always interesting to see how others are 'automating' their lives!

--
You received this message because you are subscribed to the Google Groups "openhab" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openhab+u...@googlegroups.com.

To post to this group, send email to ope...@googlegroups.com.
Visit this group at http://groups.google.com/group/openhab.
For more options, visit https://groups.google.com/d/optout.

Ben Jones

unread,
Jun 25, 2014, 11:16:47 PM6/25/14
to ope...@googlegroups.com
I am not convinced uploading full configs to the WIKI is a great idea. Maybe snippets of useful/clever stuff in the samples section, but the demo config should be the first port of call for most users. I think here is fine, it is persistent and can be easily found by searching. Ideally these forums would allow stickies but that doesn't seem possible,

So does that mean you are going to share Dan?! ;)

dan cunningham

unread,
Jun 25, 2014, 11:32:50 PM6/25/14
to ope...@googlegroups.com
Sounds good to me.  My main items file is very large, almost 600 lines. My rules right now are really basic.  I'm making a big move in 2 weeks, new city, new house and a new automation system from the ground up.  So I'm not investing a lot of time in more rules until I have this new system in place.  But I would be happy to share what I have now. 

btw, I'm making the switch to z-wave in a big way, so I have a feeling I'll be hitting you up for advice ;-) 


On Wed, Jun 25, 2014 at 9:16 PM, Ben Jones <ben.j...@gmail.com> wrote:
I am not convinced uploading full configs to the WIKI is a great idea. Maybe snippets of useful/clever stuff in the samples section, but the demo config should be the first port of call for most users. I think here is fine, it is persistent and can be easily found by searching. Ideally these forums would allow stickies but that doesn't seem possible,

So does that mean you are going to share Dan?! ;)

--

Ben Jones

unread,
Jun 25, 2014, 11:35:28 PM6/25/14
to ope...@googlegroups.com
Nice - I have found ZWave to be very good. The binding is pretty stable these days. There are the odd little gotcha and if you can avoid battery powered devices your life will be a lot easier! In saying that I have 4-5 battery sensors and once they are setup correctly they are very good and reliable. Some of the Fibaro gear is really very good - the new motion sensor is a great bit of kit. And their in-wall relays/dimmers are as small as you will find anywhere.

Where are you based?

dan cunningham

unread,
Jun 25, 2014, 11:46:44 PM6/25/14
to ope...@googlegroups.com
I'm in the US, specifically Colorado, but in two weeks I'll be in southern California. 

I'm looking at doing 30+ GE/Jasco zwave Switches for lights,  3 Honeywell zwave thermostats for hvac  (I will need to do some work to the binding to support), and I think sonos for audio.    

and of course I will have some random z-wave devices for sensors, relays, etc... I see a lot of hacking in my future. 

  


On Wed, Jun 25, 2014 at 9:35 PM, Ben Jones <ben.j...@gmail.com> wrote:
Nice - I have found ZWave to be very good. The binding is pretty stable these days. There are the odd little gotcha and if you can avoid battery powered devices your life will be a lot easier! In saying that I have 4-5 battery sensors and once they are setup correctly they are very good and reliable. Some of the Fibaro gear is really very good - the new motion sensor is a great bit of kit. And their in-wall relays/dimmers are as small as you will find anywhere.

Where are you based?

--

Ben Jones

unread,
Jun 26, 2014, 12:01:54 AM6/26/14
to ope...@googlegroups.com
Yeah there are a few command classes missing - waiting for someone with the skills and the devices to implement and test. Sounds like you could be the man. I am very keen to get the security stuff working but can't get any ZWave enabled locks down here in NZ.

Sounds like you will have days of fun ahead of you!


Wyatt Zastrow

unread,
Jun 26, 2014, 4:15:44 PM6/26/14
to ope...@googlegroups.com
I'm lacking in the skills department, but I have a zwave thermostat that I'm willing to offer up for testing purposes.

Andrew Waite

unread,
Jul 7, 2014, 1:30:59 AM7/7/14
to ope...@googlegroups.com
Hey Ben,

Just starting with OpenHAB so will post my configs once I get some happening.

from the other side of the pond

Andrew

Ben Jones

unread,
Jul 7, 2014, 4:14:24 AM7/7/14
to ope...@googlegroups.com
Hey Andrew,

Good to hear of others 'down under' getting involved with openHAB! Let me know if you have any questions about your config, happy to help.

Also, I own an online store selling Z-Wave gear here in NZ (www.smartthingsnz.co.nz) so sing out if you need anything. Currently I don't ship to Australia but I am sure we can come to some arrangement ;).

Cheers,
Ben

7orh...@gmail.com

unread,
Jul 10, 2014, 10:47:06 AM7/10/14
to ope...@googlegroups.com
Hi all,
I'm interested in OpenHAB and i'm new to all this stuff. I setup openhab server on my RPi and tested demo files. Demo working fine. Now, i'm trying to write my own config file but i don't know how can i attach my Rpi's gpio ports with code. I downloaded all addons and installed. I need simple example like when i turned on DemoSwitch, a led will turn on connected to RPi's gpio 18 pin. Can somebody help me with that please?
Thanks. Orhun.

Ben Jones

unread,
Jul 10, 2014, 3:55:50 PM7/10/14
to ope...@googlegroups.com
Try the PiFace binding Orhun. You need to run a small python script on your RPi and then openHAB can monitor your pins and send commands. Instructions in the WIKI at https://github.com/openhab/openhab/wiki/Piface-Binding.

Ben Jones

unread,
Jul 10, 2014, 3:56:11 PM7/10/14
to ope...@googlegroups.com
And I am yet to actually see anyone share their config yet!


Matthew Herren

unread,
Jul 10, 2014, 5:39:16 PM7/10/14
to ope...@googlegroups.com
Hi,

I did it (using a 16 channel relay card connected to my GPIO ports) with the following configs (but note, rather than the GPIO binding, I used webiopi and the exec binding):

1. OpenHab config:
openhab.cfg
demo.items
demo.sitemap
demo.rules

Ben Jones

unread,
Jul 10, 2014, 5:50:27 PM7/10/14
to ope...@googlegroups.com
Nice one Matthew. Thanks.

Matthew Herren

unread,
Jul 11, 2014, 11:51:29 AM7/11/14
to ope...@googlegroups.com
Pleasure. Let me know if you run into any other issues that I may have some insight on... 

I'm done with my travels, and plan to finish up my setup this weekend (it's basically a mix of raspberry pi gpio stuff (relays, pir motion sensors, hdmi-Cec and lirc stuff), home matic  relays, door sensors and motion sensors (including lxccu on a pi), knx lights, and a multi-zone airplay music system. Once done, I'll document it and share configs on the wiki and here. I'm also messing with iBeacons for more precise indoor location tracking, but that's at the end of my list. 

I'm still a little unsure of my rules (I'm a UI/UX designer in 'real life' and tend to avoid actual code as much as possible for the betterment of everyone. If anyone with experience has comments on mine I would greatly appreciate it.

Lastly, I'm working on an interface for all this -- I'm currently thinking of using the rest api and building on top knockout.js.


Anyway, any rule/java experts feel like giving their thoughts on my limited attempt?? ;)

Best,
Matt


Sent from my iPhone

On 10 Jul 2014, at 23:50, Ben Jones <ben.j...@gmail.com> wrote:

Nice one Matthew. Thanks.

Ben Jones

unread,
Jul 11, 2014, 5:41:58 PM7/11/14
to ope...@googlegroups.com
Your rules look good - definitely something to build on. I have many rules which are very similar, with kill timers that get reset each time there is new presence detected. I find they work very well.

ari...@nesys.it

unread,
Jul 28, 2014, 6:56:46 PM7/28/14
to ope...@googlegroups.com
Hi Greg, All,

I'm trying to use the script below, but for the moment is not working and in the openhab.log I'm seeing just:

00:24:00.004 INFO  o.o.model.script.Wx Rules[:53]- Getting Wx Warnings

00:26:00.008 INFO  o.o.model.script.Wx Rules[:53]- Getting Wx Warnings


There is a way to debug the script to verify what is missing?

The script (with some personal modifications) is:

rule "Get Wx Warning"

when

System started or

Time cron "0 0/2 * * * ?" //update every 2 minutes

then

logInfo("Wx Rules","Getting Wx Warnings")

var String RawWrng = sendHttpGetRequest("http://www.meteoalarm.eu/documents/rss/it/IT003.rss"//this is just an example, you can get your own local rss feed from www.meteoalarm.eu

var Pattern pWrng = Pattern::compile("<td width="28"><\\/td><td>(.*?)<\\/td><\\/tr>"//common delimiter - subject to change (note, that is not backslash then a V, but two backslashes and a forward slash)

var Matcher mWrng = pWrng.matcher(RawWrng)

if (mWrng.find()){

var String wxWarning = mWrng.group(1)

logInfo("wx Rules","Found wx Regex Match")

if (wxWarning != wx_Warning.state.toString ) {

postUpdate(wx_Warning,wxWarning)

logInfo("wx Rules","Updating Wx Warning")

if(wxWarning != "No special awareness required"){

// logInfo("wx Rules","Sending wx warning email: " + wxWarning)

// sendXMPP("<your contact>","wx Warning: " + wxWarning)

// sendMail("<your email>","wx Warning",wxWarning)

pushNotification("Meteoalarm", "Meteoalarm:" + wxWarning)

            // add any other rules

}

}

}

end


of course I've an item String wx_Warning


Any suggestion will be appreciated


Thanks


Andrea

Richard Beales

unread,
Oct 31, 2014, 3:13:42 PM10/31/14
to ope...@googlegroups.com
I've put my config in a github repo if anyone's interested. Mainly zwave with aeon multisensors and a thermostat at present.
https://github.com/richbeales/openhab-cfg
Reply all
Reply to author
Forward
0 new messages