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

Does this look better?

Personally i would get rid of the (only while home) from the turn On and move it to the if.
So,
IF
Contact sensor is open
AND
Location mode is Home.
DO…

But that’s just me…

more like this?

Sure, here are some:

this controls my kitchen lights - I reuse the same for the living room and a modified version for the bedroom (also has a remote that can disable the light automation)

The bedroom one also has support for multiple lights (toggling the lights within 15s of the automation turning them on or off disables the automation for 2h)

My pool manager:

and what makes sure my pool pump stops when a problem occurs:

My security manager, arms/disarms the alarm and opens the garage door when anyone comes home:

Also references the home mode manager below:

which also references the location state machine:

and also the outdoor lights manager that will set/reset the lights outside depending on time of day:

I also have a water heater manager:

and a doorbell manager:

Central to my automation are the Lights Manager, the Home Mode Manager, Security Manager, and the Location Mode State Machine. The early bird part refers to the bedroom lights which are not supposed to come on in the morning until I make my wife’s coffee so the light does not wake her up :smiley:

7 Likes

Copy this.

I could use some help.

I have 2 β€œemergency” pistons.
A) Burglar alarm sounding
B) Smoke Alarm sounding
Both are triggered by an open/close sensor opening, which first will set my hub mode to β€œemergency” mode (and a matching virtual switch to ON).
Then they run the following:

Burglar:
All interior lights ON (100%)
All Color Lights RED, FLASH 100x 1sec/1sec
All Exterior lights FLASH 100x 1sec/1sec
All ceiling fans OFF
All TVs OFF
All door locks LOCK

Smoke/Fire:
All interior lights ON (100%)
All Color Lights RED
All Exterior lights ON
All ceiling fans OFF
All HVAC OFF
All TVs OFF
All door locks UNLOCK
Garage door OPEN

I have 100+ devices. Probably 50-60 of which are switches/lighting/fans/thermostats.
What I want to do is capture the state of all devices before running the routine, then when i turn off virtual switch, cancel all pending actions (flashing lights) and restore the house to its’ previous state.

Basically something like this: (i need help with the bolded parts)
– if {sensor:smoke/fire} or {sensor:alarm sounding} change to OPEN
– set location mode: [emergency]
– capture state of all switchable/controllable devices
– execute burglar or smoke routine

– if β€œemergency” mode (virtual switch) is turned OFF
– set location mode β€œDaytime” or β€œNight” (mode as applicable; done via Alexa)
– only if {sensor:smoke/fire} or {sensor:alarm sounding} is CLOSED
–Then: restore all devices to saved state

Is there a way to capture/restore the states of these devices in an β€œeasy” way? Or do I need to do this for each device one by one?
Please tell me there is an easy way. :slight_smile:

I am so copying all of your pistons… :slight_smile:

1 Like

There is a problem with triggers and followed by, try using conditions and see if that works better - I have yet to find a solution for all triggers to update on a piston run. Right now, the β€œchanges” gets all ruined because not all triggers get evaluated on each run, meaning some of them β€œmiss” events that are necessary for the next evaluation to be true (see a change)

Thanks bobbles
I will give it a try
Mike

What I did is instead of capturing all that stuff (good luck setting 50 lights on in one go - use the inter-command time option in the piston settings) - I have a piston that handles all my outdoor lights. If I run it, it sets them to what they should be - including the alarm mode. then anytime I need to β€œrestore” the lights, I call that… You’ll find most of my pistons, including the lights manager, here.

1 Like

Thank you for your example pistons - we’ll be able to learn a lot from them.

Could you perhaps explain what your β€œLocation State Machine” does and how it works? What is the purpose of the $hours24 variable and what do the different β€œcase” statements do - I’ve not seen the task used before and even after opening the task, I can’t figure out what it does and how it works.

Thanks

1 Like

$hours24 is an integer between 0 and 23 - I use it to automatically slide from Morning to Noon, to Day, to Evening.

Here’s another one of my β€œbeast” pistons - this one builds a nice little table with power/energy reports. Just figured out the bug with the negative amounts - version 0.2.0d2 adds long variables support (webCoRE only supported integer and decimal so far) - the negative amounts I got there are integer overruns.

NOTE: At the time of this post, v0.2.0d2 was not yet released.

the result:

╔══════════════════════════════════╦═══════════════════════════════════════════════╦══════════╦═══════════════════════════════════════════╗
β•‘                                  β•‘             Power ON time (d hh:mm)           β•‘  Max. W  β•‘                 Energy (kWh)              β•‘
β•‘              Device              β•‘   Today   β•‘ Yesterday β•‘ This monthβ•‘ Last monthβ•‘   Today  β•‘   Today  β•‘ Yesterdayβ•‘This monthβ•‘Last monthβ•‘
╠══════════════════════════════════╬═══════════╬═══════════╬═══════════╬═══════════╬══════════╬══════════╬══════════╬══════════╬══════════╣
β•‘ Garage Battery Charger           β•‘     00:00 β•‘     00:00 β•‘     02:14 β•‘     00:00 β•‘      0.0 β•‘      0.0 β•‘      0.0 β•‘      0.1 β•‘      0.0 β•‘
β•‘ Garage Refrigerator              β•‘     15:30 β•‘     23:37 β•‘  6d 02:27 β•‘  1d 02:21 β•‘    546.0 β•‘      1.7 β•‘      2.8 β•‘     17.4 β•‘      3.2 β•‘
β•‘ Hallway Water Heater             β•‘     00:04 β•‘     01:44 β•‘     11:37 β•‘     00:32 β•‘   4746.0 β•‘      0.7 β•‘      2.8 β•‘     19.3 β•‘      2.5 β•‘
β•‘ Kitchen Beverage Refridgerator   β•‘     11:00 β•‘     01:34 β•‘ -1d 19:13 β•‘    -01:26 β•‘    105.0 β•‘      1.1 β•‘      1.6 β•‘     13.4 β•‘      1.7 β•‘
β•‘ Kitchen Freezer Outlet           β•‘     11:30 β•‘    -02:57 β•‘    -00:16 β•‘     03:41 β•‘    572.0 β•‘      1.7 β•‘      2.6 β•‘     21.0 β•‘      2.9 β•‘
β•‘ Kitchen Ice Maker                β•‘     14:20 β•‘     23:57 β•‘  7d 23:41 β•‘  1d 02:21 β•‘    269.0 β•‘      1.5 β•‘      3.4 β•‘     24.6 β•‘      3.8 β•‘
β•‘ Kitchen Nespresso Machine        β•‘     00:02 β•‘     00:10 β•‘     01:20 β•‘     00:03 β•‘   1300.4 β•‘      0.0 β•‘      0.1 β•‘      0.7 β•‘      0.0 β•‘
β•‘ Kitchen Refridgerator Outlet     β•‘     06:00 β•‘    -01:44 β•‘    -14:38 β•‘     03:02 β•‘    155.0 β•‘      0.8 β•‘      1.2 β•‘     10.4 β•‘      1.3 β•‘
β•‘ Kitchen Washing Machine          β•‘    -00:00 β•‘     00:00 β•‘     00:00 β•‘     00:00 β•‘      3.5 β•‘      0.0 β•‘      0.1 β•‘      0.6 β•‘      0.1 β•‘
β•‘ Pool Pump                        β•‘     02:51 β•‘     07:43 β•‘  1d 22:57 β•‘     06:41 β•‘   1341.0 β•‘      3.6 β•‘     10.1 β•‘     68.1 β•‘     13.3 β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•

EDIT: updated this piston to highlight the currently active outlets in black.

4 Likes

Makes my pistons minuscule BY FAR! :grin: AND I still have to work out the kinks…

1 Like

I have a switch called vacation. (Switch 52)

In this piston, everything works except it’s not turning off the vacation switch. any ideas?

the thermostat related with block has 3 Wait commands in it, making the remaining two with blocks wait - either move it last or make it async so that the next with blocks get executed without waiting for the 110 seconds total wait time.

1 Like

Any way of inserting a switch to sort the list values (asc or desc), defaulting to device name for now?

Thanks. That’s disappointing. I don’t see how this can work without triggers. First, there is no way to make the physical switch turning off a condition - only options are triggers. I left it at Changes To for that, and then changed the door contact from Changes To Closed to IS Closed. But that of course does not produce the correct results.

So the way this works now is that I close the door and nothing happens. I wait 2 minutes and push the light off. THEN 15 seconds later it executes and says if the switch was physcially turned off and the door is closed then send the alert. Which it does. But that is not the desired behavior. The behavior should be that if the door closes and then within 15 seconds the switch is pushed, THEN it should be true. See piston below.

So unless I’m misunderstanding something, it seems that Followed By really cannot be used at this time?

It seems there is a problem with triggers in general that becomes very evident in the followed by - it will get fixed, looking for the best way to do it - triggers are stored in the hierarchical structure of the piston which is very well optimized for executing a piston, but not the fastest at searchii through for all triggers. I want to find a better way

did you try forcing a subscription on your condition?