Ankündigung

Einklappen
Keine Ankündigung bisher.

Verständnisproblem Azimuth und Altitude

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    Verständnisproblem Azimuth und Altitude

    Hallo Jungs, habe ein Problem mit meinem Code.
    Meine Quadra gibt aus meiner Sicht andere Werte aus als der Raspberry. Vielleicht liegt es aber auch an der Berechnungsart...

    Code:
    2017-07-02 10:36:13.484521 (Laden): Quadra Azimuth:111 - Elevation: 47
    2017-07-02 10:36:13.497685 (Laden): Raspberry Azimuth und Altitude 1.953621745109558/0.8311477303504944
    2017-07-02 10:36:13.511174 (Laden): SH.SUN.POS() (1.9536247253417969, 0.8311495184898376)
    hat einer eine Idee, wie ich das umrechnen muss um da annähernd dieselben Werte rauszubekommen?
    Gruß Peter
    Zuletzt geändert von bmx; 02.07.2017, 11:16.
    never fummel a running system...

    #2
    Vermutlich nutzt Du den Azimuth im Bogenmaß. Es gibt ein weiteres Item mit degree

    https://github.com/smarthomeNG/smarthome/wiki/env

    radians und degrees

    Bzw. siehe:
    def pos(self, offset=None, degree=False, dt=None)
    Zuletzt geändert von psilo; 02.07.2017, 09:44.

    Kommentar


      #3
      danke, aber beides geht nicht:

      Code:
      2017-07-02 11:09:19 ERROR laden Logic: laden, File: /usr/local/smarthome/logics/laden.py, Line: 111, Method: <module>, Exception: 'Item' object has no attribute 'sun_position'
      Traceback (most recent call last):
      File "/usr/local/smarthome/lib/scheduler.py", line 327, in _task
      exec(obj.bytecode)
      File "/usr/local/smarthome/logics/laden.py", line 111, in <module>
      text = 'raspi elevation degrees' + str(sh.env.location.sun_position.elevation.degrees ())
      AttributeError: 'Item' object has no attribute 'sun_position'
      2017-07-02 11:11:21 ERROR laden Logic: laden, File: /usr/local/smarthome/logics/laden.py, Line: 111, Method: <module>, Exception: 'Item' object has no attribute 'sun_position'
      Traceback (most recent call last):
      File "/usr/local/smarthome/lib/scheduler.py", line 327, in _task
      exec(obj.bytecode)
      File "/usr/local/smarthome/logics/laden.py", line 111, in <module>
      text = 'raspi elevation degrees' + str(sh.env.location.sun_position.elevation())
      AttributeError: 'Item' object has no attribute 'sun_position'
      Zuletzt geändert von bmx; 02.07.2017, 11:16.
      never fummel a running system...

      Kommentar


        #4
        Welche Version von smarthome.py / SmartHomeNG benutzt Du denn? Ich meine, die im Wiki beschriebenen env.location-Attribute gibt es z.T. erst seit SmartHomeNG v1.2.
        Viele Grüße
        Martin

        There is no cloud. It's only someone else's computer.

        Kommentar


          #5
          selber umrechnen? ein math.degrees sollte es ja schon tun, wenn ich das recht in erinnerung habe?

          Code:
          [COLOR=#cc7832][B]if [/B][/COLOR]degree:
          [COLOR=#cc7832][B]    return [/B][/COLOR](math.degrees([COLOR=#94558d]self[/COLOR]._orb.az)[COLOR=#cc7832], [/COLOR]math.degrees([COLOR=#94558d]self[/COLOR]._orb.alt))
          Zuletzt geändert von bmx; 02.07.2017, 11:17.

          Kommentar


            #6
            danke, aber leider scheint math auch keine Lösung zu bieten. Habe ich da was falsch installiert?
            Wie kann ich meine Version rausfinden?

            Math.degrees gibt folgenden Fehler:
            Code:
            2017-07-02 12:45:13 ERROR laden Logic: laden, File: /usr/local/smarthome/logics/laden.py, Line: 115, Method: <module>, Exception: 'ephem.Angle' object is not callable
            Traceback (most recent call last):
            File "/usr/local/smarthome/lib/scheduler.py", line 327, in _task
            exec(obj.bytecode)
            File "/usr/local/smarthome/logics/laden.py", line 115, in <module>
            text = 'Raspberry Azimuth und Altitude ' + str(math.degrees(azimut)) + '/' + str(math.degrees(altitude()))
            TypeError: 'ephem.Angle' object is not callable
            Any other Ideas?
            Peter
            Zuletzt geändert von bmx; 02.07.2017, 13:04.
            never fummel a running system...

            Kommentar


              #7
              wieso ist der eine wert eine funktion und der andere eine variable? du liest die werte aus sh.sun.pos() aus und schreibst sie in variablen, danach erst umrechnen

              version bspw via backend plugin

              Kommentar


                #8
                yep, das wars. Habe ich nicht bemerkt., jetzt passt es.
                VIELEN DANK!

                2017-07-02 12:51:30.774023 (Laden): Quadra Azimuth:161 - Elevation: 63
                2017-07-02 12:51:30.787297 (Laden): Raspberry Azimuth und Altitüde 161.442 635246252/63.161969444017814


                never fummel a running system...

                Kommentar

                Lädt...
                X