Is PLEG the right place for me?

Hello,

Should I learn PLEG for this, or perhaps luup?

I have two zones in my house that I want to heat with two space heaters. I have ever spring temperature sensors and z-wave outlets for this purpose. I have the ever springs behaving very well at this point.

I need behavior more like a programmable thermostat, but I have no HVAC system, just space heaters.

I need the heaters turning on and off based on 1) schedule; then 2) temperature.

An example would be: In the reptile room, from 8pm to 8am, keep a steady temperature of 78 degrees F; From 8am to 8pm, keep a steady temperature of 85 degrees.

The problem with the basic Vera3 is you can trigger an event based on a single condition: on/off at a specific time, or on/or for a specific temperature. Surprisingly, there’s not time range option. I can get around this by creating triggers every n minutes, for example, but is that the best way to go?

Try PLEG.

If you are not a programmer, it will be a quicker, easier solution; particularly with the two conditions.

just be patient and use this board…

Thanks! I’ll search and learn. Hopefully the curve is not to steep. :slight_smile:

you may find it that way. Since you are not being too ambitious with your expectations here, you should be OK.

Start with reading the PLEG Basics guide.

Here is how I would use PLEG for your scenario:

You need a PLEG input Trigger:
CurrentTemp Bound to the Temperature sensor for your room.

You need a PLEG Input Schedule:
NightSchedule On time is Day of Week Mon-Sun at 8PM, Off Time is Day of Week Mon-Sun at 8AM

You need a couple conditions:
SetPoint NightSchedule ? 78 : 85
NeedHeat CurrentTemp < SetPoint ? 1 : 0
Set the repeat option for NeedHeat.

The actions for:
NeedHeat SpaceHeaterSwitchOn for device with value of {(NeedHeat}
NOTE1: To set this value … use the device tab to turn on the Space Heater switch … Then go to the advanced tab and change the value from 1 to {(NeedHeat}
[hr]
NOTE2: You can use the Same PLEG to control multiple zones. You will need multiple temperature sensors and switches for the space heaters.
Just create a separate name for each sensor and each switch bound to the appropriate devices (i.e. SetPoint_LivingArea, SetPoint_Bedoom, …)
If they all share the same SetPoint and the same schedule … you can use a global SetPoint condition, otherwise you will need separate SetPoint schedess and conditions. Then one condition for each zone (i.e. NeedHeat_LivingArea, NeedHeat_Bedroom, …)

^this is great. turns out my plan is even easier. I just need it to turn off above/ turn on below 85 during a daytime 12-hour period and 77 during night-time period.

I’m still trying to wrap my brain out this. This example is great because now I can decipher it “reverse engineer it” using the excellent PDF in the sticky.

Okay let me see if I am comprehending. I want to understand this, as opposed to just “hey guys will you work this out for me?”

This is roughly what I want:

Reptile Room. Daytime: Heat, on if below 85, off if above. Nighttime: On if below 77, off if above. (i.e…, maintain 77)

Bedroom. Weekday. 5am-9am. Maintain 70. 9am-6pm maintain 64. 6pm-11pm maintain 70. 11pm-6am maintain 68. Weekend. Slightly different temps and time ranges.

I select Input Trigger and create:
CurrentTempReptile
(bound to temp sensor in reptile room)

CurrentTempBedroom
(bound to temp sensor in bedroom)

Input Schedule:
ReptileDaySched Start all days of week 8am; Stop all days of week at 7:59pm
(Question: Does ReptileDaySched etc. go on same temperature sensor or do I use Input Schedule only?)
ReptilleNightSched Start all days of week 8pm; Stop all days of week at 7:59am

(the humans are more finicky :stuck_out_tongue: )
BedroomAMSched Start M-F 5am; Stop MF at 8:59am
BedroomDaySched Start M-F 9am; Stop MF at 5:59pm
BedroomPMSched Start M-F 6pm; Stop MF at 10:59pm
BedroomSleepSched Start M-F 11pm; Stop MF at 4:59am

BedroomAMSchedWKND Start SatSun 5am; Stop SS at 10:59am
BedroomDaySchedWKND Start SS 11am; Stop MF at 6:59pm
BedroomPMSchedWKND Start SS 7pm; Stop SS at 11:59pm
BedroomSleepSchedWKND Start M-F 12am; Stop MF at 4:59am

Conditions:
Do I need a setpoint for each one? For example:

SetPointReptileDay ReptileDaySched ? 85 : 85 (because I decided keep temperature same instead of a fluctuating range?)
SetPointReptileNight ReptileNightSched ? 77 : 77
etc?

And then I need one of these for every SetPoint I create for every Schedule? for example:
NeedHeatBedroom CurrentTempBedroom < SetPointBedroomAMSched ? 1 : 0
NeedHeatReptile CurrentTempReptile < SetPointReptileDaySched ? 1 : 0

For example:
NeedHeatBedroom SpaceHeaterSwitchOn for device with value of {(NeedHeatBedroom} <–is that syntax correct with two brackets and one left parenthesis?
And then I put the {(NeedHeatBedroom} on the advance tab value of the switch for the bedroom space heater as you demonstrated? make a similar one for the reptile room space heater?

What did I get wrong there? I feel like I lost the thread a little bit and I’m adding more lines of code than necessary.

you can simplify this a lot for example:

Reptile Room. Daytime: Heat, on if below 85, off if above. Nighttime: On if below 77, off if above. (i.e…, maintain 77)

Input Trigger
CurrentTempReptile (bound to temp sensor in reptile room)

Input Schedule:
ReptileDaySched Start all days of week 8am; Stop all days of week at 8:00pm

Conditions:

HeatReptile = (ReptileDaySched AND CurrentTempReptile <85) OR (!ReptileDaySchedule AND CurrentTempReptile<77)
(select repeats)

Action

HeatReptile Turn On outlet with Heater

For the Bedroom…

Weekday. 5am-9am. Maintain 70. 9am-6pm maintain 64. 6pm-11pm maintain 70. 11pm-6am maintain 68. Weekend. Slightly different temps and time ranges.

Inputs Triggers:
CurrentTempBedroom (bound to temp sensor in bedroom)

Input Schedule:

BedroomAMSched Start M-F 5am; Stop MF at 8:59am
BedroomDaySched Start M-F 9am; Stop MF at 5:59pm
BedroomPMSched Start M-F 6pm; Stop MF at 10:59pm
BedroomSleepSched Start M-F 11:00pm; Stop MF at 5:00am

Conditions:
NeedHeatBedroom = (BedroomAMSchedule AND CurrentTempBedroom<70) OR (BedroomDaySchedule AND CurrentTempBedroom<64) OR (BedroomPMSchedule AND CurrentTempBedroom<70) OR (BedroomSleepSchedule AND CurrentTempBedroom<68) OR …[add your weekend schedules and temps)

Actions:
NeedHeatBedroom turn on your outlet with the heater.

oh my god, so great. Thanks. I’ll study this and ask questions if I need to.

Hi

I’m running this now, and it doesn’t appear to be working. I’m sure the mistake is probably mine. I have changed some of the syntax to reflect my last minute wording choices.

I should point out that the z-wave receptacle/switch “SnakePower2Temp” and the temp sensor “SnakeRoomTemperature” are tested and working, when used in a standard trigger. These triggers are currently disabled.

The Program Logic Event Generator device is “Armed”

[quote=“Bulldoglowell, post:8, topic:180589”]Snake Room. Daytime: Heat, on if below 85, off if above. Nighttime: On if below 77, off if above. (i.e…, maintain 77)

Input Trigger
CurrentTempSnake (bound to temp sensor in snake room)[/quote]
^When I do this as I interpret it, I wind up with, on the Input Trigger page, is a table that reads “CurrentTempSnake | SnakeRoomTemperature temperature goes below undefined degrees”
Is that correct? Or should I have entered something into the “Temperature” field of the “Input Triggers” page?
Also, I should point out that the everspring sensor shows up in ui5 three ways. As a “sensor”, as a humidity sensor, and as a temperature sensor. I have bound it to the temperature sensor, which was renamed “SnakeRoomTemperature”

Input Schedule: [b]SnakeDaySched[/b] Start all days of week 8am; Stop all days of week at 8:00pm
See attached screenshot. There is nothing in "device properties"
Conditions:

HeatSnake = (SnakeDaySched AND CurrentTempSnake < 85) OR (!SnakeDaySched AND CurrentTempSnake < 77)
(select repeats)


I took this to mean enter “HeatSnake” into the Condition Name field and into the Condition Expression field I entered “(SnakeDaySched AND CurrentTempSnake < 85) OR (!SnakeDaySched AND CurrentTempSnake < 77)”. If I click edit everything has nice pretty colors and when I save, no errors are reported.
“Repeats” is checked.

Action

HeatSnake Turn On outlet with Heater


I clicked “Action”, and out at the “Define Actions for Device” page, I clicked “SnakePower2Temp” (the known and tested name for the z-wave powerstrip receptacle that powers on the space heater) and clicked “Finish”. The result on the “Actions” page is a table that reads: HeatSnake | Immediate - 1

Use the Status command.
It puts everything related to your PLEG in a nice report.
Attach it to the forum … as PDF is best … indicate the condition your are concerned about.

Hi

Attached. Curious: how is “Status” different from “Report”?

It’s hard for me to say what I’m concerned about in the report. But what I can say is, The SnakeRoomTemperature on the ui5 is currently displaying 80 degrees and falling, it is currently “SnakeDaySched” or should be, and the heater is not on.

The desired result is that the heater will maintain a temperature of approximately 85 degrees, unless is it at night, in which case 77.

And perhaps I should add, I’m referring to Fahrenheit and the temperature sensor is set to display Fahrenheit.

yeah, should have given you more detail on the ‘trigger’

you want a Device Property for the snake’s room temperature.

you used a trigger for a temperature change, which won’t work with the logic we gave you.

take a look at the attached.

Select Inputs, then Device Properties, then your thermometer as the device.

name it and use that instead of CurrentTempSnake

Or delete the trigger you named CurrentTempSnake first and then use the same name.

Joy! The heater came on!

Well, it didn’t come on right away after I saved. I clicked “do it now”. How long before it would have come on automatically?

Now to see if it turns off when it’s supposed to…

Made a new pdf, if you care to look.

So, you created a condition that will turn on the heat when the temperature drops below those two set points during those two schedules.

Now you have to turn it off when the heater accomplishes its goal.

create a condition:

SnakeHeatOff = !HeatSnake

and similar to your ON condition, go in and set the outlet that the heater is plugged into into the OFF state.

If this was a regular thermostat, you wouldn’t have to worry about the off state, because the thermostat does that. You have to turn it off or else the snakes will get too hot >:(

no one likes hot crabby snakes.

Now that you have it on … You need a second condition:

HeatOffSnake Not HeatSnake

Then an action for HeatOffSname to turn off the Switch SnamePower2Temp

LOl’d. Or more important to my well-being, no one likes angry mourning wife!

It works like a champ so far! Thank you. Now I have a working framework for heating other areas of the house. And who knows, maybe I can start figuring out other tasks on my own.

The really cool part of this is those inversions. I admire your logical thinking.

How in the world do you fine fellows get smites? Surely they are in jest!