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

Did some testing. It works with and without the quotes. So I guess either way is acceptable.

You’re over thinking it.
In webCoRE if you put in sunset to sunrise, that is what it will do.

See this post:

I am using send email with subject “Report” to xxx@xxx.com; Inside send email I send a variable with a list of events that occurred in the last hour (Message body value = {@recentChanges}. That all works as expected. The email looks like: event 1 @ 7/24/2017, 6:49:00 AM; event 2 @ 7/24/2017 6:49:00 AM,event 3 @ 7/24/2017, 6:49:00 AM, and so on. This works but I would like to put a new line between each event so it looks like:
event 1 @ 7/24/2017, 6:49:00 AM;
event 2 @ 7/24/2017; 6:49:00 AM,
event 3 @ 7/24/2017, 6:49:00 AM

I have tried several things a while back and could not get the desired results.

Any ideas?

FYI: Sorry did not post complete source, the anonymized snap shot included my email and other things.

Did you try \r and or \n

I tried before with no luck. Just to be sure, I retried tried several combinations again with no luck. string(“this is a test. \n this is line 2 \r this is line 3 \n\r this is line 4”).

I looked in functions and did not find anyway to convert from ordinal to string or a line.separator function.

Looking for some help…I’m trying to setup a mood cube colour global variable and then control a light with those values. The colour is working great and the global variable is being set correctly but the light is turning on and off three times. I’ve played with a mixture of only executing on piston state change with no luck. I’ve also tried the Wait three seconds to see if that helps…here is the piston:
I’m using the colour global variable in other pistons as I change my lighting colour when starting a movie on Harmony to this colour.

What kind of bulb is it? Usually when a bulb turns on and off 3 times, it’s because it is resetting.

It’s a LIFX Colour 1000. The behaviour is quite consistent, it’s as if the orientation change is being registered three times and therefore the piston executes three times…the log doesn’t seem to show it running three times hence my confusion.

I have a welcome home piston I created for when we both arrive home together I created that ran today when It shouldn’t have and I don’t know why unfortunately I didn’t have logs on but maybe someone can help speculate on why it ran.

here is the scenario this morning the wife just arrived home after doing groceries, I was already home from since the day before and never left my home area. she came in through the back and her personal welcome home message ran which is set up on a separate piston. she went back out to the driveway closed the door behind her to get more groceries out of the car and when she came back in again and closed the door behind her our welcome home together messaged played.

the way designed the piston its only supposed to run if one of our presence changes to present and the other has only been present for 2 minutes or less. here is the piston can anyone take a look and tell me what happened.

LIFX are wifi connected, so there’s some dependence on your router and their cloud. However, instead of turning the bulbs off and on, you could turn the brightness all the way up and down. That way the bulb stays always connected.

Otherwise it sounds almost like power is being cut from the bulb each time, even though you’re automating the bulb and not a switch/outlet the bulb is on. I have the A19 bulbs, so the color 1000 might be different.

1 Like

If you are going to divide the age by 1000 then you should not be comparing to 120000. That will always be true.

So what probably happened is one of your phone’s presence dropped out and when it came back your expression probably evaluated the age as 17000 / 1000 = 17 seconds. Is 17 less than 120000 = true.

Ok, here we go. This piston DOES NOT work. Note, I switched the time to before sunset to test

Here is the full log:


Here is a piston that DOES work:

Here is the full log:

when you say one of our phones dropped out does that mean went away and then came back to present or does that mean lost service and than came back to service. if its the second then that’s entirely possible because her phone could of connected to our home wifi when she walked in with the first batch of groceries and when she went back out to get the second batch I could of switched over to 4g data. I’m not entirely quite sure how that plays a role on the pistons purpose though

So what does {{age([Ronald’s iPhone : presence])} / 1000} mean exactly. I thought it meant the age of my phones presences being present.

secondly I wanted the time to be 2 minutes because the other day we came off the train walked home together but the welcome home together piston didn’t play when I checked the history it showed there was a 1 minute gap between when my phone showed I was present and when her phone showed it was present. originally it was written to only give a 10 second age gap but I figured it wasn’t enough so I upped it to 120000.

Can you tell me how to keep the 2 mins but write it correctly so it will not always be true?

I’ll have to go back and have a look, but… It did not work. Today, I left with the wife in the car, so basically we all went no present around the same time. I got a text message saying to lock the doors. So something was off. No worries if you don’t feel like helping, its honestly a rare situation that my wife would take the car when I’m home.

I went back and had a closer look. My car was reporting away one minute before my wife and I which seemed to cause the logic to fail. I went back and changed to car to report away one minute later than my wife and I and it seems to be working perfectly. Thanks again!

i do feel like helping. :slight_smile: let me simulate that scenario and get back to you.

thank you for asking.

I went back and had a closer look. My car was reporting away one minute before my wife and I which seemed to cause the logic to fail. I went back and changed to car to report away one minute later than my wife and I and it seems to be working perfectly. Thanks again!

So your gps might have jumped around. So nothing with the wifi. It’s a common problem with ST.

Now your expression is doing what you want it to do. But you are doing the math wrong. When you divide the age([device:attribute]) / 1000 you are getting the result in seconds.

You are then comparing the seconds to milliseconds.

So that is why you are not getting the results you are expecting.

So you can either remove the “/ 1000” OR change the 120000 to 120.

Basically you are comparing seconds to being less than 33 hours

o nice. if you dont mind my asking how are you able to set it so your car reports away one minute before your wife? is there some setting in your car presence sensor that allows that?

thanks.

Thanks for the reply…I’ve shifted to using the built in LIFX integration and it transitions much better. Not sure why the pulsing/turning on and off was happening but seems by using the direct integration the problem has gone. I’ve also reverted to being able to use the colour global variable instead of having to program each orientation/colour:


Thanks again!

2 Likes