Ankündigung

Einklappen
Keine Ankündigung bisher.

How to smarthome.py

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

    #16
    Dir fehlt noch das watch_item Attribut in der Definition der Logik:

    Code:
    # logic.conf
    [trial]
    watch_item = trial.taster
    filename = trial.py
    crontab = init
    Das sollte klappen.

    Gruss,

    Stefan
    Sonos

    Kommentar


      #17
      Zitat von pfischi Beitrag anzeigen
      Dir fehlt noch das watch_item Attribut in der Definition der Logik:

      Code:
      # logic.conf
      [trial]
      watch_item = trial.taster
      filename = trial.py
      crontab = init
      Das sollte klappen.

      Gruss,

      Stefan

      Da tut sich leider nichts. Grundlegend muss die ganze Installation ja funktioniert haben ansonsten würde groupwrite ja nicht funktionieren?!

      Kommentar


        #18
        Also Du solltest noch ein enforce_updates bei config unter trial.taster spendieren. Dann würde ich in der Logik nicht auf == 1 prüfen sondern einfach schreiben

        Code:
        if sh.trial.taster():
            sh.trial.licht(not sh.trial.licht() )
        Dann schaltet Dein Taster um und nicht ein. Ist zum Testen einfacher...

        Kommentar


          #19
          Hat auch nix geändert

          Kommentar


            #20
            Tja, was sagt denn die Debug-Ausgabe?

            Kommentar


              #21
              Zitat von ampere84 Beitrag anzeigen
              Code:
              [[licht]]
              type = bool
              [COLOR=#FF0000][B]knx_dept[/B][/COLOR] = 1
              knx_init = 0/0/2
              knx_send = 0/0/2
              vielleicht deshalb

              Kommentar


                #22
                Wichtiger Punkt, haben wir alle überlesen ;-)

                Trotzdem ist es hilfreich, wenn es Probleme gibt mal einen Auszug vom Debuglog zu posten...

                Kommentar


                  #23
                  Code:
                  2017-01-03 10:12:43 DEBUG    __init__     smartvisu    copy_widgets: Could not find source directory sv_widgets in plugins/backend -- __init__.py:copy_widgets:461
                  2017-01-03 10:12:43 DEBUG    plugin       Main         Starting sql Plugin -- plugin.py:start:77
                  2017-01-03 10:12:43 DEBUG    __init__     smartvisu    copy_widgets: Could not find source directory sv_widgets in plugins/knx -- __init__.py:copy_widgets:461
                  2017-01-03 10:12:43 DEBUG    __init__     smartvisu    copy_widgets: Could not find source directory sv_widgets in plugins/visu_websocket -- __init__.py:copy_widgets:461
                  2017-01-03 10:12:43 DEBUG    __init__     smartvisu    copy_widgets: Could not find source directory sv_widgets in plugins/visu_smartvisu -- __init__.py:copy_widgets:461
                  2017-01-03 10:12:43 DEBUG    __init__     smartvisu    copy_widgets: Could not find source directory sv_widgets in plugins/cli -- __init__.py:copy_widgets:461
                  2017-01-03 10:12:43 DEBUG    __init__     smartvisu    copy_widgets: Could not find source directory sv_widgets in plugins/sqlite_visu2_8 -- __init__.py:copy_widgets:461
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    Adding import statements to root.html -- __init__.py:install_widgets:436
                  2017-01-03 10:12:43 WARNING  __init__     smartvisu    Generating pages for smartVISU -- __init__.py:__init__:106
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'category_page.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'rooms.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'roomlite.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'room.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'widgetblock_blk_noh.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'navigation.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'widgetblock2_blk_std.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'widgetblock_std_std.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'navi_sep.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'widgetblock_blk_std.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'widgetblock2_std_std.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'index.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'heading.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'category.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'navi.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 INFO     __init__     smartvisu    copy_templates: Copying template 'roomslite.html' from plugin to smartVISU -- __init__.py:copy_templates:374
                  2017-01-03 10:12:43 ERROR    connection   Connections  KNX: could not connect to 192.168.178.26:6720 (TCP): [Errno 111] Verbindungsaufbau abgelehnt -- connection.py:connect:389
                  2017-01-03 10:12:43 ERROR    connection   Connections  _websocket: problem binding 0.0.0.0:2424 (TCP): [Errno 98] Die Adresse wird bereits verwendet -- connection.py:connect:156
                  2017-01-03 10:12:43 ERROR    connection   Connections  CLI: problem binding 0.0.0.0:2323 (TCP): [Errno 98] Die Adresse wird bereits verwendet -- connection.py:connect:156
                  2017-01-03 10:12:48 DEBUG    item         env_init     Item env.core.version = 1.2.0.man via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_init     Item env.core.start = 2017-01-03 10:12:48.513038+01:00 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_init     Item env.system.name = shng via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_init     Item env.system.start = 2017-01-03 09:43:34.513988+01:00 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.sunrise = 2017-01-04 08:27:24.026573+01:00 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.sunrise.azimut.degrees = 137.36 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.sunrise.elevation.degrees = 6.46 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.sunrise.azimut.radians = 2.4 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.sunrise.elevation.radians = 0.11 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.sunset = 2017-01-03 16:41:30.870570+01:00 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.sunset.azimut.degrees = 245.42 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.sunset.elevation.degrees = -9.22 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.sunset.azimut.radians = 4.28 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.sunset.elevation.radians = -0.16 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.sun_position.azimut.degrees = 147.07 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.sun_position.elevation.degrees = 10.84 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    smarthome    sh.gc        Garbage collector: collected 0 objects. -- smarthome.py:_garbage_collection:492
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.sun_position.azimut.radians = 2.57 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    smarthome    sh.gc        Object references: 12488 -- smarthome.py:_maintenance:484
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.sun_position.elevation.radians = 0.19 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.moonrise = 2017-01-03 11:11:56.148943+01:00 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.moonset = 2017-01-03 22:32:15.695132+01:00 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.moonphase = 1 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:48 DEBUG    item         env_loc      Item env.location.day = True via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:49 DEBUG    scheduler    Scheduler    sh.gc next time: 2017-01-04 02:04:00+01:00 -- scheduler.py:_next_time:316
                  2017-01-03 10:12:49 DEBUG    scheduler    Scheduler    env_loc next time: 2017-01-03 10:42:49+01:00 -- scheduler.py:_next_time:316
                  2017-01-03 10:12:53 ERROR    connection   Connections  _websocket: problem binding 0.0.0.0:2424 (TCP): [Errno 98] Die Adresse wird bereits verwendet -- connection.py:connect:156
                  2017-01-03 10:12:53 ERROR    connection   Connections  CLI: problem binding 0.0.0.0:2323 (TCP): [Errno 98] Die Adresse wird bereits verwendet -- connection.py:connect:156
                  2017-01-03 10:12:55 DEBUG    item         env_stat     Item env.system.libs.ephem_version = 3.7.6.0 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:55 DEBUG    item         env_stat     Item env.core.memory = 16453632 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:55 DEBUG    item         env_stat     Item env.system.load = 0.1 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:55 DEBUG    item         env_stat     Item env.system.diskfree = 62494707712 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:55 DEBUG    item         env_stat     Item env.system.disksize = 70801424384 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:55 DEBUG    item         env_stat     Item env.system.diskusage = 4686614528 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:55 DEBUG    item         env_stat     Item env.system.diskusagepercent = 6.62 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:55 DEBUG    item         env_stat     Item env.location.moonlight = 25 via Logic None None -- item.py:__update:374
                  2017-01-03 10:12:55 DEBUG    scheduler    Scheduler    env_stat next time: 2017-01-03 10:17:55+01:00 -- scheduler.py:_next_time:316
                  2017-01-03 10:13:03 ERROR    connection   Connections  _websocket: problem binding 0.0.0.0:2424 (TCP): [Errno 98] Die Adresse wird bereits verwendet -- connection.py:connect:156
                  2017-01-03 10:13:03 ERROR    connection   Connections  CLI: problem binding 0.0.0.0:2323 (TCP): [Errno 98] Die Adresse wird bereits verwendet -- connection.py:connect:156
                  ^C2017-01-03 10:13:04 INFO     smarthome    Main         Number of Threads: 7 -- smarthome.py:stop:337
                  2017-01-03 10:13:04 INFO     plugin       Main         Stop Plugins -- plugin.py:stop:81
                  2017-01-03 10:13:04 DEBUG    plugin       Main         Stopping knx Plugin -- plugin.py:stop:83
                  2017-01-03 10:13:04 DEBUG    plugin       Main         Stopping visu Plugin -- plugin.py:stop:83
                  2017-01-03 10:13:04 DEBUG    plugin       Main         Stopping smartvisu Plugin -- plugin.py:stop:83
                  2017-01-03 10:13:04 DEBUG    plugin       Main         Stopping cli Plugin -- plugin.py:stop:83
                  2017-01-03 10:13:04 DEBUG    plugin       Main         Stopping sql Plugin -- plugin.py:stop:83
                  2017-01-03 10:13:05 INFO     smarthome    Main         SmartHome.py stopped -- smarthome.py:stop:361

                  So das ist die Ausgabe.
                  Eine Frage noch zum enforce_updates: Gehört das zu den items oder kommt das in die logic.conf? Am besten hänge ich noch einmal alles an.

                  trial.py
                  Code:
                  if sh.trial.taster():
                      sh.trial.licht( not sh.trial.licht() )
                      print "if zweig"
                  else:
                      print "else zweig"
                  logic.conf
                  Code:
                  # logic.conf
                  [test]
                      watch_item = trial.taster
                      enforce_updates = On
                      filename = trial.py
                      crontab = init

                  und die items datei
                  Code:
                  # test
                  [trial]
                     [[taster]]
                       type = bool
                       knx_dpt = 1
                       knx_init = 3/0/0
                       knx_listen = 3/0/0
                       enforce_updates = On
                     [[licht]]
                       type = bool
                       knx_dpt = 1
                       knx_send = 0/0/2
                       enforce_updates = On

                  Kommentar


                    #24
                    ampere84 es gehört zu dem jew item wo du das haben möchtest..

                    PS: hier hast Du doch offenbar schon das Problem
                    2017-01-03 10:12:43 ERROR connection Connections KNX: could not connect to 192.168.178.26:6720 (TCP): [Errno 111] Verbindungsaufbau abgelehnt -- connection.py:connect:389

                    Läuft der KNXD ? Hast Du diesen mal autonom getestet?
                    Zuletzt geändert von psilo; 03.01.2017, 10:27.

                    Kommentar


                      #25
                      Zitat von psilo Beitrag anzeigen

                      Läuft der KNXD ? Hast Du diesen mal autonom getestet?
                      Autonom testen bedeutet mittels groupwrite? Ja das funktioniert. Ich sende GAs und die entsprechenden Ausgänge am Aktor werden gesetzt.
                      Was ist denn mit der IP des Hosts vom KNX in der plugin.conf gemeint? Ich habe jetzt mal die IP meines IP-Interfaces angegeben.
                      Zuletzt geändert von ampere84; 03.01.2017, 10:56.

                      Kommentar


                        #26
                        ampere84 die IP des Systems wo der KNXD läuft (ich denke dein server / pi / whatever)

                        Das sollte das Problem dann auch sein... Ändere mal die IP

                        Kommentar


                          #27
                          Zitat von psilo Beitrag anzeigen
                          ampere84 die IP des Systems wo der KNXD läuft (ich denke dein server / pi / whatever)

                          Das sollte das Problem dann auch sein... Ändere mal die IP
                          Jupp läuft nun. Danke euch allen!!!!!!!!

                          Ich hatte aber noch einen anderen Fehler im Skript. Python 3 verlangt wohl bei dem print Befehl eine Klammer. Also
                          Code:
                          print( "bla" )
                          und bei Python 2.7 ging das hier noch:
                          Code:
                          print "bla"
                          So nun kann ich mal mit den Logiken spielen und dann gehts irgendwann an die Visu, aber dann in dem anderen Projektforum ;-)

                          Danke noch einmal!

                          Kommentar


                            #28

                            Doppel-Post
                            Zuletzt geändert von pfischi; 03.01.2017, 16:32.
                            Sonos

                            Kommentar


                              #29
                              Und wenn du jetzt noch die Leerzeichen zwischen Klammer und Anführungszeichen weglässt, siehts auch noch gut aus

                              Sonos

                              Kommentar


                                #30
                                Zitat von pfischi Beitrag anzeigen
                                Und wenn du jetzt noch die Leerzeichen zwischen Klammer und Anführungszeichen weglässt, siehts auch noch gut aus
                                Geschmackssache sprach der Affe und biss in die Seife

                                Kommentar

                                Lädt...
                                X