Ankündigung

Einklappen
Keine Ankündigung bisher.

avm plugin - hosts funktionieren nicht

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

    avm plugin - hosts funktionieren nicht

    Hi,

    irgendwie bekomme ich die hosts nicht aktualisiert, könnte mir jemand sagen was ich falsch mache?

    plugin.yaml
    Code:
    avm1:
        plugin_name: avm
        username: smarthome
        password: smarthome
        host: 192.168.222.1
        port: 49443
        cycle: 300
        ssl: True    # use https or not
        verify: False    # verify ssl certificate
        call_monitor: 'False'
    #    call_monitor_incoming_filter: "...    ## optional, don't set if you don't want to watch only one specific number with your call monitor"
        avm_identifier: fritzbox
        instance: fritzbox
    item.yaml:
    Code:
    avm:
        uptime:
            type: num
            visu_acl: ro
            avm_data_type@fritzbox: uptime
        wan:
            connection_status:
                type: str
                visu_acl: ro
                avm_data_type@fritzbox: wan_connection_status
    
            connection_error:
                type: str
                visu_acl: ro
                avm_data_type@fritzbox: wan_connection_error
    
            is_connected:
                type: bool
                visu_acl: ro
                avm_data_type@fritzbox: wan_is_connected
    
            uptime:
                type: num
                visu_acl: ro
                avm_data_type@fritzbox: wan_uptime
            ip:
                type: str
                visu_acl: ro
                avm_data_type@fritzbox: wan_ip
    
        devices:
            fritzbox:
                vuduo2:
                    mac: 00:1D:EC:06:20:8A
                    avm_data_type@fritzbox: network_device
                    type: bool
                    cache: 'yes'
                    visu_acl: ro
    
                    # these items need to be child items from network_device
                    ip:
                        type: str
                        avm_data_type@fritzbox: device_ip
                        visu_acl: ro
    
                    # these items need to be child items from network_device
                    connection_type:
                        type: str
                        avm_data_type@fritzbox: device_connection_type
                        visu_acl: ro
    
                    # these items need to be child items from network_device
                    hostname:
                        type: str
                        avm_data_type@fritzbox: device_hostname
                        visu_acl: ro
    
                gig:
                    mac: 84:AD:8D:6A:8B:A0
                    avm_data_type@fritzbox: network_device
                    type: bool
                    cache: 'yes'
                    visu_acl: ro
    
                    # these items need to be child items from network_device
                    ip:
                        type: str
                        avm_data_type@fritzbox: device_ip
                        visu_acl: ro
    
                    # these items need to be child items from network_device
                    connection_type:
                        type: str
                        avm_data_type@fritzbox: device_connection_type
                        visu_acl: ro
    
                    # these items need to be child items from network_device
                    hostname:
                        type: str
                        avm_data_type@fritzbox: device_hostname
                        visu_acl: ro
    
                gig2:
                    mac: 84:ad:8d:6a:8b:a0
                    avm_data_type@fritzbox: network_device
                    type: bool
                    cache: 'yes'
                    visu_acl: ro
    
                    # these items need to be child items from network_device
                    ip:
                        type: str
                        avm_data_type@fritzbox: device_ip
                        visu_acl: ro
    
                    # these items need to be child items from network_device
                    connection_type:
                        type: str
                        avm_data_type@fritzbox: device_connection_type
                        visu_acl: ro
    
                    # these items need to be child items from network_device
                    hostname:
                        type: str
                        avm_data_type@fritzbox: device_hostname
                        visu_acl: ro
    die uptime/wan geschichten werden aktualisiert aber bei den hosts passiert nichts...

    hier noch die items über den telenet 2323 abgefragt:
    Code:
    avm.uptime = 2383884
    avm.wan.connection_status = Connected
    avm.wan.connection_error = ERROR_NONE
    avm.wan.is_connected = True
    avm.wan.uptime = 76708
    avm.wan.ip = xxx
    avm.wan = None
    avm.devices.fritzbox.vuduo2.ip =
    avm.devices.fritzbox.vuduo2.connection_type =
    avm.devices.fritzbox.vuduo2.hostname =
    avm.devices.fritzbox.vuduo2 = True
    avm.devices.fritzbox.gig.ip =
    avm.devices.fritzbox.gig.connection_type =
    avm.devices.fritzbox.gig.hostname =
    avm.devices.fritzbox.gig = True
    avm.devices.fritzbox.gig2.ip =
    avm.devices.fritzbox.gig2.connection_type =
    avm.devices.fritzbox.gig2.hostname =
    avm.devices.fritzbox.gig2 = True
    avm.devices.fritzbox = None
    avm.devices = None
    avm = None



    #2
    Welche Version des Plugins? Was sagt das Log im Debug Modus?

    Den avm_identifier gibts zudem nicht mehr, der war früher für das Mutliinstanz Handling da, bevor es das instance Attribut gab.

    Probier mal bei allen Items auf tiefster Ebene den Instanznamen wegzulassen. Ich hab das so:

    Code:
                Handy:
                    mac: b8:xx:02:21:xx:aa
                    avm_data_type@wlan_repeater_1750_galerie: network_device
                    type: bool
                    cache: 'yes'
                    visu_acl: ro
    
                    ip:
                        type: str
                        avm_data_type: device_ip
                        visu_acl: ro
    
                    connection_type:
                        type: str
                        avm_data_type: device_connection_type
                        visu_acl: ro
    
                    hostname:
                        type: str
                        avm_data_type: device_hostname
                        visu_acl: ro
    Das könnte in der Tat ein Bug sein, da ich die Childitems mit mit ['conf'] aufrufe.. Ich baue das mal um und pushe eine neue Version in den DEV, sobald ich getestet habe.
    Zuletzt geändert von psilo; 07.01.2020, 18:44.

    Kommentar


      #3
      Update: da ist 100% ein bug.. baue es so um, dass die instanz immer ans avm_data_type dran muss!
      Update: Fix ist im DEV, bitte nachtesten. Bei mir klappt jetzt alles.. im README waren auch noch fehler. Deine Items müssten so jetzt aber passen!
      Zuletzt geändert von psilo; 07.01.2020, 19:02.

      Kommentar


        #4
        Hi,

        war im master branch....
        hab jetz von den plugins in den develop gewechselt...
        jetz wenn ich smarthomeng starte sehe ich diese fehlermeldungen:

        Code:
        2020-01-08  14:17:59 WARNING  lib.shyaml          Unable to correct line number for yaml-file error. Wrong line number is ng values are not allowed here
          in "<unicode string>", line 119, column 71:
             ... r-bar top-0 left-0" style="width: 0%;"></span>
                                                 ^ (line: 119
        2020-01-08  14:17:59 ERROR    lib.shyaml          YAML-file load error in /usr/local/smarthome/plugins/avm/plugin.yaml:
        mapping values are not allowed here
          in "<unicode string>", line 119, column 71:
             ... r-bar top-0 left-0" style="width: 0%;"></span>
                                                 ^ (line: 119)
        NOTE: Look for the error at the expected <block end>, near the second specified line number
        2020-01-08  14:17:59 ERROR    lib.plugin          Plugins, section avm1: class_name is not defined


        ach ja, noch lustiger habe wie du gesagt hast den instanznamen mal bei einem device weggenommen:
        Code:
            devices:
                fritzbox:
                    vuduo2:
                        mac: 00:1D:EC:06:20:8A
                        avm_data_type@fritzbox: network_device
                        type: bool
                        cache: 'yes'
                        visu_acl: ro
        
                        # these items need to be child items from network_device
                        ip:
                            type: str
                            avm_data_type: device_ip
                            #                    avm_data_type@fritzbox: device_ip
                            visu_acl: ro
        
                        # these items need to be child items from network_device
                        connection_type:
                            type: str
                            avm_data_type: device_connection_type
                            #                    avm_data_type@fritzbox: device_connection_type
                            visu_acl: ro
        
                        # these items need to be child items from network_device
                        hostname:
                            type: str
                            avm_data_type: device_hostname
                            #                    avm_data_type@fritzbox: device_hostname
                            visu_acl: ro
        
                    gig:
                        mac: 84:AD:8D:6A:8B:A0
                        avm_data_type@fritzbox: network_device
                        type: bool
                        cache: 'yes'
                        visu_acl: ro
        
                        # these items need to be child items from network_device
                        ip:
                            type: str
                            avm_data_type@fritzbox: device_ip
                            visu_acl: ro
        
                        # these items need to be child items from network_device
                        connection_type:
                            type: str
                            avm_data_type@fritzbox: device_connection_type
                            visu_acl: ro
        
                        # these items need to be child items from network_device
                        hostname:
                            type: str
                            avm_data_type@fritzbox: device_hostname
                            visu_acl: ro
        da wo die instanz noch am tiefsten punkt ist wird jetz alles ergänzt, da wo die instanz weg ist, habe ich keine daten... (aber grad ist ja noch der fehler beim start in der avm/plugin.yaml, also weiß ich nicht ob das zusammenhängt)
        Code:
        avm.devices.fritzbox.vuduo2.ip =
        avm.devices.fritzbox.vuduo2.connection_type =
        avm.devices.fritzbox.vuduo2.hostname =
        avm.devices.fritzbox.vuduo2 = True
        avm.devices.fritzbox.gig.ip = 192.168.222.230
        avm.devices.fritzbox.gig.connection_type = 802.11
        avm.devices.fritzbox.gig.hostname = gig
        avm.devices.fritzbox.gig = True
        Zuletzt geändert von knxvenom; 08.01.2020, 15:56.

        Kommentar


          #5
          Zitat von knxvenom Beitrag anzeigen
          hab jetz von den plugins in den develop gewechselt...
          Das für alle Plugins zu tun ist keine gute Idee. Im develop Branch sind auch Plugins/Plugin Versionen, die einen neueren Core brauchen als den v1.6 Core aus dem Master Branch.

          Für einzelne Plugins ist so ein Wechsel valide, speziell wenn der Plugin Entwickler das anregt oder empfiehlt.

          Zitat von knxvenom Beitrag anzeigen
          jetz wenn ich smarthomeng starte sehe ich diese fehlermeldungen:
          Die Fehlermeldungen sehen so aus, als hättest Du Dateien falsch kopiert. Die Meldungen sehen so aus, als wäre in der plugin.yaml Datei jetzt kein YAML Code sondern HTML.
          Viele Grüße
          Martin

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

          Kommentar


            #6
            In der version vom dev muss zudem die instanz jetzt IMMER zum avm_data_type dazu! So wie du es hattest
            Zuletzt geändert von psilo; 08.01.2020, 17:33.

            Kommentar


              #7
              Achja mit dem html hat sinn recht.. hast vermutlich direkt runtergeladen. Wenn du das machs nimm die sachen im RAW format

              Kommentar


                #8
                hi,
                ja, mein wget war der fehler...

                es funktioniert alles soweit super!

                btw. was mir im master branch vom den plugins noch aufgefallen ist. (dev hab ich nicht getestet)
                wenn ich die temperatur vom dect repeater auslesen möchte ist es genau andersrum.
                dort geht das child mit der temperatur nur wenn man \@fritzbox dahinter setzt.

                vielen dank für eure schnelle hilfe!

                Kommentar


                  #9
                  knxvenom im DEV sollte es jetzt aber für dect und hosts identisch sein, oder? beide brauchen den instanznamen dahinter?

                  Kommentar


                    #10
                    psilo

                    Ich habe das dev-Plugin auch mal getestet und im Log Develop einschaltet.
                    Ich bekomme die Log-Einträge immer 3fach:
                    Code:
                    2020-01-09  20:26:31 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: MonitoringService: Connect called while listen active
                    2020-01-09  20:26:31 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: MonitoringService: Connect called while listen active
                    2020-01-09  20:28:23 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Starting update loop for instance fritzbox_7560
                    2020-01-09  20:28:23 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Starting update loop for instance fritzbox_7560
                    2020-01-09  20:28:23 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Starting update loop for instance fritzbox_7560
                    2020-01-09  20:28:24 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing DeviceInfo response cache for action GetInfo!
                    2020-01-09  20:28:24 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing DeviceInfo response cache for action GetInfo!
                    2020-01-09  20:28:24 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing DeviceInfo response cache for action GetInfo!
                    2020-01-09  20:28:24 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing DeviceInfo response cache for action GetInfo!
                    2020-01-09  20:28:24 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing DeviceInfo response cache for action GetInfo!
                    2020-01-09  20:28:24 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing DeviceInfo response cache for action GetInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing DeviceInfo response cache for action GetInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing DeviceInfo response cache for action GetInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing DeviceInfo response cache for action GetInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetMessageList!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetMessageList!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetMessageList!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetMessageList!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetMessageList!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetMessageList!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetStatusInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetStatusInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetStatusInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetStatusInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetStatusInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetStatusInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetStatusInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetStatusInfo!
                    2020-01-09  20:28:25 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetStatusInfo!
                    2020-01-09  20:28:26 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetInfo!
                    2020-01-09  20:28:26 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetInfo!
                    2020-01-09  20:28:26 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetInfo!
                    2020-01-09  20:28:27 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetInfo!
                    2020-01-09  20:28:27 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetInfo!
                    2020-01-09  20:28:27 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetInfo!
                    2020-01-09  20:28:29 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetInfo!
                    2020-01-09  20:28:29 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetInfo!
                    2020-01-09  20:28:29 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: Accessing TAM response cache for action GetInfo!
                    2020-01-09  20:28:30 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: MAC Address not available on the FritzDevice - ID: fritzbox_7560
                    2020-01-09  20:28:30 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: MAC Address not available on the FritzDevice - ID: fritzbox_7560
                    2020-01-09  20:28:30 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: MAC Address not available on the FritzDevice - ID: fritzbox_7560
                    2020-01-09  20:28:31 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: handling hkr device
                    2020-01-09  20:28:31 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: handling hkr device
                    2020-01-09  20:28:31 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: handling hkr device
                    2020-01-09  20:28:31 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: MonitoringService: Connect called while listen active
                    2020-01-09  20:28:31 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: MonitoringService: Connect called while listen active
                    2020-01-09  20:28:31 DEBUG    plugins.avm_fritzbox_7560.update fritzbox_7560@: MonitoringService: Connect called while listen active
                    Soll das so?

                    Kommentar


                      #11
                      Wie ist das logging denn konfiguriert? ;-) wobei ich da auch nicht experte bin

                      Kommentar


                        #12
                        Zitat von psilo Beitrag anzeigen
                        Wie ist das logging denn konfiguriert? ;-) wobei ich da auch nicht experte bin
                        Wollte das nochmal nachprüfen und nun bekomme ich gar keine Verbindung mehr zur Fritzbox.
                        Es gibt folgende Meldung im Debug-Log:

                        Code:
                        2020-01-09  21:42:01 INFO     plugins.avm         Init AVM Plugin
                        2020-01-09  21:42:02 WARNING  lib.item            load_itemdefinitions(): For testing the joined item structs are saved to /usr/local/smarthome/etc/structs_joined.yaml
                        2020-01-09  21:42:07 ERROR    plugins.avm         Exception when sending POST request: HTTPSConnectionPool(host='192.168.2.4', port=49433): Max retries exceeded with url: /upnp/control/deviceinfo (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x670a4470>: Failed to establish a new connection: [Errno 111] Verbindungsaufbau abgelehnt'))
                        IP der FB, Benutzer und Passwort habe ich mehrfach geprüft. Mache ich eine curl Anfrage, bekomme ich eine richtige Rückmeldung.
                        Was könnte nicht passen?

                        Kommentar


                          #13
                          Alles nochmal durchgestartet? Also box und shng? Viell war die box unter zu grosser last. Warum auch immer

                          Kommentar


                            #14

                            PS: hast Du den CURL auf /upnp/control/deviceinfo oder einen anderen Service gemacht? Der Fehler ist aus meiner Sicht trotzdem eindeutig und besagt, dass Deine Box zum Zeitpunkt des Requests den Verbindungsaufbau abgelehnt hat ;-) Das fantasiert sicher nicht das AVM Plugin von selber.

                            Wie gesagt: vielleicht war zu der Zeit die Last zu hoch. Meine 7490 hatte manchmal ähnlichen Schluckauf. War auch nie sicher, ob die Dinger nicht ein Memory Leak haben. Nach Strom aus - Strom ein ging es dann wieder. Das Plugin schickt halt doch dutzende bis hunderte Requests gegen die Box, da kann sowas passieren. Gerade wenn Du das Cycle Interval kurz machst oder dauernd SHNG durchstartest. Seit ich die 7590 habe, ist alles besser. Alternativ: unnötige Items rausnehmen, man braucht ja nicht die Infos von allen. Teilweise verändert sich das nichtmal (WLAN Name usw.)

                            Kommentar


                              #15
                              das mit den logentries dürfte normal sein, er geht halt bspw 3 mal in die funktion _update_fritz_device_info

                              ich schaue mal, ob ich das item noch in die ausgabe dazunehme, dann wirds klarer:
                              Code:
                              2020-01-10  07:50:01 DEBUG    plugins.avm      _update_fritz_device_info wlan_repeater_1750_front@: Accessing DeviceInfo response cache for action GetInfo and item avm.serial_number_1750_front!
                              2020-01-10  07:50:01 DEBUG    plugins.avm      _update_fritz_device_info wlan_repeater_1750_front@: Accessing DeviceInfo response cache for action GetInfo and item avm.firmware_1750_front!
                              2020-01-10  07:50:01 DEBUG    plugins.avm      _update_fritz_device_info wlan_repeater_1750_front@: Accessing DeviceInfo response cache for action GetInfo and item avm.hardware_version_1750_front!
                              Zuletzt geändert von psilo; 10.01.2020, 07:50.

                              Kommentar

                              Lädt...
                              X