Hi,
I am trying to do something not too complicated – automate my window covers to close whenever the Sun is shining at the window intensively enough and the closed cover would actually improve the situation.
This involves some high-school geometry, looking at projections of balconies or awnings onto windows, which I can handle. The problem is how best to implement it, which is why the question is here.
In the end I will be specifying some vector coordinates of the window size and direction, balcony size etc and doing a bunch of scalar (dot) products to get a binary sensor telling me whether the sun is visible from the window.
I imagined I would just do a template binary sensor, but writing all the linear algebra here by hand in jinja2 seems a little inefficient and will get me reams of spaghetti code. Is there a better way of implementing this within HA?