Scheduling override with guest mode via virtual switch

I have a 2 zone system with 2 trane thermostats. I have created a virtual switch to trigger 4 different scenes (morning, day, evening, night) that set different setpoints for each zone depending on the time of day. The virtual switch being on is the trigger.

My thermostats are set up to use the internal schedule and are kept in “run” mode.

My thoughts were that I could set up the normal schedule via the internal schedule and use the virtual switch to override the settings when I had a guest. When the guest leaves (they usually stay a few days), then I would turn off the virtual switch and allow the internal schedule of the thermostats to take over.

I am currently testing this, but it seems that the schedules are invoked only at the actual operation of turning on the virtual switch. For example, I turn the switch on at 3:00pm and the evening mode invokes at 4:00pm. Will the next scene (night) invoke at 11:00pm if the switch is left on or do I need to toggle the switch again?

If my logic is wrong, or the system just won’t behave in this way…what can I do to make this work?

I have read the trane scheduling threads and that is how I got to where I am now.

Am I correct in assuming that the virtual switch performs a momentary action, not a sustained one. For example, if I have 4 scenes that need the virtual switch to be in a state of “on” as a trigger and these scenes are scheduled by time of day, will each scene run when it’s scheduled time comes if the switch is in a state of “on” or do the scenes only run one time during the switching of the virtual switch to “on.” To clarify, the scene is scheduled at 6:00pm and I turn the switch on at 3:00pm. Will the scene run at 6:00pm (with the switch still on) and at 6:00pm the next day (with the switch staying on)?

If you set up the virtual switch as a trigger, all 4 scenes will fire the moment you flip the switch. You’ll have to write some Lua code to achieve this, or perhaps use the PLEG plugin to add this conditional logic.

I have a similar arrangement: home, away, and night. The night scene will turn down the heat in the guest room and living room (also used for guests sometimes), unless the “guest” switch for either room is set. This is a relatively simple bit of Lua code.