Hi
I’m just getting started with openHAB2. Please forgive me if these questions have already been addressed in another post. I’ve spent a few days searching through the forum and haven’t come up with any answers.
I’ve managed to get my onkyo receiver set up to send power on/off and volume commands. Now, I’m working to set up a z-wave door sensor. I purchased an aeon labs z-wave stick and an ecolink door sensor.
First, I’d like to get one point of confusion out of the way.
I added the Onkyo, z-wave stick, and z-wave door sensor as Things through PaperUI. As I activated the Channels I want to use, I also chose to link the channels to new Items. So my Items are also defined in PaperUI. With this in mind, is there any need to also define the item in a .items text file? From what I’ve seen in my testing, it doesn’t look like I have to define them in a text file. But I’m wondering what the best practice is. If the item is defined in a text file AND PaperUI, do I now have two items linked to the same channel, or is openHAB smart enough to know that the same item is defined in two places?
Regarding the sitemap file, I have the following:
sitemap main label="Main" {
Frame label="Living Room TV"{
Switch item=TXNR709_Zone1_Power label="Receiver Power" icon=switch
Setpoint item=TXNR709_Zone1_Volume label="Receiver Volume" icon=soundvolume
}
Frame label="Security"{
Text item=FrontDoorSensor_BinarySensor label="Front Door Sensor" icon=door
Text item=FrontDoorSensor_BatteryLevel label="Front Door Battery" icon=battery
}
}
I’ve changed the default sitemap in BasicUI to use my main.sitemap file. The onkyo items work as expected. When I load the webpage, I see the current state of power and volume. However, the door sensor items do not report state when the page first loads. If I open or close the door, the webpage updates with the correct sate. But when I refresh the page, the sate is lost. As for the battery state, I can’t figure out any pattern as to when it will display the battery percent. Occasionally it’s there but most of the time I just have an icon of a green battery.
I thought my sitemap problems might be an issue with persistence, so I added mapdb through PaperUI and created the following mapdb.persist file from an interesting post I found here: https://community.openhab.org/t/design-pattern-group-based-persistence/15098
Strategies {
default = everyUpdate
}
Items {
// persist all items on every change and restore them from the db at startup
* : strategy = everyChange, restoreOnStartup
}
This has not solved the problem with the sitemap.
Also, I enabled debug logging for mapdb so I could see what’s going on. I can see it storing the state when the door is opened or closed:
2017-01-19 07:47:03.796 [DEBUG] [pdb.internal.MapDBPersistenceService] - store called for FrontDoorSensor_BinarySensor
2017-01-19 07:47:03.811 [DEBUG] [pdb.internal.MapDBPersistenceService] - Stored 'FrontDoorSensor_BinarySensor' with state 'OFF' in mapdb database
Should I also be able to see the restore on startup being logged when openHAB is started? I’m not seeing that in the log. I only see that mapdb is started and has been activated.
Thanks.