1) Give a description of the problem
I’m trying to use a virtual switch to turn on/off a group of devices. I started with a ST scene to turn on all of my lights and a separate theme to turn off all of my lights. However, this was flawed because the family doesn’t like to say “Alexa, turn on all outdoor lights off”. After some research, I saw this great thread on how to setup a virtual switch with either a 2nd virtual switch or global variable. This virtual switch could be turned on/off from Alexa in a more natural manner.
When I went to put these pistons in place, I noticed a new(?) feature of only evaluating an if statement if it is based on a “programatic interaction” vs a “physical interaction”. I thought that this might be a slick way of replacing the “hold” switch in the aforementioned thread, but I’m not successful in getting it to work. I couldn’t find any documentation so I made my best guesses on how it should be functioning.
2) What is the expected behavior?
a) Setup a sequence that updates the virtual “Switch 9” if any of the devices I want in my group turn on or all of them turn off. This might be part of the confusion, but instead of using “Turn on” or “Turn off” I thought using the “emulated Set Switch…” to on. So first question is should this later result in a “programatic interaction” vs a physical one? If not, how can I make this a programmatic approach?
b) Setup the piston that will execute if button is pressed directly or this is changed via Alexa (is Alexa turning on a device considered a programmatic interaction? This could be a flaw in my thinking.)
3) What is happening/not happening?
Irregardless of Alexa interactions (I haven’t gotten that far yet), when I turn on any of the individual switches (2, 1, 5, 3 or 4), it turns on the virtual Switch 9 which then turns all of the other switches on.
The following works:
Turning off one switch (with many on) will keep the virtual switch on.
Turning off all the switches will turn off the virtual switch.
Turning on/off the virtual switch will correctly turn on/all off the real switches.
**4) Post a Green Snapshot
Pasted above.
5) Attach any logs (From ST IDE and by turning logging level to Full)
(PASTE YOUR LOGS HERE BETWEEN THE MARKS THEN HIGHLIGHT ALL OF THE LOGS SND CLICK ON THE </> ICON TO FORMAT THEM)
These are the relevant logs for turning on one switch and the rest coming on:
-a493f64c1cb6 9:44:31 PM: info postEventToEndpoint: event successfully posted.
-a493f64c1cb6 9:44:31 PM: debug Property Change Event switch: on (source: DEVICE)
-a493f64c1cb6 9:44:29 PM: info postEventToEndpoint: event successfully posted.
-a493f64c1cb6 9:44:29 PM: debug Property Change Event switch: on (source: DEVICE)
-6d1d5e1b52e0 9:44:29 PM: debug 60019475560F-switch1 - name: switch, value: on
-6d1d5e1b52e0 9:44:29 PM: debug Parsing: switch1 on
-6d1d5e1b52e0 9:44:29 PM: debug Parsing: switch1 on
-a493f64c1cb6 9:44:29 PM: info postEventToEndpoint: event successfully posted.
-a493f64c1cb6 9:44:29 PM: debug Property Change Event switch: on (source: DEVICE)
-bb0e7cca3d83 9:44:29 PM: debug 2C3AE843AC62-switch1 - name: switch, value: on
-bb0e7cca3d83 9:44:29 PM: debug Parsing: switch1 on
-bb0e7cca3d83 9:44:29 PM: debug Parsing: switch1 on
-fd033976e53f 9:44:28 PM: debug ║║ Executed physical command [Garage And Driveway Relay].on() (22ms)
-fd033976e53f 9:44:28 PM: debug ║║ Executed physical command [Pool (PATH LIGHTS)].on() (28ms)
-fd033976e53f 9:44:28 PM: trace ║║ Executed [Deck Lights].on (17ms)
-fd033976e53f 9:44:28 PM: debug ║║ Executed physical command [Kitchen Outdoor Lights].on() (23ms)
-fd033976e53f 9:44:28 PM: trace ║║ Executed [Garage And Driveway Relay].on (24ms)
-fd033976e53f 9:44:28 PM: debug ║║ Executed physical command [Deck Lights].on() (16ms)
-fd033976e53f 9:44:28 PM: trace ║║ Executed [All Outdoor Lights].on (2ms)
-fd033976e53f 9:44:28 PM: debug ║║ Condition group #1 evaluated true (state changed) (8ms)
-fd033976e53f 9:44:28 PM: debug ║║ Skipped execution of physical command [All Outdoor Lights].on([]) because it would make no change to the device. (0ms)
-fd033976e53f 9:44:28 PM: debug ║║ Cancelling statement #6's schedules...
-fd033976e53f 9:44:28 PM: debug ║║ Cancelling condition #1's schedules...
-fd033976e53f 9:44:28 PM: debug ║║ Condition #8 evaluated true (5ms)
-fd033976e53f 9:44:28 PM: debug ║║ Cancelling condition #8's schedules...
-fd033976e53f 9:44:28 PM: debug ║║ Comparison (enum) on changes_to (string) on = true (1ms)
-fd033976e53f 9:44:28 PM: trace ║╚ Execution stage started
-fd033976e53f 9:44:28 PM: trace ║ Runtime (37355 bytes) successfully initialized in 34ms (v0.3.000.20180224) (113ms)
-fd033976e53f 9:44:28 PM: debug ║ RunTime Analysis CS > 15ms > PS > 34ms > PE > 63ms > CE
-fd033976e53f 9:44:28 PM: info ╚ Received event [All Outdoor Lights].switch = on with a delay of 51ms
-8d6164414287 9:44:28 PM: info SEND http://0B0B0BAA:0BB8/circuit/9/set/1
-8d6164414287 9:44:28 PM: debug Executing 'set(9, 1)'
-6d1d5e1b52e0 9:44:28 PM: debug Using ip: 11.11.11.72 and port: 8090 for device: 3885e2ce-f9e4-4669-81d6-6d1d5e1b52e0
-6d1d5e1b52e0 9:44:28 PM: debug Executing 'sendEthernet' switch1 on
-6d1d5e1b52e0 9:44:28 PM: debug childOn(60019475560F-switch1), name = switch1
-bb0e7cca3d83 9:44:28 PM: debug Using ip: 11.11.11.71 and port: 8090 for device: -bb0e7cca3d83
-bb0e7cca3d83 9:44:28 PM: debug Executing 'sendEthernet' switch1 on
-a688-019c5c1f01cb 9:44:18 PM: debug Executing 'resubscribe()'
9:44:11 PM: info Waiting on events...
9:44:11 PM: info For past logs for individual things go to the My Devices section, find the device and click on the Events link on the device information page.
9:44:11 PM: info This console provides live logging of your SmartThings.