Hi,
Its been a while now since i first started playing with Vera… and then when i found out it can not do what i wanted it to do natively, by asking the forum how the heck i could do just some of what i wanted, i was introduced to PLEG. This awesome piece of work really is what i expected Vera to be able to do and as such i have stayed with Vera almost solely because of it (and the RFXtrx plugin).
I wanted to share my Heating and Hot Water setup that i have near perfect now with the hope that it will help others get to grips with PLEG and for others with more skill than myself to point out where i could improve. The aim of this PLEG instance is to optimise Heat and Water in my home by reducing consumption with out really compromising on comfort.
To summarise what hardware i have before the huge PLEG, I have: Motion Sensors in every room (4 in 1’s and PIR’s from a DSC 1832), 13 Danfoss TRV’s, 1 ASR2-RF for switching Hot Water or/and Heating (2 Relays in the device) and 4 1 wire thermometers on the pipes exiting my Megaflo Water Storage tank.
Here is my PLEG Setup:
Triggers
Name Description
DINPIR Dining Room PIR is tripped
DOGPIR Dogs Room PIR is tripped
HALLPIR Hallway PIR is tripped
TEMPPIRHALL Office_4 in 1 sensor (motion) is tripped
BED4PIR Grants_4 in 1 sensor (motion) is tripped
KITPIR Kitchen PIR is tripped
LANDINGPIR Landing PIR is tripped
TEMPLIVPIR Guest Room_4 in 1 sensor (motion) is tripped
LIVPIR Living Room PIR is tripped
UTILPIR Backdoor Motion Sensor is tripped
BED1PIR Master Bedroom_4 in 1 sensor (motion) is tripped
Schedules
Name Type Time Days
Periodic Interval 30m
HeatOnMorn Weekly 03:01:00 1,2,3,4,5,6,7
HeatOffMorn Weekly 08:29:00 1,2,3,4,5,6,7
HeatOffWKND Weekly 10:59:00 6,7
HeatOnNight Weekly 16:59:00 1,2,3,4,5,6,7
HeatOffNight Weekly 22:59:00 1,2,3,4,5,6,7
WaterOnMorn Weekly 03:29:00 2,3,4,5,6,7
WaterOffMorn Weekly 05:59:00 2,3,4,5,6,7
WaterOnNight Weekly 16:59:00 1,2,3,4,5,6,7
WaterOffNight Weekly 17:59:00 1,2,3,4,5,6,7
MidMornHeat Weekly 04:59:00 1,2,3,4,5
WaterOffMornWKND Weekly 06:59:00 6,7
WaterOnMornMon Weekly 01:59:00 1
WaterOffMornMon Weekly 03:59:00 1
Device Properties
Name Device Name Device Variable
WaterMode Hot Water ModeTarget
HeatRelayMode Heating ModeTarget
OutsideTemp Temperature CurrentTemperature
BED3RAD Guestroom 1 Radiator CurrentSetpoint
BED2RAD Office Radiator CurrentSetpoint
BED1RAD Master Bedroom Radiator CurrentSetpoint
BED4RAD Grants Room Radiator CurrentSetpoint
BED1TEMP _4 in 1 sensor (temp) CurrentTemperature
BED4TEMP Grants_4 in 1 sensor (temp) CurrentTemperature
HotWaterStorage Pressure Release (Middle) CurrentTemperature
Conditions
Name Expression
HeatRepeat Periodic
WaterRepeat Periodic
HeatOn (HeatOnMorn or HeatOnNight) and (AnyMotion; NOW < 18:00:00) and ComfortCheck
HeatOff (HeatOffMorn or HeatOffNight) or (HeatOnMorn; ReachedTemp < 05:30:00) or (HeatOnNight; ReachedTemp < 05:30:00)
WaterOn (AnyMotion; Periodic < 18:00:00) and (HotWaterStorage <= 40)
WaterOff WaterTempReached
AnyMotion DINPIR or DOGPIR or HALLPIR or TEMPPIRHALL or BED4PIR or KITPIR or LANDINGPIR or TEMPLIVPIR or LIVPIR or BED1PIR or UTILPIR
TurnDown HeatOffNight
TurnUp HeatOnNight and (AnyMotion; NOW < 18:00:00) and (OutSideTemp <= 11)
MidMorn WaterOffMorn or WaterOffMornWKND and (AnyMotion; NOW < 18:00:00) and (OutSideTemp <= 11)
ReachedTemp (BED1TEMP >= 21) and (BED4TEMP >= 19)
ComfortCheck (BED1TEMP <= 11) or (BED4TEMP <= 11)
WaterStillHot HotWaterStorage <= 40
AnyMotion18 AnyMotion; NOW < 18:00:00
WaterTempReached HotWaterStorage >= 55
Actions
Actions for Condition: HeatRepeat
Device Action Arguments
Heating SetModeTarget NewModeTarget={(HeatRelayMode)}
Actions for Condition: WaterRepeat
Device Action Arguments
Hot Water SetModeTarget NewModeTarget={(WaterMode)}
Actions for Condition: HeatOn
Device Action Arguments
Heating SetModeTarget NewModeTarget=HeatOn
Push Notification SendProwlNotification Event=Heating ON Description=Heating ON Priority= URL=
Actions for Condition: HeatOff
Device Action Arguments
Heating SetModeTarget NewModeTarget=Off
Push Notification SendProwlNotification Event=Heat OFF Description=Heat OFF Priority= URL=
Actions for Condition: WaterOn
Device Action Arguments
Hot Water SetModeTarget NewModeTarget=HeatOn
Push Notification SendProwlNotification Event=Water Heat ON Description=Water Heat ON Priority= URL=
Actions for Condition: WaterOff
Device Action Arguments
Hot Water SetModeTarget NewModeTarget=Off
Push Notification SendProwlNotification Event=Water Heat OFF Description=Water Heat OFF Priority= URL=
Actions for Condition: TurnDown
Device Action Arguments
Dining Room Radiator SetCurrentSetpoint NewCurrentSetpoint=10
FrontDoor Radiator SetCurrentSetpoint NewCurrentSetpoint=10
Guest Toilet Radiator SetCurrentSetpoint NewCurrentSetpoint=10
Guestroom 1 Radiator SetCurrentSetpoint NewCurrentSetpoint=10
Office Radiator SetCurrentSetpoint NewCurrentSetpoint=10
Kitchen Radiator SetCurrentSetpoint NewCurrentSetpoint=10
Landing Radiator SetCurrentSetpoint NewCurrentSetpoint=10
Livingroom Back Radiator SetCurrentSetpoint NewCurrentSetpoint=10
Livingroom Front Radiator SetCurrentSetpoint NewCurrentSetpoint=10
Grants Room Radiator SetCurrentSetpoint NewCurrentSetpoint=10
Actions for Condition: TurnUp
Device Action Arguments
FrontDoor Radiator SetCurrentSetpoint NewCurrentSetpoint=20
Guest Toilet Radiator SetCurrentSetpoint NewCurrentSetpoint=21
Bathroom Radiator SetCurrentSetpoint NewCurrentSetpoint=20
Kitchen Radiator SetCurrentSetpoint NewCurrentSetpoint=21
Landing Radiator SetCurrentSetpoint NewCurrentSetpoint=19
Livingroom Back Radiator SetCurrentSetpoint NewCurrentSetpoint=21
Livingroom Front Radiator SetCurrentSetpoint NewCurrentSetpoint=22
Actions for Condition: MidMorn
Device Action Arguments
Kitchen Radiator SetCurrentSetpoint NewCurrentSetpoint=21
Landing Radiator SetCurrentSetpoint NewCurrentSetpoint=20
Livingroom Back Radiator SetCurrentSetpoint NewCurrentSetpoint=21
Livingroom Front Radiator SetCurrentSetpoint NewCurrentSetpoint=22
FrontDoor Radiator SetCurrentSetpoint NewCurrentSetpoint=20
Actions for Condition: ReachedTemp
Device Action Arguments
Heating SetModeTarget NewModeTarget=Off
Push Notification SendProwlNotification Event=Heat OFF Description=Reached Temp Priority= URL=
There are limitations i need to work through such as the Danfoss thermostats do not always respond but i don’t want to keep sending the command to them as they are battery powered and seem to eat batteries. I need to add logic for the 2 guest rooms so they change from 10c to 20c when motion is detected and the HeatOff command is sent for the Water too many times as the thermometer fluctuates between 49 and 50. Other than that it all seems to work nicely. As it is still summer in the UK I will probably tweak this again in winter but my point being, the above was made some much simpler with PLEG than trying to learn LUA to do the same thing (I tried, i mostly failed).
Hope this helps others who are starting with PLEG to see what can be done with RichardTSchaefer’s plugin(s), and please feel free to help me improve my logic if you see an error or improvement.