i have a working openhab1 and I am trying to work out how best to migrate to openhab2.
I started by playing with paperUI, and was able get most of my zwave and sonos devices linked, but I am now having issues on how I should convert the rules files and actually get my automation going since the items are stored in a DB file not the old items files.
I have items like
Group GF (All)
Group BS (All)
Group gSunset
Group g1am
Group g12midnight
Switch light_outside_frontdoor_switch "Outside Front Door Light " (GF,gSunset,g1am) {zwave=“4:command=switch_binary”}
Switch light_outside_garage_switch "Outside Garage Light " (GF,gSunset,g1am) {zwave=“5:command=switch_binary”}
Switch light_living_room_switch "Living Room Socket " (GF,gSunset,g12midnight) {zwave=“6:command=switch_binary”}
Switch light_front_door__switch "Front Door Socket " (GF,gSunset,g12midnight) {zwave=“7:command=switch_binary”}
And rules like
rule "React to 1am"
when
Time cron “0 0 0 * * ?” // Every day 00:00 hours, turn off the lights
then
g12midnight.members.forEach(Switch|
sendCommand(Switch, OFF)
)
end
I don’t see an easy way to assign a group to a thing to replicate g12midnight.members.forEach since i can’t edit the things database and there doesn’t seem to be a way to group groups from the paperUI.
You will probably have to either move to all text files or a combo of PaperUI defined Items and text defined Items. PaperUI dues not provide a way to do everything one can do on Items.
I have looked at the migration tutorial and I am still struggling
From PaperUI, I have 2 Garage Door Zwave things that at come up with the following channels
zwave:device:9e8b145a:node9:sensor_binary
zwave:device:9e8b145a:node9:alarm_burglar
zwave:device:9e8b145a:node9:battery-level
I try to define the following in my items
Number garage_door_1_battery “Garage 1 Battery [%s]” (Motion) {channel=“zwave:device:9e8b145a:node9:battery-level”}
Switch garage_door_1_motion “Garage 1 Motion [%s]” (Motion) {channel=“zwave:device:9e8b145a:node9:alarm_burglar”}
Switch garage_door_1_tamper “Garage 1 Tamper [%s]” (Motion) {channel=“zwave:device:9e8b145a:node9:sensor_binary”}
Before I add these items my motion.items files PaperUI displays correctly the
Garage Door 1
Binary Sensor OFF
Alarm (burglar) OFF
Battery 100
Garage Door 2
Binary Sensor OFF
Alarm (burglar) OFF
Battery 100
After I add the rules above I see that PaperUI is updating some of the names in the control display, eg on one sensor it changed binary sensor to Garage 2 Motion. Is that normal?
I also would like to check that I am setting correct Variable type eg Switch or Number in the rules.