I am “developing” the heat pump control system created by @masipila Control a water heater and ground source heat pump based on cheap hours of spot priced electricity - #17 by masipila. The existing code calculates needed heating hours based upon average outdoor temperature and windchill. I would like to add compensation for passive heating caused by sunshine, too. I try to keep my house indoor temperature at 19-20 C, but on sunny days the temperature rises to 25 C. Hence, I would like to reduce the hours the heat pump is running on sunny days.
You can find the actual implementation at #13 of this megathread. The actual code I am trying to interact with is nibe.js that can be found under " 8. HELPER MODULES USED IN THE SCRIPT ACTIONS ABOVE in #13 of that thread.
The script is using a midnight to midnight timeslot to calculate average temperature over the day. I have copied the function with the intention of calculating average sunshine hours per day based upon a) the cloudiness forecast from the finnish national meterorolgical bureau FMI and b) the sunset and sunrise times from the Astro binding.