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

@bangali the FOR loops are just to switch off all lights and virtual switches (the switches are my kill switches for each light or Automation so when evaluating if a light should go on or Automation should run, if the virtual switch is off, don’t turn on the light - great for parties when I have all the Hue bulbs flashing away in time with the music and don’t want movement in the room to overide the bulbs flashing and just go on due to motion) when leaving the house otherwise the dog walking around when we aren’t there in the evening triggers lights coming on. The loops also switch on all automations when we get home.

Lol thank you. I’m feeling very brave :muscle::crossed_fingers::crossed_fingers::crossed_fingers: I will install that now and give it a try. The wife is due to go out pretty soon so should be able to test it pretty quickly. Again, thanks for your time and help

@Townsmcp got it on the lights and virtual switches. but why a for loop inside another for loop in the original piston posted?

better you than me :slight_smile: you dont need the wife to actually leave home … just use this:

@bangali Thanks. Will have a look into that for later. Wife is due out in the next 10 minutes. For testing when I’m at home I created a virtual presences sensor and swapped the device variable to look at those instead of the real presence sensors which seemed to do the trick.

The loop in a loop was just sloppy coding in my part to be honest - no real reason for it.

And as I write this, the wife left home and the expected notifications came through only which is great. All lights and virtual switches are off as expected too. Now to test us both being home and leaving together with your suggestion. :blush:

@bangali so after some quick testing, it seems like the leaving home part is working exactly as expected - if one is at home and the other goes out, SHM is not activated. If both leave, SHM is activated, devices switched off etc.
The only thing not working is when one or both arrive home - it’s not deactivating SHM, enabling v switches etc

One of the issues I have noticed with my pistons in webCoRE is that even if they previously worked fine in CoRE with something like the following:

IF sensor does something (is on, is off, detects motion, detects acceleration stop, etc.) THEN
Perform an action
Perform an action
Wait…
Perform some more actions

Then that same piston in webCoRE will cancel the unexecuted actions if the conditional state changes before it’s finished. This has impacted some fades, as well as some thermostat auto-adjustments and some lights on-when-motion/wait/turn-lights off pistons.

I’m testing some of them now to see if they work better with the TCP set to Never Cancel.

The reason for that is TCP is off by default in webCoRE which is the opposite of CoRE. For anything you want to not cancel you need to enable it. Click on the statement and click on the cog in the resulting dialog to adjust the cancellation policy.

1 Like

@Nezmo Did it last night. Thanks!

A few people have been posting problems with long-duration fades, some separated by waits, having problems like stalling. I wonder if that might be part of the issue.

1 Like

Great. I missed your last comment above before I replied.

Is there any way of testing the pistons, when they have pressence devices controling them?
Had a few issues trying to get some to run but it takes ages to prove if you can’t manually change the state of the pressence devices.

Add a simulated presence sensor to your Things and to the triggers/conditions.

1 Like

I have a virtual presence device I use for testing. That way i can toggle it in the app to test. Once its tested, i change the piston to the “real” presence devices.

2 Likes

In addition to virtual devices (as mentioned, above), you can also use a Minimote for testing.

I ought to know the answer to this, but I don’t.

When I update AskAlexa (like I did today) to the latest version, do I also need to update the Node.js and the interaction model, etc., on Amazon? I know I need to update the interaction model any time I make changes to the physical devices or the AskAlexa configuration that I want it to be aware of, but I am unclear on whether those need updating when the SmartApp itself is updated.

Thanks.

EDIT: The answer is yes. :smiley: Predictably so, but I was hoping it wouldn’t be necessary. Alexa helpfully informed me the Lambda code was obsolete when I asked her something.

I’m sure plenty of people have thought of this before, but I haven’t seen it in the last several hundred messages.

I find it convenient to create an extra room in my ST app for virtual switches or for override toggles so I can easily find them. Yes, I have them available on actiontiles, but sometimes I want to get to it quickly in the app.

@Townsmcp progress. checking arrival.

EDIT: what time of the day was this that you both arrived?

the arrival is not working most likely because of the if conditions controlling that. at the time you tested this it was wednesday, so you would have had to arrive between 12pm and 11:59pm for everything to work as it should on arrival.

since both modes are custom, i dont know what the 2 modes are and really what time of the day which mode should be set. so cant fix the time conditions for you. but happy to help if you tell me which days and times which mode should be set.

thanks.

EDIT: from the comments in the piston i see you are setting the midweek and weekend mode, how about at other times of day for all days of the week? since the if conditions do not support other modes for other times of days, the SHM is not being deactivated or the switches enabled.

@Townsmcp check this version. it always turn off the SHM when any of the presence sensors arrive but the conditions with time ranges still has to be corrected to pick the right mode and turn on switches.

thanks.

@bangali I will try that one. I pretty much only use 4 modes. Night. Midweek. Weekend. Away.
Night activates when going to bed until 5:30am
Midweek is any time between 6:30pm on a Sunday and 6:30pm on a Friday, unless Night or Away.
Weekend is any time between 6:30pm on a Friday until 6:30pm on a Sunday unless Night or Away.

Weekend start early and week start early the day before to allow for kids going to bed. On a Friday and Saturday they can stay up later which means I don’t want dimmed upstairs lights working until 10pm instead of the usual 8pm midweek. Sunday midwek starts early as the kids can’t to be up until all hours ready for school next day. But those are all handled Ina separate mode changer piston and lighting pistons

great. instead of the setting the mode in this piston, may be you could execute the mode changer piston and lighting pistons from this piston after deactiviting SHM? that will save you having to copy the stuff over onto this piston.

I’m trying to get this presence tile to change colour depending on its state.
If presence is ‘Present’ then background, say, green.
If presence is ‘Away’ then background, say, blue.
I’m not a coder and I import pistons and play and cannot get my head round it.
I’ve tried playing with @anon36505037’s door state tile but cannot get it to work.
Ideas anybody.
This is what I have so far.