Incrementing an outside awning with Reactor/MSR
-
I have a Reactor set up to extend an outside awning when the OAT reaches 26C and it's after 1100, that part is straightforward enough, however I wanted to take it one step further and rather than it being either fully out or the reverse I'd like to have the ability to increment it either In or Out by a certain distance (typically 500mm) every 120 secs or so.
I had tried to do this with PLEG based on Sun position but failed miserably and never attempted to do this with distance and time.
I have looked at adding it to the current Reactor but not being fully fluent in Reactor I've hit a brick wall and don't see if it can be done - anyone point me in the right direction is is this something that Reactor can't do? -
A. There's nothing Reactor cannot do!
B. I think you'll want to open the ▼ chevron (in Reactor for Vera) or ... button (in MSR) next to one of your AND conditions.
C. Use "Pulse" to have them momentarily go TRUE (for, say 1-2 seconds) every 120 seconds.
D. The pulsing will automatically cease once either condition stops being TRUE.I hope this helps!
-
@librasun said in Incrementing an outside awning with Reactor/MSR:
I hope this helps
It certainly does ( and implemented), any idea how to tie this in with my original idea of following the sun's position?
-
My only idea involves using trigonometry and time to compute an angle, then scale everything to the travel extents of your awning. Hardly practical!
Probably a much easier way. Will chew on this a while.
Hints:- https://api.sunrise-sunset.org/json?lat=36.7201600&lng=-4.4203400&date=today gives free JSON responses that include solar noon
- You can compute that just as readily by knowing sunrise and sunset times, and your latitude.
- In my "SiteSensor" thread, this formula would likewise provide Solar Noon for the specified lat/lon location:
Sn
:=openWx.sys.sunrise + floor((openWx.sys.sunset - openWx.sys.sunrise) / 2)
I'll expand on how you could use this to modulate the awning position tomorrow.
-
You know about the Heliotrope plug-in that tracks the sun’s position...?
It’s in the Alt App Store.
-
Incidentally, all the same calculations are done natively in openLuup in order to compute sunrise/set times.
-
MSR also has native sun calcs. I guess I need to expose some of those features more, eh?
-
No matter which source you use (MSR's built-in sunrise/sunset feature is probably optimal!), here's some back-of-the-napkin thoughts on how to calculate when and how to adjust your awning throughout the morning, assuming you start the process at Sunrise:
Rule Expressions:
shade_range
= (<shade_max> - <shade_min>)
elapsed_time
= floor((<sunset_time> - <sunrise_time>) / 2)
shade_move_per_cycle
= N
cycle_interval
= floor(<elapsed_time> / (<shade_range>/N))Then in your Rule's Set Action:
[INTERVAL] [EVERY] [<cycle_interval> seconds]
[ENTITY ACTION] [MOVE SHADE] [N steps]NOTE: THIS IS ALL PSEUDO-CODE. I leave the actual formulae as an exercise for the reader.
-
Sun angle is now part of a new "Sun Information" entity that will be published by the System Controller.
-
Whoa, sweet! I know my out of left field suggestions might be a bit too much at times, but is there any chance that MSR will track statistics such as how often a particular rule runs during a given time span?
And how will users ultimately be notified if circular logic causes a rule to run excessively? Perhaps it is premature to be asking about that. -
@toggledbits said in Incrementing an outside awning with Reactor/MSR:
Sun angle is now part of a new "Sun Information" entity that will be published by the System Controller.
All great replies and food for thought. I played around with the heliotrope plugin with PLEG, as I mentioned previously but couldn't make it work - but reactor is a different beast.
Any chance of exposing the sun & moon functions ( I assume that Moon functions are also present) in Reactor as well as MSR? -
It doesn't have moon functions yet. Tell me how you want to use them.
-
Full Moon and exterior lights - (deleted witty reply )
-
Sounds good. When you figure out what your logic inputs need to be to make it work the way you want, let me know and we can talk about maybe getting those implemented.
8/14