|
Post by papa on May 23, 2021 20:21:51 GMT
Migrating to OpenHAB 3, Initial ThoughtsAs of this post's date, I have a working DIY Home Automation based on openHAB 2.5.10 & I've been busy with other things. After a member inquiry, I'm taking a look at what it might take to migrate to openHAB 3. For example, I examined & considered the official list of possible migration issues. Considering this forum's project, I list what might affect us & the difficulty I foresee. 1) "The runtime now requires Java 11 instead of Java 8." Java installs can be a pain, but seem more reliable via the recommended Zulu version. 2) "The compatibility layer is gone, so 1.x add-ons will no longer work." I don't believe our project has much left from the 1.x level that we cannot get from a higher version.
3) "Rules: The next-gen rule engine (NGRE) of openHAB 2.5 has now become the official rule engine within openHAB. However, rule DSL files are almost not impacted. Nonetheless, there is the need to revisit existing rules, since there are some breaking changes in the DSL syntax." This will take some time combing through rules syntax with help of debugging output on the console. 4) "The 'Embedded broker' (Moquette) add-on has been removed. Moquette is an abandoned project with major bugs that won't be fixed anymore. Please use a separate MQTT broker like Mosquitto instead." Major bugs, eh? Before openHAB 2.5.x is restarted, one does need to delete the mqtt persistence file. Otherwise the embedded MQTT broker works well for me. For a Windows user like me, it's been hit & miss to find a Mosquitto version that works. I have MANY MQTT Things for which to switch MQTT brokers.
papa added, Aug. 12, 2021: 5) OH 2.5.x storage of HABPanel configs is not compatible with OH 3. See below starting here. For our DIY Home Automation, items 3, 4, & 5 may take the most time of a migration from OH 2.5.x to OH 3.
|
|
|
Post by papa on May 24, 2021 19:00:38 GMT
Migrating to OpenHAB 3, More Initial Thoughts
Early on you must (??) choose between text file configuration OR the easier [??] to use User Interface (UI) method for setting up & configuration needs.
Update, July 22, 2021: So far I've been successful with a mixture of text file & UI configuration. With text files: items. With UI: Bindings, Things, links between Things & items. Later I'll see if my .rules files can be adapted to work.
In previous openHAB versions, text file configuration has been the only really practical way to define most objects (except things). This is true. I have several files of textual configurations for items & rules.
The UI method can be slower to reach one's goal if you already know what you're doing & if there's a lot of bulk changes or duplicating required. With the UI method it's harder to remove obsolete stuff. Until I see differently, I believe I'll need tediously to re-define many Things via the UI. For now, I assume that will be similar to using the PaperUI for Things (tedious, but reliable). As I wrote just above, I also have several textual configurations that would need a completely different UI approach.
Mixing the textual config & the UI config is possible. For example, use the UI for things & text files for items. However, doing this is not recommended as it increases complexity. The OH tutorial starts by saying we MUST choose between text config & UI config & then admits mixing the two is possible but not recommended. This mixing seems much as I did with OH 2.5.x: Using the UI for Addons & Things, but using text files for Items & Rules. I needed to be consistent & remember that where I configured something was also where I needed to make any changes, but it worked.
Remember this thread is about MIGRATING from OH 2.5.x to OH 3. Someone new to OH or with little invested in text configs may well be better starting OH with the UI configuration. After actually trying OH 3, I may change to total UI configuration.
What are your thoughts & experiences?
|
|
|
Post by papa on May 24, 2021 19:03:40 GMT
Your Input, Please, About OpenHAB 3What is your experience with openHAB 3? Did you migrate from openHAB 2.5.x? What do you miss from openHAB 2.5.x that so far is not available in OH 3? What is your experience if you started openHAB with version 3 & did not migrate from a previous version? What went well? What openHAB 3 features are worth the change? What are the obstacles & issues?
To what extent do you use the User Interface config of OH 3? To what extent do you use the textual file config of OH 3?
|
|
|
Post by papa on Jul 22, 2021 15:55:24 GMT
Migrating to OpenHAB 3 from OH 2.5.x A Not So Perfect Storm
As indicated above, I had a working OH 2.5.10 DIY Home Automation running on a somewhat refurbished Windows 10 laptop. Also as described above, in May, 2021, on another Windows 10 laptop, I experimented some with installing OH 3 & used the restore.bat scrip to install a backup.zip from OH 2.5.10. I mostly did UI configuring of OH 3. Then I got busy with other things.
In mid July, 2021, after a storm-related power blip, my Windows 10 laptop hosting OH 2.5.10 totally stopped working. On the second Windows 10 laptop, I experimented more with the OH 3 install (restore.bat from OH 2.5.10 backup.zip) & with OH 2.5.12 (only OH 2 version available?, restore.bat from OH 2.5.10 backup.zip). This did not seem to work well.
As long as I was starting over, I decided to install OH 3.1.x, its latest stable version. I did not want to run my main OH system on the second Windows laptop AND I did not have another Windows 10 laptop for this. So I decided to install on a Lubuntu Linux laptop.
OH's embedded MQTT broker (which has many references in my .items files) is no longer recommended so I was also switching to a major upgrade of the Mosquitto MQTT broker.
So I was migrating from Windows 10 OH 2.5.10 (embedded MQTT broker) to Linux OH 3.1.x & Mosquitto 2. It turns out the Linux restore script could not use the Windows 10 generated backup.zip of configurations (backslash vs forward slash used in file paths). Besides some of the OH 2.5.10 backups seemed to cause problems. So on the second Windows 10 laptop, I extracted the [backup.zip] & used a thumb drive to transport SOME individual configuration files (especially .items files) to the Linux install of OH 3.
Update, July 23, 2021: In other words, I was doing a fresh install of openHAB 3, but then I also used some configurations from a previous openHAB version. Some lesson learned: Regularly use openHAB's backup script to save dated stages of one's openHAB configurations. In a nearby text file, summarize what new configurations that each [backup.zip] contains. Also copy backups & summaries to other storage in case the openHAB device crashes. More on these backups later.
Ahead: Progress on a working OH 3 DIY Home Automation system that uses what I could get from my OH 2.5.10 backup.zip.
Next: Installing & Configuring Mosquitto 2 MQTT Broker
|
|
|
Post by papa on Jul 22, 2021 21:29:26 GMT
Installing Mosquitto 2 MQTT BrokerTo communicate with our RFM69 Gateway & our ESP8266 WiFi nodes, we need a MQTT broker. Before, I used the embedded MQTT broker that came with openHAB. However, that is no longer recommended & I believe will be discontinued. So I went back to using the Mosquitto MQTT broker. In the following posts, Linux Terminal app commands are shown in purple text. The installation guide at this site worked fine: sudo apt-add-repository ppa:mosquitto-dev/mosquitto-ppa sudo apt-get update sudo apt-get install mosquitto sudo apt-get install mosquitto-clients sudo apt clean
Mosquitto is installed as a service and should start automatically after install. Each time it starts, it loads its configs which includes the contents of mosquitto.conf For Linux, mosquitto.conf is found in this folder: /etc/mosquitto/ Configuring Mosquitto 2 MQTT Broker
|
|
|
Post by papa on Jul 22, 2021 21:40:19 GMT
Configuring Mosquitto 2 MQTT Broker
Mosquitto (now version 2) has undergone an upgrade that needs some configuration changes for our DIY Home Automation approach.
Use the following to stop Mosquitto: sudo service mosquitto stop
Then at the bottom of /etc/mosquitto/mosquitto.conf, add the following lines:
# http://www.steves-internet-guide.com/install-mosquitto-linux/
# Mosquitto v2 introduced important changes that affect first time users
# By default it requires authentication & doesn’t listen on a network address.
# The following will allow RFM69 gateways & WiFi nodes to connect to Mosquitto without user name & password
listener 1883 allow_anonymous true Re-start Mosquitto & load the updated mosquitto.conf with: sudo service mosquitto start
More later on using the Mosquitto MQTT service.
Installing Linux OpenHAB 3.x
|
|
|
Post by papa on Jul 23, 2021 14:53:10 GMT
Installing Linux OpenHAB 3.x, Preliminaries
Using the Linux Terminal app, check your version of Linux (makes a difference with some commands): cat /etc/os-release My results:
Next: Installing Linux OpenHAB 3.x, Prerequisite
|
|
|
Post by papa on Jul 23, 2021 15:00:32 GMT
Installing Linux OpenHAB 3.x Prerequisite: Java 11
Check your version of Java (if any): java -version My results:
In Linux Terminal app, I did: sudo apt install default-jre My next check of Java version & results:
Next: Installing Linux OpenHAB
|
|
|
Post by papa on Jul 23, 2021 15:45:02 GMT
Installing Linux OpenHAB Following this official documentation, I used the recommended Package Repository Installation via Apt Based Systems:wget -qO - 'https://openhab.jfrog.io/artifactory/api/gpg/key/public' | sudo apt-key add - sudo apt-get install apt-transport-https Next, I installed the Stable Release of openHAB 3: echo 'deb openhab.jfrog.io/artifactory/openhab-linuxpkg stable main' | sudo tee /etc/apt/sources.list.d/openhab.listsudo apt-get update
sudo apt-get install openhab Resulting notes on Terminal Window: BTW, to check openhab status, use sudo systemctl status openhab.service Next: Starting OpenHAB
|
|
|
Post by papa on Jul 23, 2021 16:03:26 GMT
Starting OpenHAB
When further along in setting up openHAB, I will configure it to start when Linux boots.
However, during early setting up of openHAB, I start it manually in the Linux Terminal, like this ... sudo /bin/systemctl start openhab.service
So for the time being, every time Linux reboots, I'll need to start openHAB manually in the same way
The first start may take up to 15 minutes so take a break & come back. Later starts take less time, but are still not immediate.
Starting OpenHAB 3's Configuration
|
|
|
Post by papa on Jul 23, 2021 18:28:03 GMT
Starting OpenHAB 3's Configuration IP Address Preliminaries
For here & elsewhere, make note of the IP address of your openHAB-hosting computer & network gateway/router: nmcli -p device show
Near the bottom of the Linux Terminal app's output, see something like my results ... IP4.ADDRESS[1]: 192.168.10.101/24 IP4.GATEWAY: 192.168.10.1
(Enter [ctrl] c to exit the output & return to Terminal command prompt.)
That would mean MY openHAB-hosting computer is at 192.168.10.101 & MY network gateway/router is at 192.168.10.1 Note your specific IP addresses.
Your router assigns an IP address to your openHAB computer, an address that can change & mess up openHAB/Mosquitto communication so ...
Recommended: Give your openHAB/Mosquitto hosting computer a static (permanent) address.
Find your Network Router's brand name & model number. On the internet, learn the default log in (user name & password) for your network router. If you changed the router's login, use that.
Update, July 30, 2021: I previously programmed RFM69 Gateways & ESP32 WiFi nodes to look for Mosquitto MQTT communication service on a computer with a specific IP address. To avoid reprogramming those devices, I gave my openHAB/Mosquitto computer that same specific address as a static IP. You also may need to do this.
In a browser, enter your Gateway/router's IP address that you learned just above. Login to the router. In the DHCP section, find your openHAB computer in the client list & act to give it a static address.
Next: Starting OpenHAB 3's Configuration
|
|
|
Post by papa on Jul 23, 2021 18:31:11 GMT
Starting OpenHAB 3's Configuration Logging into the OpenHAB Dashboard
After waiting a bit for openHAB to start, log into the openHAB Dashboard.
The official openHAB docs say, "reach the openHAB Dashboard at http://openhab-device:8080."
In my case, the docs mean (in a browser), enter 192.168.10.101:8080 OR enter localhost:8080
In your case, use YOUR computer's IP address (see the post just above) instead of 192.168.10.101 plus :8080
During you first time in the Dashboard, create a user name & password for log in. Keep careful track of that so in the future you can log in to view & edit your openHAB 3 configuration.
OH3 Settings: Regional & Bindings
|
|
|
Post by papa on Jul 24, 2021 16:06:33 GMT
Starting OpenHAB 3's Configuration Settings: Regional & Bindings
As I recall on the first time when we log in to the Dashboard, we're offered a button to edit some settings or skip & do those later.
Early on I went to Settings/Regional Settings & clicked Show Advanced. Check & compete these (Language, Country, Time Zone, Latitude/Longitude, Metric or Imperial measurements)
Also early on I went to Settings/Add-ons/Bindings. There I installed bindings that I had been using: Mail, MQTT, Network, & NTP.
To install bindings: in the lower right, click the blue disc icon with a plus (+) sign. In the search box near the top, start typing the name of a desired binding. Then click on it when it appears.
Next: OpenHAB 3 Configuration: Inbox Things
|
|
|
Post by papa on Jul 24, 2021 18:38:31 GMT
OpenHAB 3 Configuration: Inbox Things
Via localhost:8080 in a browser (& any necessary login), go to Settings/Things.
When we install some bindings (like Network & NTP), openHAB automatically puts related Things into the Inbox.
Click the Inbox button at the bottom of the Settings/Things window.
At the Inbox, you can accept desired Things. Or you can ignore Inbox Things you do not want, at least yet.
If you install the NTP binding, the Inbox will list the Local Time Thing. If desired, you can accept Local Time & it will move to Settings/Things. If you install the Network binding, Inbox will list these two Things: Network Device with Running Service & Pingable Network Device. If you accept one or both, they will move to Settings/Things. To the right of each Thing in the Settings/Things list will be a status button. If the button says "Online" the Thing should be good to go. That may happen with some Things (perhaps from previously entered settings), but often we need to do some more configuring.
OH 3 Configuring of Things
|
|
|
Post by papa on Jul 24, 2021 19:39:54 GMT
OH 3 Configuring of Things NTP / Local Time Example
In the OH 3 Dashboard's Settings/Things window, look at your list of Things accepted so far.
For example, if we install the NTP binding, one Thing might say Local Time ntp:ntp:local
Near the Local Time Thing, hover your mouse pointer over the small icon of two stacked pages & you'll see "copy UID." If you click that icon, you'll see "Copied to clipboard" Now you can paste "ntp:ntp:local," the UID for the Local Time Thing. More on this later.
Click on the Local Time Thing to see its configuration. It should already have configurations based on previous settings entered & defaults.
Near the top of each Thing (like Local Time) see a field called Location. You can leave this blank. Or you can use this to group Things together. In some cases, Location could be an area on a property (like Main_Floor, Garden, etc). You could group communication Things (router, gateways, etc.) together by putting "Network" in the Location field. More on Location later.
For now, in the Location field of the Local Time Thing, I'll put "Time" (can be changed later)
At the upper right, click Save to record the change & be returned to the Settings/Things list.
If Local Time's colored button says "Online" that Thing should be good to go. More later on using that Thing. If the button does not say "Online" you need to fill the fields correctly to get there (& Save). Or perhaps, stop & re-start openHAB to bring online a Thing whose fields seem correct.
Next: Text Configuring an Item for Linking to the Channel of an NTP Thing
|
|
|
Post by papa on Jul 25, 2021 20:28:23 GMT
Text Configuring an Item for Linking to a Channel of an NTP Thing
If you want to use the Dashboard method of creating an Item, just read this post & follow instructions in the next post.
For an efficient, but cryptic method, do the following for Text Configuration (my main method).
For this method, Items are configured in text files that end with .items. All items can be put in one .items file, but that is soon hard to track. Better to create multiple .items files whose names reflect their contents. To hold the NTP related item, I'll use a file named Time.items
In openHAB's /items folder (Linux: /etc/openhab/items), create a new file named Time.items
As a superuser, access Linux's /etc/openhab/items folder (protected against changes):
That is ... in the Linux Terminal app execute the command sudo leafpad (plus your login password)
In Leafpad's File menu choose New, then File/Save As... Give it the Name Time.items
Navigate to the File System folder /etc/openhab/items Save
In Time.items, add a new configuration line that reads:
In text configuration, an Item has this format: Type Name Display Label [optional data formatting] <optional icon for display> {Thing & channel linkage}
The current Item is a DateTime type & has the Name "Date" It has a display Label of Date & Time [formatted as month.day.year hour:minute:sec AM/PM]. It has a display icon named calendar. It links to the dateTime channel of the NTP Thing Local Time that has the ID of ntp:ntp:local
The Dashboard will not let us use it to edit Items configured with a text file. Items configured in a text file may only be edited in a text editor (allowing for Linux' protection of special folders & files).
As shown below, many Dashboard clicks are required to create & link a comparable item.
Next: Dashboard Configuring an Item for Linking to a Channel of an NTP Thing
|
|
|
Post by papa on Jul 26, 2021 19:04:05 GMT
Dashboard Configuring an Item for Linking to the Channel of an NTP Thing
As said before, I will use the Dashboard to create Things & their channels. As seen in the last post's example, I hope to use my existing .items files for Item configuration.
I might use the Dashboard to create new items or to get necessary information to create an Item configured in a text file.
Before I unlinked & deleted & used the text configuration, I used the Dashboard to create the same Item (named Date) as in the last post. (See below.) If you generally want to use Dashboard configuration, perhaps the following will be helpful. Use ONLY ONE method to create the Item named Date: text file or Dashboard.
To create the Item, go to the Dashboard's settings/items/ At the lower right, click the "+" in a blue disc & then click "Add item"
Complete the following fields: Name: Date Label for display: Date & Time Type: DateTime Category: calendar [an icon for display]
Click "Create" & be returned to the Items list.
In the Items list, click on the Date Item & then click on Add Metadata
To display as month.day.year hour:minute:sec AM/PM complete the following field: Pattern: %1$tm.%1$td.%1$tY %1$tr Click Save
To link the Date Item, go to Settings/Things. Click on Local Time Click on the Channels tab Click on Date, dateTime. Click on Add Link to Item
Click on "Item to Link" Click on Date & Time (Date)
At the bottom, click on the Link button in a blue box
Next: Text configuring a .sitemap file to Display an Item's Data on BasicUI
|
|
|
Post by papa on Jul 26, 2021 20:38:19 GMT
Preparing to Display an Item's Data
One way to use the data collected in the Item named Date is to displaying it.
OpenHAB 3 has two apps for displaying Items:
1) BasicUI, a simpler one
2) HABPanel, which is more flexible & more efficient with screen real estate
Make sure BasicUI & HABPanel are installed:
Go to localhost:8080/settings/addons/ui
Click on each app's name & then at the bottom, click on Install.
Next: Text Configuring a .sitemap File to Display an Item's Data on BasicUI
|
|
|
Post by papa on Jul 27, 2021 0:07:25 GMT
Text configuring a .sitemap file to Display an Item's Data on BasicUIThe following gives one way (displaying it) to make use of the data collected in the Item named Date that was created & linked above. I did not see a Dashboard method for this. I will adapt text .sitemap files that I used with OH 2.5.x. In essence, to a properly formatted (header & curly brackets) existing or new .sitemap file, we add the line: More detail: In openHAB's /sitemaps/ folder, (Linux: /etc/openhab/sitemaps/ ) we could create a .sitemap file to display the Date Item in BasicUI. For example, create a file named Home.sitemap with the contentThen go to the browser address localhost:8080. At the upper right are two small icons, a pencil & a "page." Hovering the mouse pointer over the pencil shows "Edit Home Page." Hovering over the "page," shows "Other apps." Click on the " Other apps" icon & then click on BasicUI. The browser address becomes "localhost:8080/basicui/app" This will list the .sitemap files in the .sitemaps folder, in this case "Home" Click on Home (browser address becomes localhost:8080/basicui/app?sitemap=Home). The Date Item should display its data, something like the pic below. In a browser, using localhost:8080/basicui/app?sitemap=Home will take us directly to the Home sitemap. More Efficiently Display an Item's Data on HABPanel
|
|
|
Post by papa on Jul 28, 2021 21:52:55 GMT
More Efficiently Display an Item's Data on HABPanel
We will now display on an app that is more efficient & flexible with screen real estate than BasicUI is.
Go to the browser address localhost:8080. At the upper right are two small icons, a pencil & a "page." Hovering the mouse pointer over the pencil shows "Edit Home Page." Over the "page," shows "Other apps." Click on the "Other apps" icon & then click on HABPanel. The browser address becomes "http://localhost:8080/habpanel/"
The first time you use HABPanel, click the gear icon at the upper right. At the middle left, click on "Add new dashboard." For the new dashboard, enter a Name, perhaps "Main" & click OK.
Hover the mouse pointer over "Main" at the upper left. Click on the small pencil icon (edit dashboard) that appears. At the upper right, click on the [Add Widget] button.
In Add Widget, choose Dummy (useful for text).
In the new widget window at the upper right, click the 3 stacked dots. Choose Edit. Enter a Name, perhaps Date-Time. In the openHAB Item field, choose the desired Item. You can click the drop down icon & scroll down to the Item named date. OR you can enter Date in the search box. Either way, clck on the Date Item listed. Scroll to the bottom of the Edit Widget Window & click [Save].
Click the [Run] button to see "Date_Time" plus the current date & time in the Main dashboard.
Display Item Data on HABPanel, Continued
|
|
|
Post by papa on Jul 29, 2021 18:34:47 GMT
Display Item Data on HABPanel, ContinuedLater by clicking the pencil icon that will appear next to Main, you can add other widgets to the Main dashboard. By clicking the pencil icon, you can also Edit widget settings: You can change the Date_Time widget's size & shape by dragging the widget's lower right corner. You can change it's location on the dashboard by clicking on the widget's upper left corner & then dragging. After making changes, click the dashboard's [Run] button. Now you can go directly to your HABPanel by entering the browser address: http://localhost:8080/habpanel/OH 3's HABPanel via the OH 3 Dashboard seems to work much the same as OH 2.5.x's via OH 2's PaperUI. The opening browser addresses are just a little different. With the slight differences in mind, this thread (which I'll update later) might help you do more with HABPanel. Next: Configure Things Related to the Network Binding
|
|
|
Post by papa on Jul 30, 2021 15:59:11 GMT
Configure Things Related to the Network BindingIf Network Binding is not installed already, go to localhost:8080/settings/addons/binding At the lower right, click on the blue + sign to add binding. Search for Network, click on it. At the bottom, click on install. Go to localhost:8080/settings/things At the bottom, click on [ inbox]. Click on Network Device with Running Service & near the bottom, click on Add as Thing. Return to localhost:8080/settings/ things. Click on Network Device with Running Service. In the Location field, you may put an optional organizing label, such as "Network" In the Hostname or IP field, enter the IP of your router you obtained in this post above. At the upper right, click Save.
Go to localhost:8080/settings/things & hope to see Network Device... with green "Online" button. Next: Migrate Network Binding Items from OH 2.5.x to OH 3
|
|
|
Post by papa on Jul 30, 2021 20:04:33 GMT
Gateway.items File, Correct for OH 2.5.x, WRONG for OH 3:
At the bottom of localhost:8080/settings/items/Router_Active & localhost:8080/settings/items/RouterResponseTime I saw "Invalid [channel} Link."
Next: Migrate Network Binding Items to OH 3
|
|
|
Post by papa on Jul 30, 2021 20:15:07 GMT
Migrate a Network Binding Item to OH 3
Use the Dashboard to get correct config details...
Go to localhost:8080/settings/things/ Click on Network Device with Running Service. Click on the Channels tab.
Click on the small stacked pages icon near the online channel listing to copy the channel UID In my case, the UID is network:servicedevice:e1767d740a:online Caution: Your UID will have a different code before ":online"
This Channel UID will correct my Item's channel configuration to be...
Switch Router_Active "Router [%s]" <network> (Gateways) { channel="network:servicedevice:e1767d740a:online" }
Again, use your UID code before ":online"
Next: Migrate Another Network Binding Item to OH 3
|
|
|
Post by papa on Jul 30, 2021 20:16:52 GMT
Migrate Another Network Binding Item to OH 3
Use the Dashboard to get correct config details...
Go to localhost:8080/settings/things/ Click on Network Device with Running Service. Click on the Channels tab.
Note: OH 3 calls the channel "latency" instead of "time"
Click on the small stacked pages icon near the latency channel listing to copy the channel UID In my case, the UID is network:servicedevice:e1767d740a:latency Caution: Your UID will have a different code before ":latency"
This Channel UID will correct my Item's channel configuration to be...
Number RouterResponseTime "Router Response Time [%.2f]" <network> (Gateways) { channel="network:servicedevice:e1767d740a:latency" }
Again, use your UID code before ":latency"
Next: Correct Network Binding Items for OH 3
|
|
|
Post by papa on Jul 30, 2021 20:37:07 GMT
Gateway.items File, CORRECT for My OH 3:
Save Gateway.items in OH 3's /items folder (Linux apt get install: /etc/openhab/items)
Caution: In your Router_Active & RouterResponseTime Items use your UID code instead of my e1767d740a. See above posts on how to get that code from the OH 3 Dashboard.
Next: Again, Why Use Text Files to Create & Link Items?
|
|
|
Post by papa on Jul 30, 2021 22:10:41 GMT
Again, Why Use Text Files to Create & Link Items?
In the above posts, I was using the Dashboard to gain necessary info for creating & linking Items & then using that info in a text file of Items. Why not just use the Dashboard as I did in this post?
If I was starting at the beginning & had no Items already, I might use the Dashboard to create items. However, I have many items in text files. I can use the Dashboard to get correct channel linkages & use search & replace to migrate from OH 2.5.x format to OH 3 format. To make new items, I can copy & paste & edit in .items files. I can group related items into .items files that have descriptive names.
Update, Aug. 16, 2021: If I put the correct channel linkages in Items, I only need to refresh the Dashboard in the browser & then a Thing's channels will automatically show themselves as linked to their matching item. Otherwise, I'd have to more Dashboard clicking to link Items & channels.
Dashboard configuration of Items & their links may be best for you. I believe I'll stay with .items text files. Next: HABPanel Displays of Network Binding Items
|
|
|
Post by papa on Jul 31, 2021 18:15:08 GMT
HABPanel Display of a Network Binding Items
Go to the browser address localhost:8080. At the upper right are two small icons, a pencil & a "page." Hovering the mouse pointer over the pencil shows "Edit Home Page." Over the "page," shows "Other apps." Click on the "Other apps" icon & then click on HABPanel. The browser address becomes "http://localhost:8080/habpanel/"
Click the gear icon at the upper right. At the middle left, click on "Add new dashboard." For the new dashboard, enter a Name, perhaps "Network" & click OK. Click on the Network dashboard.
Hover the mouse pointer over "Network" at the upper left. Click on the small pencil icon (edit dashboard) that appears. At the upper right, lick on the [Add Widget] button. Choose Switch.
In the new widget window at the upper right, click the 3 stacked dots. Choose Edit. Enter a Name, perhaps RouterStat. In the openHAB Item field, choose the desired Item. You can click the drop down icon & scroll down to the Item named Router_Active. OR you can enter Router in the search box. Either way, clck on the Router_Active Item listed. Scroll to the bottom of the Edit Widget Window & click [Save].
Click the [Run] button to see "Router_Active" plus ON in the Network dashboard.
Display Network Binding Item Data on HABPanel, Continued
|
|
|
Post by papa on Jul 31, 2021 18:39:30 GMT
Display Network Binding Item Data on HABPanel, Continued
Still in the Network dashboard, follow the widget creation process in the last post to Add a Widget, a Dummy type (even though it will display a Number Item.
Edit the new widget. Give a Name, perhaps RouterLatency. Select the correct Item, RouterResponseTime
Save the widget. Click Run to see the widget display RoutLatency & we hope a low number like 0 or 1.
Next: Backup Your OH Work So Far
|
|
|
Post by papa on Jul 31, 2021 19:04:29 GMT
Backup Your OH Work So Far
In the Linux Terminal app, execute
The backup script stores your OH configuration in a time-stamped zip file which is saved in /var/lib/openhab/backups for automatic installs & openhab/backups for manual installs.
For safety & upgrading convenience, do backups regularly.
Ahead: MQTT Binding Things, Items, Links, HABPanel Displays
|
|