Newbie - Trane thermostat scheduling

You’d want to switch between ‘Normal’ and ‘ESM’ mode. The Energy Saver Mode is essentially a hold with preset setpoints.

Read through this thread for some ideas.

[quote=“oTi@, post:41, topic:167245”]You’d want to switch between ‘Normal’ and ‘ESM’ mode. The Energy Saver Mode is essentially a hold with preset setpoints.

Read through this thread for some ideas.[/quote]

Thanks for the help. I will start playing with code customizations.

However, I do think that if you want to get reasonably non-technical users to embrace this product and technology the answer for them will not be to start writing modifying code. Forgive me as I am new here, but do you know if there is a way to contribute to the programming of the actual thermostat control object?

I’ve read through the thread and still having some trouble getting the ESM setup. Ultimately I’m trying to do what a number of others are by switching into the ESM mode as a vacation mode.

What I setup and working are the normal Morning, Daytime, Evening, Night scenes with timers and set points. I leave the Normal/Energy setting as unchanged.

I created another scene that runs once (the day I leave) which sets the Heat and Cool set point and to the Energy setting. I also have a scene that switches back to Normal on the day I return.

In testing the scene that sets the Energy mode, I can stand in front of the thermostat and see the temp set points change, but the display on the tstat still shows the “Run” mode instead of ESM. What am I doing wrong?

The other question is the Morning/Daytime/Evening/Night scenes will still run, but I’m assuming that even though they change the set points, will the ESM set points changes to the values in the 4 scenes?

Like others, basically trying to implement the Hold function.

Thanks

So I got the ESM to set using some of the luup code in one of the posts, but now when the Morning/Day/Evening/Night scenes run, they change they seem to override the ESM set points. For example, the ESM cool is set to 76. When the Morning scene runs, the cool set point is programmed to 73. As a test, I run the scene to change to ESM mode and change the cool set point to 76. Then, the Morning set point runs and changes the cool set point to 73. Seems to defeat the purpose of ESM. What am I doing wrong to emulate the Hold function?

@toddla,

Welcome!

Check the code in this post / see that thread.

In this snippet:

local Virtual - EMS=53 local Virtual - EMS= luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", EMS) if (EMSStatus == "1") then return false end return true

You need to give the local variable an appropriate name, and Variables have a strict naming convention. “[tt]Virtual - EMS[/tt]” is not a good variable name, since it has spaces, and a minus sign in it. You’ll be safe if you use Alpha-Numerics. There are other characters, but AlphaNumerics are the easiest to remember.

Also, the names of variables you declare/assign, need to match the names of the ones you use later in your code.

Instead, write it like the following:

local EMS = 53 local EMSStatus = luup.variable_get("urn:upnp-org:serviceId:SwitchPower1", "Status", EMS) if (EMSStatus == "1") then return false end return true

Now this whole snippet is intended to run in a Scene Luup block somewhere to prevent the Scene from executing when the Switch Device (# “53”) is “on”. It won’t actually set the Device into any mode, since there’s no [tt]luup.call_action(…)[/tt]

People are using blocks of Lua code like the above, declared against their scenes, to prevent each scenes from running when the Switch Device is on (or off), etc.

For this code:

luup.call_action("urn:upnp-org:serviceId:HVAC_FanOperatingMode1","SetMode",{ NewMode"ContinuousOn" },53) luup.call_action("urn:upnp-org:serviceId:HVAC_FanOperatingMode1","SetMode",{ NewMode"Auto" },53)

it’s missing an “=” sign in the right spot. It would look more like:

luup.call_action("urn:upnp-org:serviceId:HVAC_FanOperatingMode1", "SetMode", {NewMode = "ContinuousOn"}, 53) luup.call_action("urn:upnp-org:serviceId:HVAC_FanOperatingMode1", "SetMode", {NewMode = "Auto"}, 53)

It’s a subtle/necessary change for the syntax to be correct, or it’ll silently error out behind the scenes…

PS: I’ve added some spacing for clarity, but they’re not required (more of a personal preference)

Fantastic! Works perfectly.

@RastusB2,

Where are you at, after the hints from @guessed?

Reading through your post, I’m wondering how you set up your scenes / what you are looking to accomplish. I’m guessing you have 4 scenes to control thermostat setpoints. And you’d now want to add a Home/Away (you named it EMS) virtual switch, so you can kick the thermostat to EMS when away and also would like the fan mode to go to Auto when away?

Sounds like you have the appropriate scenes to control the Home/Away (EMS) virtual switch.

You would then add 2 scenes to actually set the thermostat to EMS and Normal, and to set the fan mode, based on the state of the virtual switch. In other words, the event for the scene is ‘[tt]a device is turned on or off[/tt]’ (1 scene for on, 1 scene for off). You then pick the appropriate commands for the thermostat.

So:
The event of entering the PIN code triggers the scenes to turn the virtual switch on or off.
The event of the virtual switch turning on or off is used to trigger the scenes to control the thermostat.

No Luup required, other than for the scenes that control the setpoints, so they don’t run when away (i.e. in EMS).

It should respond ‘instantly’. There’s no polling involved.

update:
I have used the EMS scene for two days and it varies in results
Sometimes it works as written, EMS runs okay or Normal runs okay -but more times than not, the GUI shows the thermostat as running in NORMAL but the thermostat it’s self shows that it is turned off.
When I run the Normal scene, it will turn back on, GUI says that it is in Normal, but the thermostat shows that it is runnning as EMS mode.
When I manually click on the Normal scene, the GUI says the transmit is okay, yet the thermostat never changes.
Why is there so much flakiness?

oTi@
I have two new scenes, - One is EMS mode and I chose the Device, “EMS 53”
Type of Event "Device Turned On/Off
Named the Event “EMS On”
and then chose “On”
I then put this code in the Luup section of the EMS scene
local EMS = 53
local EMSStatus = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”, “Status”, EMS)
if (EMSStatus == “1”) then
return false
end
return true

In the Command section, I set the Trane to energy and the approaite settings “Fan = Auto”

Now, when I setup the scene for “Normal”
what settings do I use so as not to change my -4- scenes that I already have set up??

oTi@
When I triggered the EMS switch “ON” the Trane did not change to Energy mode and the FAN did not switch to AUTO.
The EMS scene is based on the EVENT, EMS “On”
I tried clicking the “RUN” button on the EMS scene and changing the EMS switch “Off” as well. The thermostat did not respond
Do I need to do a power off and on , with Vera?

guessed & oTi@
SUCCESS!, It worked the second time I tried it. Vera must have needed a little time to “SORT?”
I still need to know if I need the “Normal” scene if I am already using -4- differant daily thermostat scenes,
I have the Normal scene setings as AUTO as Un Change, and Leave It
In this setting, the Trane won’t change until the next scene triggers a change (ergo, 10:00 PM))

THANKS !!!

Answered my own question , yes, I need to set the Normal scene settings to a generic Heat and or Cool settings range, (Trigger is: an event = a certain pin code is entered.)
Then when the Virtual switch is turned off, the Normal scene will run with generic settings and when the next scheduled scene runs it will return the HVAC system to my preffered settings.

That way, the HVAC system will be recovering to what is close to a NORMAL range, and it will refine it with the next scheduled scene - Right??
P.S. MANY HUGE THANKS!!!

@RastusB2,

Not sure if all is well now / what you did with the code posted above.

As said, I don’t think you need any code, except the following line that you would put in your (4) scenes to control set points:

return (luup.variable_get("urn:upnp-org:serviceId:SwitchPower1","Status",<devID>) == "1")

It prevents the set point changes from happening when in ESM.

@RastusB2,

Could you remove the code from both scenes, then test it?

oTi@
Thanks for the help,
I can see where the Luup code states that if the virtual switch is on, run the power scheme #1 (EMS)
Also, if the virtual switch is off, run power scheme #0 (Normal, Run)
This Luup code does keep the EMS cycle on, and ignores my daily scenes.
and when turning the EMS off, it therefore allows the next schedule scene to run.
This is how I see it.

Problem is, in my DASHBOARD, I have two commands in my Virtual Switch / settings.
Command #1, turn on the VIRTUAL SWITCH
Command #2, turn on Outlet #3 - Device ID #3,
When I check the Dashboard, the Virtual switch is on but the Outlet is not on .
How can that be??

Can you post the Luup code that you are currently using, and in which scenes?

Sure,
I have this Luup in -4- weekly scenes and -4- week end scenes and no where else.
Something is triggering my virtual switch to “ON” and is not turning “ON”, the outlet that I use as a visual lamp cue.
and if it were the Away scene or Home scene, commands #1 & #2 would turn ON/OFF the virtual switch & the outlet.
If you click run on either of the EMS or Home scenes, in the HVAC room, everyting runs correctly, meaning, the thermostat will respond correctly, triggering the EMS scene or Normal - Run scene, accordingly

local ESM=luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”,“Status”,53)

if (ESM == “1”) then
luup.variable_set(“urn:upnp-org:serviceId:SwitchPower1”,“Status”,0,53)
else
luup.variable_set(“urn:upnp-org:serviceId:SwitchPower1”,“Status”,1,53)
return false
end
return true

That is not the right code; and that code is not right. :slight_smile:

As said earlier, try this:

return (luup.variable_get("urn:upnp-org:serviceId:SwitchPower1","Status",<devID>) == "1")

It prevents the set point changes from happening when in ESM.

is the [tt]Device #[/tt] of your thermostat.

oTi@
Thanks for the new code.
To clarify a few things (MUCH tinkering here)
Originally, I did have the code in the two scenes, EMS & NORMAL, in the begining.
It didn’t belong there, it should have been in my -4- DAILY set point scenes.

I will insert your code in the -4- DAILY scenes, and give it a go. :-*

return (luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”,“Status”,53) == “1”)

EDIT:
After inserting the one line of code, I entered the PIN code in the Shlage Door Lock and it triggered the AWAY scene, which fired the EMS virtual switch, & Outlet/Lamp - ON.
Then Virtual light being ON, then triggered the EMS scene which changed the Trane Thermostat setpoints to the EMS settings Heat 60, Cool 80 & FAN - Auto.
The DASHBOARD GUI did show the correct EMS mode and correct settings.
When the next DAILY scheduled scene ran, the Virtual EMS #53 stay on and the Outlet #7 stayed on, but the Trane Thermostat ran the setpoints for that DAILY scene; Normal Run. Heat 65, Cool 75, FAN ON.
The thermostat on the wall did change from EMS mode to Normal, Run mode, as well.

The DASHBOARD GUI does show that it swtiched back to Normal Run mode as well.
In simple terms, the virtual switch being on did not prevent a Daily scene from switching the Trane back to Normal Run

Update:
I have created a new Virtual Switch called AWAY and use the following code:

local away
away = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”,“Status”,54)
if(away==“1”)then
return false
end
To control various lights so I can create Away scenes.

I then used a variant of that code to control my thermostat scenes:
local EMS
EMS = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”,“Status”,53)
if(EMS==“1”)then
return false
end

AND all works correctly now, Thanks to all who were good enought to help me sort this out

THANKS!!

It seems that the SwitchPower1 service variable Status is not “in sync” with the actual thermostat state if one changes it using the physical thermostat controls. Does anyone know how to resolve this issue (i.e. re-sync the variable with the actual thermostat state)?

For example:

Issue the following code to read the ESM state using the Test LUUP Code widget under the MIOS Developers Tool and view the results in the /var/log/cmh/LuaUPnP.log.

        --Normal mode == 1, Energy mode == 0
        local lul_device=3
	luup.log("ESM value = " .. luup.variable_get("urn:upnp-org:serviceId:SwitchPower1","Status",lul_device))

Now go to the thermostat and change the ESM state to the opposite of the current state and re-run the code above. You will notice that the ESM variable did not change to the new value (either 0 or 1). The ESM state must be cached by the HVAC Plugin so unless you set the state using the lump.call_action() for the SwitchPower1 service, queries with luup.variable_get() will fail to retrieve the actual status. Anyone know how to work around this limitation? Is this a bug in the plug-in or just the way plugins work?

Back to the original theme of this thread…As a newbie, the discussion has been very educational. This thread seems most similar to my scenario. I have a vacation home in which I want to control two thermostats. I have successfully installed the vera2 and have connected one Honeywell TH8320ZW1000 (I’ll do the other one later). I have registered my MIOS account and have basic control. My goal is to be able to switch between “Home” and “Away” scenarios. I have the Tstat programmed internally the way I want using a daily schedule. I would like to be able to activate this schedule when “Home” and set the Tstat to “Hold” when away. This was achieved trivially with my old Tstat using “Run” vs. “Hold” (manually of course). It seems like I should be able to achieve my goal by toggling between “Normal” operation and Energy saving mode. I can program an “Energy Saving Setpoint” directly on the Tstat. Then in the UI4 “Control” tab it seems like I should be able to select “Normal” or “Energy Saving” to toggle between the Tstat’s internal heating schedule and the energy saving setpoint.

Lastly, I have a gripe that the dashboard does not provide any clear way to see if the Tstat is in Normal or Energy saving operation. I can set an alert to email me when the mode changes but that seems like a hassle when I should be able to see the mode indicated somewhere on the dashboard.

Feedback is welcome and I look forward to hearing if I am on or off the right track.

jwalenta;
Hope I don’t confuse you with these details, but here goes:)
I started with a VIRTUAL SWITCH (search on this forum)
After I had created my virtual switch, I named it EMS (energy Management System)
I triggered it by entering a certain pin code (Away), via my SCHLAGE door lock.
Then I created a scene that depended of the conditions of my VIRTUAL SWITCH’s conditions
and named it AWAY
In this scene, you set the COMMAND’s in the Command’s TAB for the thermostat’s set points as EMS ( You can set the temp points, fan ON or AUTO)
then set in the the EVENT’s tab as: Named EMS - ON
click on edit; set the parameter’s as;
DEVICE = # 53 DEVICE; (use your Virtual Device’s #)
WHAT IS THE TRIGGER FOR THIS EVENT? = A device is turned on;
NAME FOR THIS EVENT = EMS Mode, on;
Click on SAVE

Then, create your daily thermostat scenes (EGO: 7:00 AM. 10:00 AM, 3:00 PM, 10:00 PM) and their set points (Mode: NORMAL - RUN, FAN - Auto)
Add this LUUP in EACH of those daily Normal run scenes

local EMS
EMS = luup.variable_get(“urn:upnp-org:serviceId:SwitchPower1”,“Status”,53)
if(EMS==“1”)then
return false
end

click save after creating each scene.

This Luup code looks to see if the EMS virtual switch is on or off. If it is on, then run the EMS scene, if off, then continue to run the daily Normal scenes

Then create one more thermostat scene and Name it EMS
In this EMS scene, create your preferred heating and cooling set points and save.

Now, when you turn on your EMS switch, it will switch your set points to the Engery Savings Mode settings.
To go back to your NORMAL - Run settings, you will need to create a scene and call it Normal - On
Follow the same instructions to set the COMMANDS: Device #53, EMS, Off
and the EVENTS as; A Device is Triggered, Off
and Name it EMS, Off (same as above but now you want it to be OFF settings)
Click on Save.

I use another certain Pin Code, in my SCHLAGE door to to turn OFF the EMS Virtual Switch
(my HOME pin code)

I am sure that this will get you headed in the right direction and if you need answers, fire away, because the people on this site are amoung the best in providing help - Good Luck

First of all thanks for the prompt detailed reply. I have to assume with your (and other’s in this thread) level of experience that your approach seems easy/straightforward. Having laid my hands on my first z-wave devices about 48 hours ago, it seems fairly intimidating. Nevertheless, I think I have achieved my desired goal in a FAR easier fashion (for me). Keep in mind this has not been entirely sorted under varying conditions yet but so far it seems to work exactly as desired. Here goes…

As previously stated, I simply entered the desired 7 day program directly into my Tstat. I then accessed the installer menu directly on the Tstat and enter 50 degrees for the Energy Saving Setpoint (a value available in my Honeywell Tstat). Now all I have to do from MIOS is toggle between ESM and Normal operation. When in ESM the Tstat effectively goes into permanent hold at 50 degrees. When in Normal operation the schedule programmed into the Tstat is followed.

Again I have yet to test this under extended real world conditions but my simulation over the last 48 hrs seems to indicate success. I am happy to hear a critique of my method especially anything I may have overlooked.