Trouble activating a piston on a different hub


#1

1) Give a description of the problem
I have 2 hubs, same Smartthings Account (Samsung Login), 2 locations. I am trying to create a master virtual light in each room that the 2nd hub serves so I can still use Google Assistant / Google Home to provide voice control. When the pistons (Master and Slave) live on the same hub, with all devices local, everything works. Once I place the master on the primary hub, and the slave on the secondary, the secondary fails to activate.

2) What is the expected behaviour?
When I turn on, change level, or color of a physical bulb OR virtual bulb on the master piston, the slave piston will reflect that change on all of the listed devices.

3) What is happening/not happening?
2nd piston fails to fire at all

4) Post a Green Snapshot of the piston!

5) Attach logs after turning logging level to Full
1/9/2020, 10:15:04 PM +789ms
+2ms ╔Received event [LGT Guest Room Desk Lamp].switch = off with a delay of 1117ms
+114ms ║RunTime Analysis CS > 19ms > PS > 77ms > PE > 18ms > CE
+117ms ║Runtime (40448 bytes) successfully initialized in 77ms (v0.3.110.20191009) (114ms)
+117ms ║╔Execution stage started
+125ms ║║Comparison (enum) off changes = true (1ms)
+126ms ║║Cancelling condition #10’s schedules…
+127ms ║║Condition #10 evaluated true (6ms)
+128ms ║║Cancelling condition #9’s schedules…
+129ms ║║Condition group #9 evaluated true (state changed) (8ms)
+136ms ║║Comparison (enum) off is (string) on = false (1ms)
+138ms ║║Cancelling condition #12’s schedules…
+139ms ║║Condition #12 evaluated false (7ms)
+140ms ║║Cancelling condition #11’s schedules…
+140ms ║║Condition group #11 evaluated false (state changed) (9ms)
+143ms ║║Cancelling statement #13’s schedules…
+152ms ║║Executed virtual command [LGT Guest Room Desk Lamp].setVariable (2ms)
+170ms ║║Executed virtual command [LGT Guest Room Desk Lamp].executePiston (15ms)
+173ms ║╚Execution stage complete. (56ms)
+174ms ╚Event processed successfully (174ms)


#2

never tried 2 different hubs but I have some pistons that executes other pistons.
I’d say try getting rid of the IF in your slave piston. Line 36.
When you save your piston it will report that “This piston can not be executed bla bla bla”


#3

Others have raised a similar issue in the past and seem to have ended up avoiding the problem by calling the second piston using its external URL.

There was some comment that it ‘used to work’ and ‘something must have changed’. I’ve not delved into multiple locations but as executing a piston is implemented by either accessing a child piston (if waiting) or sending an event (not waiting) I am not sure how it could have worked. However I’ve never delved into multiple locations and hubs.


#4

Thanks ike for the advice, I can look at that recommendation to clean it up some more.

It is worth noting that when both are on the same hub, they work without issue, it is only when they are on different hubs that they can’t cross over and activate the slave


#5

Yeah, I have seen others raise the issue, but this seems to be an intended feature. I am wondering if there is a setting or a toggle that needs to be flipped on my account / hub / webcore app / piston that will allow an “external” reference to trigger it.

Using the web trigger / external URL just does not feel as clean / efficient, if cross hub references / calls are actually possible .

Looking @Robin in Can you use webcore to call a secondary st hub it sounds like this is a designed in feature. He called in ipaterson @ady624 and references another forum post Command execute piston not working where towards the end, Alwas indicates that he has been able to get an example working, but no working code posted.

It seems like this should be possible, but something about the function may be interrupted or failing due to the formatting /structure of the piston, but it is only appearing when it is cross hub…


#6

@ipaterson & @Alwas also referenced in above post


#7

Is below not any help?


#8

If I am reading the post you referenced correctly (communicating between 2 hubs…), it is a suggestion to perform a web trigger. In your prior posting in Command execute piston not working I read below as an indication that you had successfully executed a cross hub piston call without a web trigger. Did I misunderstand / misread this? Before I start building this out across my entire environment, I want to make sure that I building on a strong code that can be maintained.


#9

This is my Post Box piston as it is today, on my primary hub with no triggers…

On the second hub, close to the post box, if the contact sensor changes, another Instance of WebCoRE sends a Get request to the above piston with info if its open or closed, that updates/mimics a virtual switch I have in my ST app. As the second hub is on a different account, a neighbors, that I don’t use, clear as mud?

Piston on second hub.


#10

Cool, so I guess there is no evidence of anyone getting cross hub calls operational without a web call. :frowning:

With web calls, passing arguments is still possible, right?


#11

Yes. Here is a quick example.


#12

Thanks for the reference. Is passing multiple arguments possible?


#13

Yes, as seen below