OpenHAB / HAI Omni

Ok so I think I got it working.  Its almost perfect except the layout kinda sucks but here is what I have for anyone in the future:
-------------
rules file:
-------------
 
rule "Family Room"
when
Item Scene_FamilyRoom received command 
then
var hsbOff = HSBType::fromRGB(0, 0, 0)
switch(receivedCommand){
        case 1 : FamilyRoom_Switch.sendCommand(ON)
        case 2 : FamilyRoom_Switch.sendCommand(OFF)
        case 3 : FamilyRoom_Switch_Scene_A.sendCommand(ON)
        case 4 : FamilyRoom_Switch_Scene_B.sendCommand(ON)
        case 5 : FamilyRoom_Switch_Scene_C.sendCommand(ON)
        case 6 : FamilyRoom_Switch_Scene_D.sendCommand(ON)
    }
end
 
------------
sitemap
--------------

Frame label="Family Room1"{ 
Switch item=Scene_FamilyRoom label="FAMILY ROOM" mappings=[1="ON", 2="OFF", 3="A",4="B",5="C",6="D"]
}
 
 
-----------
items
-----------

Switch  FamilyRoom_Switch "Family Room" (Buttons)  {channel="omnilink:room:8d1a3831:1:switch"}
Switch  FamilyRoom_Switch_Scene_A              "Scene A"          (FamilyRoom_Switch)    {channel="omnilink:room:8d1a3831:1:scene_a"}
Switch  FamilyRoom_Switch_Scene_B              "Scene B"          (FamilyRoom_Switch)    {channel="omnilink:room:8d1a3831:1:scene_b"}
Switch  FamilyRoom_Switch_Scene_C              "Scene C"          (FamilyRoom_Switch)    {channel="omnilink:room:8d1a3831:1:scene_c"}
Switch  FamilyRoom_Switch_Scene_D              "Scene D"          (FamilyRoom_Switch)    {channel="omnilink:room:8d1a3831:1:scene_d"}
 

 
 
I hope others are using openhab with the Omni so we can start sharing ideas!  I am just getting in to the switches (UPB) and got several buttons working which is great but there is a lot more I hope to integrate and would love to knowledge share with others!
 
Does anyone know how to use Rules or something to make the display based on a security zone.  In other words pseudo code:
 
If Left Garage is Not Ready 
   Show Close Left Garage
Else
   Show Open Left Garage
 
Thanks!

Neil
 
I just got OpenHAB 2.1 up and running with my OPII.  Not too bad, but it's a little cryptic to figure out how to add in the module and then connect to your panel.  A quick how-to would go a long way to get others into this.  With a proper Omni specific how-to, you could be up and running in 10 minutes.
 
After initial setup, I can easily control my lights & buttons through the web config interface, but what I really need is a good mobile interface.  It looks like that is still a pretty manual process of setting up your "Items" file and then the "Sitemaps" file.  Between buttons and units, I have over 100 items, so it's not a quick and easy thing to do.
 
OpenHAB really needs a quick way to do an initial "Items" and "Sitemap" setup and then allow you to modify it for groups/rooms, etc from there.  That's really the only painful part of setting this up.  Without the sitemap, the controls are boring and not grouped, but with a sitemap, the icons and groups will come into being a nicely organized (and very customizable) interface.
 
I've been running the old H@me app on my iPhones for years, but if I want to go to IOS 11+, I now need to give that app up.  Looks like OpenHAB is going to be my replacement.
 
For those on the fence, download the OpenHAB mobile app (IOS or Android) and just run them in demo mode to see what is there.  That's what got me looking at OpenHAB again.  Installation on one of my servers was very easy.  I really like how you just download the ZIP file and open to a directory of your choice.  There is no real installation - you just use the self-contained directory structure that comes out of the ZIP file and fire it up.  That makes it portable so that you can even move it between platforms on Windows, Linux or Mac with no installation (just move the folder structure).
 
edit:  I think it would be appropriate to note that as people discuss OpenHAB, they should probably reference whether they are on version 1.x or 2.x.  There seems to be many differences between the two and mostly from my learning is that much more can be done in 2.x without having to manually edit files to get there.  That's probably a big benefit for new people to get up and running quickly.
 
Just lost a long post I was typing up.  Summarizing is this:
 
OpenHAB isn't Haiku or even H@ME.
I have hours of configuration and only have three rooms and 20 buttons working.
Basic UI is very rudimentary and Paper UI doesn't work at all.  With multiple more hours Im sure it could be better.
 
I am running 2.x btw but everything I do is file based.
 
I will have to invest probably another 4 weeks at 40 hours a week minimum to get it to be fair at best unfortunately but I am hopeful since my alternatives are limited.
 
Im starting to wonder if UPB can be sustained.  If no one has noticed all of these LED lights with the built in drivers are a BIG problem for line noise.  There isn't much that can be done about it either and I think few people notice or even care unless you are like us using some power line protocol.
 
swamiller said:
Notice I have a group name for each room (Lights_Family) (Lights_Kitchen), etc.  Then there are "GROUP" names above each room's lights.  The top group is the (Lights) group and the second is the group that includes the rooms lights into the main (Lights) group.  The sitemap simply has 
 

All of the lights will group up (including the scene switches) under the lights tab by room.   As I mentioned before, I think there is a more elegant solution to the scene switches but I haven't set mine up. 
Can you show a pic of what your grouping looks like on your device (web or mobile)?  Also what the sitemap for these light groupings look like?  It's not just that single Group item="Lights" is it?
 
JonW
Here are screenshots of my mobile app.  The first two are the home screen, the third is a drill down of the grouped lights after clicking the "Lights" category, and the forth is the screen shot after clicking on the Family Room group under lights. 
 
https://www.dropbox.com/s/8g89y2945n4s2ao/OHMobileScreen1.png?dl=0
 
https://www.dropbox.com/s/hkm7vd395y0zp39/OHMobileScreen2.png?dl=0
 
https://www.dropbox.com/s/va19txt0tukd51h/OHMobileScreen3.png?dl=0
 
https://www.dropbox.com/s/4p7z41vpjop7ic5/OHMobileScreen4.png?dl=0
 
The organization (groups) and the icons for the lights are set up on the items file.  Icons can also be set at the sitemap level as well.  Here is my items file for my lighting.  The top level of the item file is the "group" roll up.  You'll see the group name listed by each item (by room name).  The top group nests the lower groups.
 
 

Group:Switch:OR(ON, OFF) Lights    "Lights [%s]" (All)
Group:Switch:OR(ON, OFF) Lights_FamilyRoom "Family Room [%s]"  (Lights)
Switch FamilyRoom_Switch      "Family Room [%s]"    (Lights_FamilyRoom) {channel="omnilink:room:home:1:switch"}
Switch  FamilyRoom_OnScene  "Scene On [%s]"    (Lights_FamilyRoom)  {channel="omnilink:room:home:1:eek:n"}
Switch  FamilyRoom_OffScene  "Scene Off [%s]"  (Lights_FamilyRoom)  {channel="omnilink:room:home:1:eek:ff"}       
Switch  FamilyRoom_Scene_A   "Scene A [%s]"    (Lights_FamilyRoom)  {channel="omnilink:room:home:1:scene_a"}
Switch  FamilyRoom_Scene_B   "Scene B [%s]"    (Lights_FamilyRoom)  {channel="omnilink:room:home:1:scene_b"}
Switch  FamilyRoom_Scene_C   "Scene c [%s]"    (Lights_FamilyRoom)  {channel="omnilink:room:home:1:scene_c"}
Switch  FamilyRoom_Scene_D   "Scene D [%s]"   (Lights_FamilyRoom)  {channel="omnilink:room:home:1:scene_d"}
Number FamilyRoom_State "Family Room Lights [%s]" (Lights_FamilyRoom)  {channel="omnilink:room:home:1:state"}
Dimmer Lights_FamilyRoom_Ceiling_Switch "Ceiling [%s]" (Lights_FamilyRoom) {channel="omnilink:upb:home:2:level"}
Dimmer Lights_FamilyRoom_FanLight_Switch "Fan Light [%s]" (Lights_FamilyRoom) {channel="omnilink:upb:home:3:level"}
Dimmer Lights_FamilyRoom_Lamp_Switch "Lamp [%s]"     (Lights_FamilyRoom) {channel="omnilink:upb:home:4:level"}
Dimmer Lights_FamilyRoom_CeilingFan_Switch  "Ceiling Fan [%s]" (Lights_FamilyRoom) {channel="omnilink:upb:home:5:level"}
Dimmer Lights_FamilyRoom_NookLight_Switch  "Nook Light [%s]" (Lights_FamilyRoom) {channel="omnilink:upb:home:6:level"}


Group:Switch:OR(ON, OFF)  Lights_Downstairs  "Downstairs [%s]"      (Lights)
Switch Downstairs_Switch     "Downstairs [%s]" (Lights_Downstairs) {channel="omnilink:room:home:9:switch"}
Switch  Downstairs_OnScene   "Scene On [%s]"    (Lights_Downstairs)  {channel="omnilink:room:home:9:eek:n"}
Switch  Downstairs_OffScene  "Scene Off [%s]"   (Lights_Downstairs)  {channel="omnilink:room:home:9:eek:ff"}       
Switch  Downstairs_Scene_A   "Scene A [%s]"     (Lights_Downstairs)  {channel="omnilink:room:home:9:scene_a"}
Switch  Downstairs_Scene_B   "Scene B [%s]"     (Lights_Downstairs)  {channel="omnilink:room:home:9:scene_b"}
Switch  Downstairs_Scene_C   "Scene c [%s]"     (Lights_Downstairs)  {channel="omnilink:room:home:9:scene_c"}
Switch  Downstairs_Scene_D   "Scene D [%s]"    (Lights_Downstairs)  {channel="omnilink:room:home:9:scene_d"}
Number Downstairs_State     "Downstairs Lights [%s]"  (Lights_Downstairs)  {channel="omnilink:room:home:9:state"}
Dimmer Lights_Downstairs_DwnStrHall_Switch "DwnStr Hall [%s]" (Lights_Downstairs) {channel="omnilink:upb:home:11:level"}
Dimmer Lights_Downstairs_Foyer_Switch  "Foyer [%s]"      (Lights_Downstairs) {channel="omnilink:upb:home:12:level"}
Dimmer Lights_Downstairs_FntRmOutlet_Switch "FntRm Outlet [%s]" (Lights_Downstairs) {channel="omnilink:upb:home:13:level"}
Dimmer Lights_Downstairs_Study_Switch "Study [%s]" (Lights_Downstairs) {channel="omnilink:upb:home:14:level"}


Group:Switch:OR(ON, OFF) Lights_Kitchen "Kitchen [%s]"  (Lights)
Switch Kitchen_Switch     "Kitchen [%s]" (Lights_Kitchen) {channel="omnilink:room:home:17:switch"}
Switch  Kitchen_OnScene   "Scene On"      (Lights_Kitchen)  {channel="omnilink:room:home:17:eek:n"}
Switch  Kitchen_OffScene    "Scene Off"    (Lights_Kitchen)  {channel="omnilink:room:home:17:eek:ff"}       
Switch  Kitchen_Scene_A      "Scene A"     (Lights_Kitchen)  {channel="omnilink:room:home:17:scene_a"}
Switch  Kitchen_Scene_B      "Scene B"     (Lights_Kitchen)  {channel="omnilink:room:home:17:scene_b"}
Switch  Kitchen_Scene_C       "Scene c"    (Lights_Kitchen)  {channel="omnilink:room:home:17:scene_c"}
Switch  Kitchen_Scene_D       "Scene D"    (Lights_Kitchen)  {channel="omnilink:room:home:17:scene_d"}
Number Kitchen_State         "Kitchen Lights [%s]"  (Lights_Kitchen)  {channel="omnilink:room:home:17:state"}
Dimmer Lights_Kitchen_Sink_Switch  "Sink [%s]" (Lights_Kitchen) {channel="omnilink:upb:home:18:level"}
Dimmer Lights_Kitchen_Overhead_Switch "Overhead [%s]" (Lights_Kitchen) {channel="omnilink:upb:home:19:level"}
Dimmer Lights_Kitchen_Chandalier_Switch "Chandalier [%s]" (Lights_Kitchen) {channel="omnilink:upb:home:20:level"}
Dimmer Lights_Kitchen_Cabinet1_Switch  "Cabinet 1 [%s]" (Lights_Kitchen) {channel="omnilink:upb:home:21:level"}
Dimmer Lights_Kitchen_Ceiling1_Switch  "Ceiling 1 [%s]" (Lights_Kitchen) {channel="omnilink:upb:home:22:level"}
Dimmer Lights_Kitchen_Cabinet2_Switch  "Cabinet 2 [%s]" (Lights_Kitchen) {channel="omnilink:upb:home:23:level"}
Dimmer Lights_Kitchen_Ceiling2_Switch  "Ceiling 2 [%s]" (Lights_Kitchen) {channel="omnilink:upb:home:24:level"}


Group:Switch:OR(ON, OFF) Lights_Outside  "Outside [%s]" (Lights)
Switch Outside_Switch    "Outside [%s]"   (Lights_Outside) {channel="omnilink:room:home:25:switch"}
Switch  Outside_OnScene   "Scene On"       (Lights_Outside)     {channel="omnilink:room:home:25:eek:n"}
Switch  Outside_OffScene    "Scene Off"     (Lights_Outside)     {channel="omnilink:room:home:25:eek:ff"}       
Switch  Outside_Scene_A     "Scene A"       (Lights_Outside)     {channel="omnilink:room:home:25:scene_a"}
Switch  Outside_Scene_B     "Scene B"       (Lights_Outside)     {channel="omnilink:room:home:25:scene_b"}
Switch  Outside_Scene_C     "Scene c"       (Lights_Outside)     {channel="omnilink:room:home:25:scene_c"}
Switch  Outside_Scene_D     "Scene D"       (Lights_Outside)     {channel="omnilink:room:home:25:scene_d"}
Number Outside_State       "Outside Lights [%s]"  (Lights_Outside)     {channel="omnilink:room:home:25:state"}
Switch Lights_Outside_BackFlood_Switch  "Back Flood [%s]"   (Lights_Outside) {channel="omnilink:upb:home:27:level"}
Switch Lights_Outside_FtPchLght_Switch "Ft Pch Lght [%s]"  (Lights_Outside) {channel="omnilink:upb:home:28:level"}
Switch Lights_Outside_GarageExt_Switch "Garage Ext [%s]"   (Lights_Outside) {channel="omnilink:upb:home:29:level"}
Switch Lights_Outside_BackPatio_Switch "Back Patio [%s]"   (Lights_Outside) {channel="omnilink:upb:home:30:level"}
Switch Lights_Outside_PoolLight_Switch "Pool Light [%s]"   (Lights_Outside) {channel="omnilink:upb:home:31:level"}
Switch Lights_Outside_GarageInt_Switch "Garage Int [%s]"   (Lights_Outside) {channel="omnilink:upb:home:32:level"}


Group:Switch:OR(ON, OFF) Lights_UpstairsHall   "Upstairs Hall [%s]"  (Lights)
Switch Lights_UpstairsHall_Switch "Upstairs Hall [%s]" (Lights_UpstairsHall)  {channel="omnilink:room:home:33:switch"}
Switch  Lights_UpstairsHall_OnScene   "Scene On"    (Lights_UpstairsHall)  {channel="omnilink:room:home:33:eek:n"}
Switch  Lights_UpstairsHall_OffScene "Scene Off"   (Lights_UpstairsHall)  {channel="omnilink:room:home:33:eek:ff"}       
Switch  Lights_UpstairsHall_Scene_A   "Scene A"     (Lights_UpstairsHall)  {channel="omnilink:room:home:33:scene_a"}
Switch  Lights_UpstairsHall_Scene_B   "Scene B"     (Lights_UpstairsHall)  {channel="omnilink:room:home:33:scene_b"}
Switch  Lights_UpstairsHall_Scene_C   "Scene c"     (Lights_UpstairsHall)  {channel="omnilink:room:home:33:scene_c"}
Switch  Lights_UpstairsHall_Scene_D   "Scene D"     (Lights_UpstairsHall)  {channel="omnilink:room:home:33:scene_d"}
Number Lights_UpstairsHall_State     "Upstairs Hall Lights [%s]" (Lights_UpstairsHall)  {channel="omnilink:room:home:33:state"}
Dimmer Lights_UpstairsHall_StairCan_Switch  "Stair Can [%s]" (Lights_UpstairsHall)  {channel="omnilink:upb:home:35:level"}
Dimmer Lights_UpstairsHall_UpHallCans_Switch "Up Hall Cans [%s]" (Lights_UpstairsHall)  {channel="omnilink:upb:home:36:level"}
Dimmer Lights_UpstairsHall_UpendHall_Switch  "Up end Hall [%s]" (Lights_UpstairsHall)  {channel="omnilink:upb:home:37:level"}


Group:Switch:OR(ON, OFF) Lights_MasterBed  "Master Bedroom [%s]"  (Lights)
Switch Lights_MasterBed_Switch      "Master Bedroom [%s]" (Lights_MasterBed)    {channel="omnilink:room:home:41:switch"}
Switch  Lights_MasterBed_OnScene    "Scene On [%s]"       (Lights_MasterBed)    {channel="omnilink:room:home:41:eek:n"}
Switch  Lights_MasterBed_OffScene   "Scene Off [%s]"     (Lights_MasterBed)    {channel="omnilink:room:home:41:eek:ff"}       
Switch  Lights_MasterBed_Scene_A     "Scene A [%s]"        (Lights_MasterBed)    {channel="omnilink:room:home:41:scene_a"}
Switch  Lights_MasterBed_Scene_B     "Scene B [%s]"        (Lights_MasterBed)    {channel="omnilink:room:home:41:scene_b"}
Switch  Lights_MasterBed_Scene_C     "Scene c [%s]"        (Lights_MasterBed)    {channel="omnilink:room:home:41:scene_c"}
Switch  Lights_MasterBed_Scene_D     "Scene D [%s]"        (Lights_MasterBed)    {channel="omnilink:room:home:41:scene_d"}
Number Lights_MasterBed_State       "Master Bedroom Lights [%s]" (Lights_MasterBed)    {channel="omnilink:room:home:41:state"}
Dimmer Lights_MasterBed_Overhead_Switch  "Overhead [%s]"  (Lights_MasterBed)    {channel="omnilink:upb:home:43:level"}


Group:Switch:OR(ON, OFF) Lights_Landscape "Landscape [%s]" <outdoorlight>   (Lights)
Switch Landscape_Switch       "Landscape [%s]"        (Lights_Landscape)  {channel="omnilink:room:home:49:switch"}
Number Landscape_State        "Landscape Lights [%s]" (Lights_Landscape)  {channel="omnilink:room:home:49:state"}
Switch Lights_Landscape_HouseFront_Switch "House Front [%s]"    (Lights_Landscape)  {channel="omnilink:upb:home:51:level"}
 
Keep in mind the scene switches are not the way I want them.  The example on the second screen shot will be what those will look like in the near future. 
 
With the above item file I have the following sitemap.  Again, the lights are just a group name, nothing complicated. 
 
 

sitemap standard label="Miller Home (OH2)"{
Frame label="Security"{
//Switch item=Areas_House_Mode label="Select Mode" icon="shield" mappings=["Off"="Off","Day"="Day","Night"="Night", "Away"="Away","Vacation"="Vacation"]
        
Selection item=AlarmStatusSelect label="Select Mode" icon="shield" mappings=[0="Off",1="Day",2="Night", 3="Away",4="Vacation"]
        //Text item=ArmModeDisarm
        
        Text item=AlarmMode  label="Current Alarm Status"  icon="house"


Switch item=Buttons_Garage2Btn        label="Right Garage Door" icon="garagedoor" mappings=[ON="Push"]
Text item=Zones_GarageDrRight_Current label="Right Garage Door" icon="garagedoor"


Switch item=Buttons_Garage1Btn        label="Left Garage Door"  icon="garagedoor" mappings=[ON="Push"]
Text item=Zones_GarageDrLeft_Current  label="Left Garage Door"  icon="garagedoor"


Switch item=Buttons_ClsGateBtn        label="Gate"              icon="gate"       mappings=[ON="Push"]
Text item=Zones_Gate_Current          label="Gate"              icon="gate"


Group item=Zones   label="Unsecure Zones"  icon="house"
Group item=Areas   label="General Areas"   icon="house"


Switch item=FtDrLckStsFl_Flag mappings=[ON="Locked", OFF="Unlocked"]
Switch item=BcDrLckStsFl_Flag mappings=[ON="Locked", OFF="Unlocked"]
Switch item=GrDrLckStsFl_Flag mappings=[ON="Locked", OFF="Unlocked"]


}
Frame label="Occupancy"{
Group item=Occupancy
}
Frame label="Lights"{
Group item=Lights
Switch item=FamilyRoom_State label="FAMILY ROOM" mappings=[0="OFF", 1="ON", 2="A",3="B",4="C",5="D"]
Selection item=FamilyRoom_State label="FAMILY ROOM" mappings=[0="OFF", 1="ON", 2="A",3="B",4="C",5="D"]
}
Frame label="Outside"{
Switch item=PlPumpUnit_Switch label="Pool Pump"  icon="switch" mappings=[ON="On", OFF="Off"]
Switch item=PlSweepUnit_Switch  label="Pool Sweep" icon="switch" mappings=[ON="On", OFF="Off"]
Switch item=Lights_Outside_PoolLight_Switch label="Pool Light" icon="light" mappings=[ON="On", OFF="Off"]
Group item=Irrigation icon="grass" 
}
 
This binding is extremely new so I have been working to figure out some of the things myself (like the scene switches). 
 
My stuff doesn't render like that at all.  As a matter of fact all my lights i got working on the basic ui don't work on the iphone.  I hope this gets easier.  Just figuring out the syntax is crazy!  I guess its power makes it difficult because of all the options.  I like your layout and might just steal it although I want to make it easier I think... Maybe I will find a developer on elance who has Openhab experience :)
 
swamiller said:
The organization (groups) and the icons for the lights are set up on the items file.  Icons can also be set at the sitemap level as well.  Here is my items file for my lighting.  The top level of the item file is the "group" roll up.  You'll see the group name listed by each item (by room name).  The top group nests the lower groups.
 
Thank you - that helped with what I was trying to accomplish, but it had some side effects that were unwanted.  When just declaring the group directive in the sitemap file, the order of the switches and scene entries were randomly displayed.  They were not in the order that I listed them in the items file.  I've decided on a hybrid approach where I'm doing the room groupings to get the "OR" status, but I'm still individually listing the items in the sitemap file.  Seems like this gives a bit more control.
 
Here's the random layout:
IMG_1559.PNG
 
And here's what it should be (rotated landscape to show full item text).
IMG_1560.PNG
 
heffneil said:
My stuff doesn't render like that at all.  As a matter of fact all my lights i got working on the basic ui don't work on the iphone.  I hope this gets easier.  Just figuring out the syntax is crazy!  I guess its power makes it difficult because of all the options.  I like your layout and might just steal it although I want to make it easier I think... Maybe I will find a developer on elance who has Openhab experience :)
If yours isn't rendering properly, chances are either your items or sitemap file has errors and isn't being used.  It took me a while to figure this out.
 
My suggestion is to shutdown OpenHAB (logout), then delete or rename /userdata/logs/openhab.log, then do a restart on OpenHAB.  After it is running, go look in the openhab.log file and see what error entries are there.  You likely have something giving an error and it's then just ignoring your files.
 
Also, do you have your default sitemap entered under Paper-UI > Configuration > Services > Basic UI > Configure > Default Site Map ?
 
Ok I am going to try this.  I wish there were more styling options or maybe there is and I haven't gotten that far yet :)
 
JonW said:
If yours isn't rendering properly, chances are either your items or sitemap file has errors and isn't being used.  It took me a while to figure this out.
 
My suggestion is to shutdown OpenHAB (logout), then delete or rename /userdata/logs/openhab.log, then do a restart on OpenHAB.  After it is running, go look in the openhab.log file and see what error entries are there.  You likely have something giving an error and it's then just ignoring your files.
 
Also, do you have your default sitemap entered under Paper-UI > Configuration > Services > Basic UI > Configure > Default Site Map ?
Lots of errors! Thanks for the tip! I have to go through it.  I haven't had a lot of desk time to sit and focus on it recently!
 
Back
Top