The Vera Community forums have moved!

Advanced => Programming => Scene Scripting => Topic started by: drawbars on April 09, 2018, 12:58:10 pm

Title: Scene Programming with two Veras and CT101
Post by: drawbars on April 09, 2018, 12:58:10 pm
Hi All,

Like many in New England, we live in an 'expanded Cape' house:  a box-shaped home that has had additions in several directions over the years, adding length, walls, and corners to the Z Wave mess.  When I upgraded from a Vera Edge to a Vera Plus, I decided to keep the second controller and set it up as a slave/repeater to handle the far end of the house.  I've also got the MCV system tied to my Amazon Echo, so that I can turn on lights, lock doors, ets. with verbal commands.

--------        --------           --------                -------------                   -------------
| AZN  |        | AZN  |           | AZN  |                | Vera Plus |--- Device         | Vera Edge |--- CT101
| Echo |        | Echo |           | Echo |                |           |--- Device         |           |--- Device

|  #1  |        |  #2  |    ...    |  #n  |                | (Master)  |--- Device         |  (Slave)  |--- Device
|      |        |      |           |      |                |           |--- Etc.           |           |--- Etc.
--------        --------           --------                -------------                   -------------
   :               :                  :      ----------          |                               |
   .................... Wireless ............| Router |=================== HOME NETWORK ==========

With me so far?   ???

Almost everything works fine, with a few little wrinkles:

The problem that I'm having is that I'm finding that the CT101 is ignoring Scenes that change the temperature throughout the day.  No Device Not Connected messages are reported, and the Scene reports that it has executed.  But the thermostat is still sitting at the old temperature.  If I use UI7 (or the CT101's touch panel) to change the setting  it always works -- instantly.

Anybody seen this kind of problem before?  I've written all my Scenes on the master Vera for convenience, but would it be better to code them on the slave device, using the slave IDs?

Title: Re: Scene Programming with two Veras and CT101
Post by: drawbars on April 12, 2018, 07:58:21 am
I figured out what is going on.  My problem wasn't related to using two Veras; nor to Amazon Echo control; nor to the choice of a master/slave control ID.  It has to do with the response of the CT101 to back-to-back commands.  Since the solution doesn't appear anywhere in the MCV/Vera support system, nor in the RTCOA support documents, I thought I'd post it here.

When creating a Scene step that involves a thermostat, one can choose to select a mode (Heat, Cool, etc.) and a temperature.  To prevent possible mistakes, I define both, so I was choosing (for example) 'Heat + 65 degrees.'  That's actually two commands sent to the CT101, and it seems that only the first one gets accepted, unless there is a delay before the 2nd command.

When I changed the CT101 from battery to "C wire" (24VAC) operation, I had to remove and re-pair it; this resulted in a new ID for the device.  So, I had to edit all of my HVAC Scenes to change the thermostat ID.  Of course, 'edit' is a loose term in UI7, as one cannot directly change variables/devices in a Scene; instead, one must go through the creation steps again.  Apparently, my old Scenes chose the temperature first, while the new ones choose the mode first.  Well, '65 degrees + Heat' and 'Heat + 65 degrees' aren't the same thing in this case.  If the temperature is set first, the CT101 may fail to see the 'change' to Heat; but if it is already in Heat mode, the error is moot.  If the temperature change is 2nd and missed, the problem is more serious.  Z-Wave is a slow, delay-filled communication process, so any 2nd message might get delayed enough to make it through -- or not.   >:(  This led to many false 'fixes' to the problem in my complicated setup.

I played around with delays, and it seems that the CT101 is happy if the two commands are separated by 5-10 sec.  So, I changed all my scenes to something like this.  [The following is pseudo-code to mimic UI7, not LUUP or any other language.] --

    scene (Heat The House At Night) {
        at (5:00:00PM) send a message of "Heat" to the Thermostat;
        at (5:00:15PM) send a message of "68 degrees" to the Thermostat;

Yes, it means that the furnace starts up at 5:00:15, but that's a minor delay compared to how long it takes to heat a house.  I suppose I could program the Scene to trigger at 4:59:45 if it really mattered.   ::)