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:
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)
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
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:
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.