Is there a widget/plugin for OpenHAB which lets user control his boiler in a similar way to this device:
There is no widget for your sitemap that will work like this.
You will need to adopt the Alarm Clock example (search the forum for Alarm Clock) to put editable start and end times on your sitemap and a rule to send ON/OFF commands to the boiler at those times.
If the times donât need to be changed manually from the sitemap you can very easily set up that sort of control in rules.
Finally, one of the beautiful things about home automation is you are not stuck with just time. You can turn on and off the boiler based on events and combinations of events such as sunrise, sunset, temperature, whether you are home or not, etc.
Hi,
I am a beginner at this.
I was copying the 4th example for the Alarm clock â7 Day Three Zone Scheduler with Boost Buttonsâ : https://github.com/openhab/openhab1-addons/wiki/AlarmClock
The code as it is in the example is functional but since I am using OH2 I was wondering about 2 topics:
- Are there any modifications needed for this code for OH2?
- I noticed that the settings for the alarms/timers are not saved. they are reset to the code values after a reboot. Is there a way for the settings to be saved somewhere so I will not need to re-enter the setting every time?
Thanks!
One thing to change will be the import statements - you donât need those in OH2.
If you want the settings you have made to âsurviveâ a reboot, you will have to persist your items:
http://docs.openhab.org/addons/persistence.html
HTH,
-OLI
I agree with Oli. The only changes I see needed is to remove all the imports that start with âorgâ.
And to persist the changes you need to create Items and use persistence to restore them on a reboot.
Could you please help me with how to use persistence in this specific code example?
What and where should I change the code?
Thank you!
I configured the MapDB persistence, I see the log storing the updates to the MapDB db.
However, when I start up the system the values are not restored.
I suspect the rule code re-initializes the values when system is started ignoring the stored values in mapdb.
example log:
20:39:05.597 [INFO ] [marthome.event.ItemStateChangedEvent] - DownWkSchedTimeHour changed from 17 to 3
20:39:05.607 [DEBUG] [pdb.internal.MapDBPersistenceService] - store called for DownWkSchedTimeHour
20:39:05.614 [DEBUG] [pdb.internal.MapDBPersistenceService] - Stored âDownWkSchedTimeHourâ with state â3â in mapdb database
section of the rule:
rule âInitializationâ
when
System started
then
lock1.lock()postUpdate(DownWkSchedTimeHour, 17) postUpdate(DownWkSchedTimeMinute, 30)
Is it correct? Do i need to modify the rule code?
First, do you have persistence configured with restoreOnStartup on the items? If so then you no longer need this system started rule.
Hi Rick, First I would like to say you are a great contribution to the community.
I have learned a lot from your posts.
As for the thread.
Yes, I think I did it correctly.
I have this mapdb.persist:
Strategies {
default = everyUpdate
}
Items {
// persist all items once a day and on every change and restore them from the db at startup
gWaterWkSchedTime* : strategy = everyChange, restoreOnStartup
gUpWkSchedTime* : strategy = everyChange, restoreOnStartup
gDownWkSchedTime* : strategy = everyChange, restoreOnStartup
gWeekDays* : strategy = everyChange, restoreOnStartup
gTimerButtonsTimeout* : strategy = everyChange, restoreOnStartup
gTimerButtons* : strategy = everyChange, restoreOnStartup
gSchedSwitch* : strategy = everyChange, restoreOnStartup
}
and the items are exactly like in the example (4) code:
Group gTimerButtons
Group gTimerButtonsTimeout
Group gWeekDays
Group gDownWkSchedTime
Group gUpWkSchedTime
Group gWaterWkSchedTime
Group gSchedSwitch
Switch ADownstairs âMain Downstairs Switch [%s]â { gpio=âpin:16 activelow:yes force:yesâ}
Switch AUpstairs âMain Upstairs Switch [%s]â { gpio=âpin:20 activelow:yes force:yesâ}
Switch AWater âMain Hot Water Switch [%s]â { gpio=âpin:21 activelow:yes force:yesâ}
Switch DownBoostSwitch âBoost Ground Floorâ (gTimerButtons)
Switch UpstairsBoostSwitch âBoost Upstairsâ (gTimerButtons)
Switch WaterBoostSwitch âBoost Hot Waterâ (gTimerButtons)
Number DownstairsBoostTime âHours [%d]â (gTimerButtons)
Number UpstairsBoostTime âHours [%d]â (gTimerButtons)
Number WaterBoostTime âHours [%d]â (gTimerButtons)
Switch DownSchedSwitch (gSchedSwitch)
Switch UpstairsSchedSwitch (gSchedSwitch)
Switch WaterSchedSwitch (gSchedSwitch)
Switch EnableDownstairsScheduler (gSchedSwitch)
Switch EnableUpstairsScheduler (gSchedSwitch)
Switch EnableWaterScheduler (gSchedSwitch)
Switch DownWkSchedMonday âMondayâ (gDownWkSchedTime)
Switch DownWkSchedTuesday âTuesdayâ (gDownWkSchedTime)
Switch DownWkSchedWednesday âWednesdayâ (gDownWkSchedTime)
Switch DownWkSchedThursday âThursdayâ (gDownWkSchedTime)
Switch DownWkSchedFriday âFridayâ (gDownWkSchedTime)
Switch DownWkSchedSaturday âSaturdayâ (gDownWkSchedTime)
Switch DownWkSchedSunday âSundayâ (gDownWkSchedTime)
String DownWkSchedTimeStartMessage â%sâ
String DownWkSchedTimeEndMessage â%sâ
Number DownWkSchedTimeHour âHour [%d]â (gDownWkSchedTime)
Number DownWkSchedTimeMinute âMinute [%d]â (gDownWkSchedTime)
Number DownWkSchedTimeEndHour âHour [%d]â (gDownWkSchedTime)
Number DownWkSchedTimeEndMinute âMinute [%d]â (gDownWkSchedTime)
Switch UpWkSchedMonday âMondayâ (gUpWkSchedTime)
Switch UpWkSchedTuesday âTuesdayâ (gUpWkSchedTime)
Switch UpWkSchedWednesday âWednesdayâ (gUpWkSchedTime)
Switch UpWkSchedThursday âThursdayâ (gUpWkSchedTime)
Switch UpWkSchedFriday âFridayâ (gUpWkSchedTime)
Switch UpWkSchedSaturday âSaturdayâ (gUpWkSchedTime)
Switch UpWkSchedSunday âSundayâ (gUpWkSchedTime)
String UpWkSchedTimeStartMessage â%sâ
String UpWkSchedTimeEndMessage â%sâ
Number UpWkSchedTimeHour âHour [%d]â (gUpWkSchedTime)
Number UpWkSchedTimeMinute âMinute [%d]â (gUpWkSchedTime)
Number UpWkSchedTimeEndHour âHour [%d]â (gUpWkSchedTime)
Number UpWkSchedTimeEndMinute âMinute [%d]â (gUpWkSchedTime)
Switch WaterWkSchedMonday âMondayâ (gWaterWkSchedTime)
Switch WaterWkSchedTuesday âTuesdayâ (gWaterWkSchedTime)
Switch WaterWkSchedWednesday âWednesdayâ (gWaterWkSchedTime)
Switch WaterWkSchedThursday âThursdayâ (gWaterWkSchedTime)
Switch WaterWkSchedFriday âFridayâ (gWaterWkSchedTime)
Switch WaterWkSchedSaturday âSaturdayâ (gWaterWkSchedTime)
Switch WaterWkSchedSunday âSundayâ (gWaterWkSchedTime)
String WaterWkSchedTimeStartMessage â%sâ
String WaterWkSchedTimeEndMessage â%sâ
Number WaterWkSchedTimeHour âHour [%d]â (gWaterWkSchedTime)
Number WaterWkSchedTimeMinute âMinute [%d]â (gWaterWkSchedTime)
Number WaterWkSchedTimeEndHour âHour [%d]â (gWaterWkSchedTime)
Number WaterWkSchedTimeEndMinute âMinute [%d]â (gWaterWkSchedTime)