Iāve just discovered OpenHAB, and have installed v2 on my Synology NAS, and it works fine.
Iāve discovered the hardware (wemo link & bulbs) on my network using PaperUI, and theyāre presented to me in Basic & Classic UI.
However, Iād like something more fancy, similar to the demo sitemap. I can load the demo sitemap but it doesnāt have my things there. What do I do now? I have no idea.
Am I just meant to edit the conf/demo.[type] files, to have my things, items, etc within them, or can I create a sitemap with a new name (but then how does that know which things, items, etc, file(s) that needs to work with)?
For the first steps I recommend to work in the demo files. Later on you can split the files (e.g. I have files for spcific topics/technologies like sonos, weather, ā¦).
Thanks, but I asked a question, that presumably thereās an answer forā¦?
Iād like to understand whatās what, and as the config is the central user part, surely someone is able to tell me how the naming/loading of the config files works so that they properly interact with each other?
Itās not a simple question. OH2 is different to OH1 so what I say doesnāt necessarily apply, nor should you take it as gospel.
You should use/tinker with the demo files to figure out how the conf folder contents interact.
Inside the items files you create the items that can appear on your sitemap. Look at the wiki under each different binding to determine what items you can create to work with the respective binding. The items files can be amalgamated into one file if you like, but having them separate is significantly easier to manage. eg. heating.items, sensor.items, and so on. This is where the majority of the work goes at the beginning.
Bindings are installed through PaperUI (mostly) and allow the items files youāve made to talk to the physical items (wemo, hue, daikin etc etc).
Rules, scripts, persistence, sevices are as per the wiki. Read about them, there. This is the majority of the work once you have your items set up and you want to start automating your physical connected gadgets.
Things are supplementary to the items files and seem to primarily exist to (sometimes) integrate with the PaperUI configured items. Not all items will need a thing though. Iām still learning the specifics of OH1/2 so donāt ask me more here or iāll have to go learn it firstā¦
For most people OH is not a pick-up-and-get-it-figured-out-in-an-evening kind of project. If you hunt around the forums youāll find some other configurations files which are far more advanced than the demo, but helped me determine some less well documented features. I started with OH with next to no experience with Linux OSās (I now have OH setup on a Pi3 with Raspbian) And very little experience with any meaningful code aside from basics of arduino. Iām now 9 months in, and more proficient with those aspects than I ever thought I would be.
I fully agree; as sad as it is; it is a drag for any newcomer to make sense of the inner workings. I call it a monster, because it does not rally follow the usual procedural or object-oriented programming approach. It took me many days to get my head around it ā just to get startedā¦
But then, like the Doctors say: everybody is different; you may pick it up in dayā¦ however, no matter who you are I donāt think so.
What I also need to say: Once youāve got it all working, it is very powerful, and does things, no other system is capable of. ā Why I am still tinkering with itā¦ to the point that I either use OH, or no home automation at all.
Best thing to start, as mentioned by Joerg and Paul, is tio use the demo files and add the items of your choice. To see the items within the sitemap you have also to specify them within the sitemap.
If you are on the advanced way, you can split things to more files to have your project more structured (files with many hundred lines of code arenāt clearly).
These files can be named as you like it. And there is no link between any file by ist name. Items in a file āzwave.itemsā can be used in a file ārollershutter.rulesā.
Openhab reads all files at Startup. That means, after startup all items defined in all your items files are loaded an processed. The same for the rules files: all rules files are loaded and processed.
A Problem, which occured under OH1 (I am not using OH2) is, that you cannot guarantee the order of loading the files. In some cases a rule is processed, but not all items needed by your rule are yet loaded.
Give it a try. Play with some items / bindings and get more used to OH.
Hey Neil,
as I understood it you already have OH2 up and running and you got all your things and items defined by adding them in PaperUI. Good so far
I would recommend to start off with an empty configuration folder (addons.cfg: package = standard). You should still hold on to the demo files and possibly have a lookout for other configuration examples. Here you can find my configuration.
Start out with a small sitemap called default.sitemap. Follow the instructions in the wiki on how to build a sitemap.
You should quickly see some nice results in BasicUI/ClassicUI or in your smartphone app.
If you are not sure about names and datatypes of your items, the karaf console is your friend. Use the commands smarthome:things and smarthome:items to get more information about all registered things and items.
Additionally itās a good idea to look into the events.log file to get a better understanding of which data is stored in which item at certain events. On Linux do the following (path may differ): tail -n 100 -f /opt/openhab2/userdata/logs/events.log
After you got the basics of your sitemap content covered, you might want to think about ātransformationsā, āpersistenceā, helper items (to display summarized information or similar) or rulesā¦ Check out the very good wiki and docs articles on these topics (most information in the openHAB1 wiki is still valid for openHAB2). My recommendation is to have one sitemap but many small configuration files for rules and such. Have a look at my config for examples in the items or rules folders.
You might also want to work with more bindings. Be sure to read up on them in the documentation (either in the new docs.openhab.org or if needed in the old wiki) - in the beginning restrict yourself to OH2 bindings with an existing docs article if possible.
If you run into problems with things and items added via PaperUI, you may want to define all of them in config files. I found peace in that as it bears a few positive side effects. You will however need some time to do so (example).
I finally feel like Iām making progress, and now have a nice sitemap with all of my items in the right place, and working as Iād expect them to be.
And thanks for the links. Rules is where Iām going next.