My first WebCore Piston did not do what I wanted

Dimmer 2 = Curtain
Dimmer 1 = Ceiling fan
Contact sensor 1 is a outside temperature sensor

I have two asynchronous events the way I understand it they should be evaluated on their own and then exit on their own. I want the curtain to open if it is sunrise or sunset.

The synchronous event I want to evaluate If its greater then 74 degrees outside. I want it to close the curtains and turn on the ceiling fan. The flashing of the lights is just to give an indication of what is going on.

I tested this last night screwing with the times and temps. Modifying them to values that would trigger. I hit test in webcore and everything worked as expected. To my surprise I woke up this morning to the curtains closed. What is wrong with my App (Piston)?

I don’t think you need asynchronous on your first and last if, but your second if won’t fire because it doesn’t have a specific trigger, eg, between 2 times isn’t a specific trigger. I would join up to the WebCoRE forum, far more clever people over there to help you :+1: if you used, if temp becomes greater than… Then it would work as a trigger.

Minus the flashing lights, this can be done in the automation creator in the app.

Can you backup and save all your rules in the “automation creator” if you want to?

negative…

The asynchronous events are not part of the If statement. I want the curtains open most of the time. They are there to open them during periods of time when the sun isn’t beating on the house. i.e. at sunrise and sunset.

Same with the if temp > 74 it could be 75 degrees at 8pm at night and would seem pointless to have the curtains closed if the sun isn’t beating on the house. I assume the temperature would be the “trigger” and it would get evaluated if the time was in the correct time period.

I’ll look into the webocre forum I didn’t see a forum listed on their webpage. I see it now https://community.webcore.co/

Normally webCoRE looks in the ‘triggers’ for events to subscribe to or times to execute as that is where you have explicitly stated events you are interested in. If it doesn’t find any it falls back to considering the ‘conditions’ instead.

I suspect that, as you have created the two timers to fire the piston, the piston assumes that is all you want and it doesn’t need to fall back.

I think I’d lob the two timers into a separate piston to get them out of the way, and that should let the piston fire at sunrise, sunset, and whenever the temperature changes, which is what you need.

Blockquote I think I’d lob the two timers into a separate piston to get them out of the way, and that should let the piston fire at sunrise, sunset, and whenever the temperature changes, which is what you need.

I’ll try that. I don’t want the temperature to affect anything though if the sun isn’t out. Ugg this forum is difficult…are they using forum software from 1980?

I created a new app for the asynchronous events. And left the synchronous event by itself. Thanks for the suggestion hopefully it works.

So I think I maybe found my issue and I dont think my code is the problem. I had downloaded an app from the market (virtual thermostat) that I tried to do the same thing with. I think that app was randomly closing my curtains. I have since deleted that app and my curtains remain open.

I have since modified the code to try and use less memory. Using the variable I was able to cut 1% off the memory usage. Hopefully this all works as expected. Thanks for the help and suggestions.