FHEM Forum

FHEM - Hausautomations-Systeme => Unterstützende Dienste => Thema gestartet von: FHEMAN am 15 September 2020, 18:35:42

Titel: [gelöst] TWILIGHT compasspoint: Offset möglich?
Beitrag von: FHEMAN am 15 September 2020, 18:35:42
Hallo,

Twilight compasspoint hilft mir wunderbar bei der Ermittlung des Sonnenstandes zur Beschattung.
Da unser Haus jedoch wenige Grad verschoben ausgerichtet ist, würde ich gerne die paar Grad als Offset hinterlegen. Die Himmelsrichtungen sollen also leicht "verschoben" werden.

Geht das irgendwie?

Viele Grüße
Ronny 
Titel: Antw:TWILIGHT compasspoint: Offset möglich?
Beitrag von: FHEMAN am 15 September 2020, 19:56:03
Habe es nun gelöst, in dem ich mir den Compasspoint Code geklaut und in ein userreading gepackt habe:

compasspointEx:azimuth.* { my $offset = 3; my $azimuth = ReadingsNum("$NAME", "azimuth", -999) + $offset; return "unknown" if !looks_like_number($azimuth) || $azimuth < 0; return "north" if $azimuth < 22.5; return "north-northeast" if $azimuth < 45; return "northeast" if $azimuth < 67.5; return "east-northeast" if $azimuth < 90; return "east" if $azimuth < 112.5; return "east-southeast" if $azimuth < 135; return "southeast" if $azimuth < 157.5; return "south-southeast" if $azimuth < 180; return "south" if $azimuth < 202.5; return "south-southwest" if $azimuth < 225; return "southwest" if $azimuth < 247.5; return "west-southwest" if $azimuth < 270; return "west" if $azimuth < 292.5; return "west-northwest" if $azimuth < 315; return "northwest" if $azimuth < 337.5; return "north-northwest" if $azimuth <= 361; return "unknown"; }


Viele Grüße
Ronny