Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Notifications
Login / Register
Community
Community
Notifications
close
  • Forums
  • Knowledge Center
  • Events & Webinars
  • Ideas
  • Blogs
Help
Help
  • Explore Community
  • Get Started
  • Ask the Community
  • How-To & Best Practices
  • Contact Support
Login / Register
Sustainability
Sustainability

Ask Me About Webinar: Data Center Assets - Modeling, Cooling, and CFD Simulation
Join our 30-minute expert session on July 10, 2025 (9:00 AM & 5:00 PM CET), to explore Digital Twins, cooling simulations, and IT infrastructure modeling. Learn how to boost resiliency and plan power capacity effectively. Register now to secure your spot!

Sonnenstand

SpaceLogic KNX Forum

Schneider Electric SpaceLogic KNX forum to get support and share knowledge including selection, installation and troubleshooting for spaceLYnk, Wiser for KNX, eConfigure KNX, SpaceLogic KNX Hybrid module and other topics.

cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • Home
  • Schneider Electric Community
  • EcoStruxure Building
  • Light and Room Control
  • SpaceLogic KNX Forum
  • Sonnenstand
Options
  • Mark Topic as New
  • Mark Topic as Read
  • Float this Topic for Current User
  • Bookmark
  • Subscribe
  • Mute
  • Printer Friendly Page
Invite a Co-worker
Send a co-worker an invite to the portal.Just enter their email address and we'll connect them to register. After joining, they will belong to the same company.
You have entered an invalid email address. Please re-enter the email address.
This co-worker has already been invited to the Exchange portal. Please invite another co-worker.
Please enter email address
Send Invite Cancel
Invitation Sent
Your invitation was sent.Thanks for sharing Exchange with your co-worker.
Send New Invite Close
Top Experts
User Count
Thomas_Rohde
Sisko Thomas_Rohde Sisko
127
Erwin-vd-Zwart
Sisko Erwin-vd-Zwart Sisko
56
Heribert_Dölger
Lt. Commander Heribert_Dölger Lt. Commander
30
FZetina
Lt. Commander FZetina Lt. Commander
29
View All

Invite a Colleague

Found this content useful? Share it with a Colleague!

Invite a Colleague Invite
Back to SpaceLogic KNX Forum
baerdo
Crewman baerdo
Crewman

Posted: ‎2025-08-09 02:43 PM

0 Likes
1
38
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2025-08-09 02:43 PM

Sonnenstand

Hier Code, den ich angepasst habe, um den Sonnenstand in SpaceLYnk zur Verfügung zu stellen: 

 


local function sunposition(latitude, longitude, time)
time = time or os.time()
if type(time) == 'table' then time = os.time(time) end

local date = os.date('*t', time)
local utcdate = os.date('*t', time)
local latrad = math.rad(latitude)
local fd = (utcdate.hour + utcdate.min / 60 + utcdate.sec / 3600) / 24
local g = (2 * math.pi / 365.25) * (utcdate.yday + fd)
local d = math.rad(0.396372 - 22.91327 * math.cos(g) + 4.02543 * math.sin(g) - 0.387205 * math.cos(2 * g)
+ 0.051967 * math.sin(2 * g) - 0.154527 * math.cos(3 * g) + 0.084798 * math.sin(3 * g))
local t = math.rad(0.004297 + 0.107029 * math.cos(g) - 1.837877 * math.sin(g)
- 0.837378 * math.cos(2 * g) - 2.340475 * math.sin(2 * g))
local sha = 2 * math.pi * (fd - 0.5) + t + math.rad(longitude)

local sza = math.acos(math.sin(latrad) * math.sin(d) + math.cos(latrad) * math.cos(d) * math.cos(sha))
local saa = math.acos((math.sin(d) - math.sin(latrad) * math.cos(sza)) / (math.cos(latrad) * math.sin(sza)))

--print("<<<<<<<<<<<< utcdate.hour",utcdate.hour,"utcdate.min",utcdate.min)
--print("<<<<<< sza",sza,"<<<<<< saa",saa)
--print("<<<<< longitude",longitude,"Altitude",math.deg(sza),"Azimuth",math.deg(saa))

return 90 - math.deg(sza), math.deg(saa)

end


local function getSunPos(lat, long, time)

-- calculate UTC altitude and azimuth
local altitude, azimuth = sunposition(lat, long, time)

-- Check previous minute values to detect azimuth direction change 0º and 180º
time = time - 60
local previuos_altitude, previuos_azimuth = sunposition(lat, long, time)

print("previuos_azimuth",previuos_azimuth,"<<<< azimuth",azimuth)
if previuos_azimuth < azimuth then
-- print("<<<<<<<<<<<<< TREND:", "UP")
else
-- print("<<<<<<<<<<<<< TREND:", "DOWN")
end
if previuos_azimuth < azimuth then -- calcualted azimuth trend UP >>>>>>>>>>>>>>>>>>>
if long < 0 then
if lat > 0 then
return altitude, azimuth
else
return altitude, 360 - azimuth
end
else ------------------- long > 0
if lat > 0 then
return altitude, azimuth
else
return altitude, 360 - azimuth
end
end
else -- calcualted azimuth trend DOWN >>>>>>>>>>>>>>>>>>>
if long < 0 then
if lat > 0 then
return altitude,360 - azimuth
else
return altitude, azimuth
end
else ------------------- long > 0
if lat > 0 then
return altitude, 360 - azimuth
else
return altitude, azimuth
end
end
end
end

local plat = 47.53305
local plong = 7.810654

local altitude, azimuth = getSunPos(plat, plong, os.time())
--alert (altitude)

grp.update('32/5/1', altitude)
grp.update('32/5/2', azimuth )

 

Labels
  • Labels:
  • SpaceLYnk
Tags (1)
  • Tags:
  • english
Reply
  • All forum topics
  • Previous Topic
  • Next Topic
Reply 1
Thomas_Rohde
Sisko Thomas_Rohde Sisko
Sisko

Posted: ‎2025-08-27 01:39 AM

0 Likes
0
21
  • Mark as New
  • Bookmark
  • Subscribe
  • Mute
  • Permalink
  • Print
  • Email to a Friend
  • Report Inappropriate Content

Link copied. Please paste this link to share this article on your social media post.

‎2025-08-27 01:39 AM

Hallo Baerdo!

Vielen DANK für dieses Skript.
Ich hatte das auch mal erstellt und damit kann man sehr schön in der freien Visu anzeigen wo die Sonne sich gerade befindet.
D.h. mit der Integration eines Satellitenbildes kann man den Azimuth-Wert schön als Strich (Overlay) darstellen.
Man muss nur eine entsprechende Anzahl Bilder beim Wert hinterlegen.
Siehe Beispiel von der Website Sonnenverlauf welche natürlich noch mehr Infos wie Sonnenauf- und Sonnenuntergang als Strich liefert.
2025-08-27_10h30_32.png

 

Kind regards
Thomas

Application Design Engineer
Reply
Preview Exit Preview

never-displayed

You must be signed in to add attachments

never-displayed

 
To The Top!

Forums

  • APC UPS Data Center Backup Solutions
  • EcoStruxure IT
  • EcoStruxure Geo SCADA Expert
  • Metering & Power Quality
  • Schneider Electric Wiser

Knowledge Center

Events & webinars

Ideas

Blogs

Get Started

  • Ask the Community
  • Community Guidelines
  • Community User Guide
  • How-To & Best Practice
  • Experts Leaderboard
  • Contact Support
Brand-Logo
Subscribing is a smart move!
You can subscribe to this board after you log in or create your free account.
Forum-Icon

Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.

Register today for FREE

Register Now

Already have an account? Login

Terms & Conditions Privacy Notice Change your Cookie Settings © 2025 Schneider Electric

Welcome!

Welcome to your new personalized space.

of

Explore