[DEPRECATED Thread: visit community.webcore.co for assistance] webCoRE - Piston Design Help (ask your fellow members for assistance)

I went back today and added some waits and refined as well as minimized my use of loops.

Where loops remain are to satisfy one of the main requirements I have for the system to survive. That is providing a reliable way to provide access to the house for my children and to have extraordinary low (read: No) alarms going off as a result of their access to the house.

People talk about WAF alot… eh… these are adults that can be reasoned with and can accept the world for what it is - imperfect (after all they married us, eh?)… but the kids, not so much. They need in when they need in and can’t be scared by alarms going off so these things must work in my house.

So here is an example of where I have a loop that remains to ensure such entries have minimal chance of not being successful:

You could have gotten away with a for loop for that last with block :smiley:

1 Like

Oh sure, come in and try to make me add loops now … nice try ady… (but good point)

Is it possible to store a phone number in a variable? I’m trying to select a phone number to send an SMS message to using a ternary operator (i.e. [condition] ? [phone number variable 1] : [phone number variable 2]). I don’t know if this is possible and I’m just doing something wrong or if it is beyond the capabilities of the script.

Yes, you can store a number in a string variable and set it to an expression with that ternary operator - you can also use the ternary operator in an expression directly in the Send SMS task, therefore not needing a variable, up to you. In the Send SMS, select the field type for the Phone number, change it from Value to Expression or Variable, depending on which route you go.

Thanks for the quick reply ady. I’m using variables for the numbers so I don’t have to hardcode the numbers and to make changing them in the future easier. I’ve tried using as a string with the format 123-456-7890 and 1234567890, neither seemed to work. I’ll play around with it some more tonight. If I can’t get it to work I’ll post the piston and see if we can figure it out.

I have what I believe is a very simple statement that when 30 mins to sunset, start fading on all lights over the next 30 mins. For whatever reason, it never works…I think it has to due with the 30 mins…does anyone have any ideas on or piston they use to do the same exact thing?

I have asked this question here a few times and would really love to get it working.

You need to enable logs and try figuring out what happens (i.e. if there are any commands sent, or at least if the piston gets rescheduled every so often)

“Lights Schedule sent setLevel command to xxxxxx”…that same command is repeated 6 times after the light is turned on and set to 1%.

I follow this action with if any of these lights are not on 100% at sunset, fade them on to 100% over 15 seconds and it works just fine.

I missed the logs in webcore…the above log is from the device itself.

I just tested it with two lights and it works - every about 18 seconds it drops the lights 1%…

You’d need to adjust the trigger time…

Well, what level are the lights at when the fade starts? That’s where it starts and goes down to 0%…

Then I can’t really help if you only provide bits of pistons with no logs - plus, you seem to fade them down, but then up?! Point being?

UPDATE: oh, you’re fading them up in 30 min and then again in 15s at sunset, to make sure they’re on?

right, and the ‘at sunset’ check works and fades them on without issue…its the 30 mins prior to sunset that does not work with fading them up. it seems to loop at 1% the entire 30 mins.

testing with my patio lights. If level was 99 (light off), the light just turned on at 99% then got set up to move to 100% in 30min. If light is at 0% and turned off, the ramp up started, every 18s 1% up - one thing to note though, depending on your bulb/dimmer, 1% may not be visible at all - I have LED lights with a GE dimmer, currently at 6% (and going up 1% every 18s) - lights are technically off - I think they start looking “on” at about 10%… so depending on your setup, low percentages may actually look as if the light was off - this is not a bug.

UPDATE: my lights slightly turned on at 10%. They seemed OFF at 9% and there is quite a difference between 10 and 12%… these are 21W Philips LED A21 19W 451906 100W-equivalent lights on a GE 12724 dimmer.

Im dealing with hues and lightify strips…so you think telling it to fade on…when lights are currently off at 0% is the problem?
So in the next condition at sunset…the lights are all stuck at 1%…they fade on to 100% in 15 secs without issue

Hue lights conmected through hue hub? Perhaps you have an issue with level updates from the hue hub? Try specifying the starting level, see if that works better - I can test with hue bulbs too but mine are all connected directly to ST. My hue hub is in the dust collecting business :wink:

Jeff,

I have a global variable for me and my wife’s cell phones and it works fine for me on several of my pistons. I use the Global variables as much as possible, it’ll save you a lot of time especially if you have multiple pistons with SMS notifications.

Here’s how it’s formatted on mine:

Make sure phone number is formatted as this: XXX-XXX-XXXX

Here’s an example of setting up the SMS Notification:

1 Like

Thank you for the heads up on the formatting. After some further investigation I believe it is the switches in my piston that are not firing. switch $currentEventDevice case (Variable1 || Variable2) case (Variable3 || Variable4)

The piston is based off of @c1arkbar 's Magic Home piston in the webCore examples (may have bitten off more than I can chew for a first piston) and modified for roommates.

1 Like

Do you have any logs to go with this? Enable full logging for this so we can see what is and isnt going on.

Here is the last log of when someone arrived. On my trace, the switch for arrival is condition #9 and I don’t see where it is being evaluated at all.

+2ms ╔Received event [Walter].presence = present with a delay of 129ms
+682ms ║RunTime Analysis CS > 343ms > PS > 58ms > PE > 281ms > CE
+695ms ║Runtime (67737 bytes) successfully initialized in 58ms (v0.2.0d1.20170708) (693ms)
+697ms ║╔Execution stage started
+717ms ║║Comparison on is on = true (3ms)
+720ms ║║Condition #46 evaluated true (13ms)
+721ms ║║Condition group #null evaluated true (state did not change) (16ms)
+755ms ║║Comparison present changes_to present = true (1ms)
+759ms ║║Cancelling condition #17’s schedules…
+760ms ║║Condition #17 evaluated true (35ms)
+804ms ║║Comparison present was_not present = true (34ms)
+806ms ║║Cancelling condition #18’s schedules…
+808ms ║║Condition #18 evaluated true (46ms)
+809ms ║║Cancelling condition #1’s schedules…
+810ms ║║Condition group #1 evaluated true (state changed) (85ms)
+814ms ║║Cancelling statement #2’s schedules…
+828ms ║║Calculating (string) Welcome home + (string) Walter >> (string) Welcome home Walter
+832ms ║║Calculating (string) Welcome home Walter + (string) . >> (string) Welcome home Walter.
+841ms ║║Executed virtual command setVariable (4ms)
+858ms ║║Comparison off is_not off = false (4ms)
+861ms ║║Condition #8 evaluated false (12ms)
+862ms ║║Condition group #4 evaluated false (state did not change) (15ms)
+868ms ║║Evaluating switch with values [[i:9:null:0, v:[t:device, v:[:5a325efaeab8b305e5a16ae8e428db7f:], vt:string]]]
+878ms ║║Calculating (boolean) true || (boolean) true >> (boolean) true
+884ms ║║Comparison [:5a325efaeab8b305e5a16ae8e428db7f:] is true = false (3ms)
+894ms ║║Calculating (boolean) true || (boolean) true >> (boolean) true
+900ms ║║Comparison [:5a325efaeab8b305e5a16ae8e428db7f:] is true = false (3ms)
+912ms ║║Comparison :3f49a3d8eda76c49aaab51a327648369: is_not_any_of :3f49a3d8eda76c49aaab51a327648369:,:bdcc481a22936bcf2c587edf06433b31:,:2c1317d1eb19d7387e9dac468150ca0d:,:bebcfae0564eb80c18cc75fe9305e160:,:27e3e9d7ef1c7595f86f8c222e90334c: = false (4ms)
+915ms ║║Condition #60 evaluated false (9ms)
+916ms ║║Condition group #47 evaluated false (state did not change) (12ms)
+951ms ║║Comparison present changes_to not present = false (1ms)
+955ms ║║Condition #84 evaluated false (33ms)
+957ms ║║Condition group #83 evaluated false (state did not change) (35ms)
+969ms ║║Comparison false is true = false (3ms)
+971ms ║║Condition #140 evaluated false (9ms)
+973ms ║║Condition group #136 evaluated false (state did not change) (12ms)
+1260ms ║╚Execution stage complete. (564ms)
+1324ms ╚Event processed successfully (1324ms)
[/quote]