Ankündigung

Einklappen
Keine Ankündigung bisher.

Was triggert meine Logik?

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

    Was triggert meine Logik?

    Hallo,

    kann man herausfinden, ob eine Logik vom KNX-Bus, von smartVisu, von einem Python-Script oder von einem Timer getriggert wurde? Ich hatte die Hoffnung, dass das durch trigger[...] geht, aber da bekomme ich bei allen Alternativen die gleichen Werte. Ich kann das zwar dadurch umgehen, dass ich zusätzliche Items einführe, um diese unterschiedlichen Quellen zu unterscheiden. Allerdings fände ich das nicht elegant, es würde die *.conf unnötig aufblähen.

    Welche Möglichkeiten gibt es?

    Danke & Gruß
    Peter

    #2
    Hi Peter,

    doch das geht mit trigger. Wenn Du aber auf eine Item lauscht, dann wird natürlich immer das Item angegeben.

    Es gib eine Item-Funktion mit der man sehen kann wer das Item geändert hat.

    => Doku

    Bis bald

    Marcus

    Kommentar


      #3
      Hallo Marcus,

      Du meinst changed_by()? Das liefert aber none, wenn der letzte Wert nicht geändert wurde. Z.B. Rollladen steuern: Es gibt ein Item/GA für Fahren (move) und ein Item für Schritte (step), das gleichzeitig einen fahrenden Rollladen stoppt. Wenn man abwechselnd fährt und stoppt (Fahrt in die gleiche Richtung), dann wird zwar immer wieder die Logik getriggert, aber mit dem gleichen Wert wie beim letzten Mal. Die Logik startet, erkennt aber nicht, wer die Veränderung verursacht hat :-(

      Gruß
      Peter

      Kommentar


        #4
        Hi Peter,

        baue in die Logik logger.info(trigger) ein und poste den Code und ein Debug-Log sprechen.

        Bis bald

        Marcus

        Kommentar


          #5
          Hallo,

          hat ein wenig gedauert :-(

          Hier die Logiken:

          1. hello.py (dies verwende ich, um die Veränderung der Werte durch Skripte und Timer zu testen)
          Code:
          #!/usr/bin/env python3
          #
          logger.info('Hello World!')
          
          time.sleep(1.0)
          
          logger.info('Smarthome')
          sh.UG.Buero.Rollo.Rollo_Carport.step(1)
          
          logger.info('Timer')
          sh.UG.Buero.Rollo.Rollo_Carport.step.timer(1,1)
          2. rollo.py (das reagiert auf Veränderungen an *Rollo.Rollo*; Ist momentan auf die Ausgabe gekürzt, weil ich testen wollte, woher meine Loik getriggert wird)
          Code:
          #!/usr/bin/env python3
          #
          source = sh.return_item(trigger['source'])
          rolladen = source.return_parent()
          room = rolladen.return_parent()
          
          logger.info('Input: ' + str(source) + '/ ' + str(source()) + ' (True=AB) / Richtung alt: ' + str(rolladen.conf['richtung']) + ' (+1 = AB) / Art alt: ' + str(rolladen.conf['art']))
          logger.info('  Changed by: ' + str(source.changed_by()))
          logger.info(trigger)
          Hier der Log. Ich habe alles, was so vom Bus kam und nichts mit den Rollos zu tun hatte, gelöscht.
          Code:
          2014-02-12 08:40:05,745 INFO     Main         Start SmartHome.py 1.0-5-g5300605+ -- smarthome.py:__init__:231
          2014-02-12 08:40:05,753 DEBUG    Main         Python 3.2.3 -- smarthome.py:__init__:232
          2014-02-12 08:40:05,763 INFO     Main         Init Scheduler -- scheduler.py:__init__:86
          2014-02-12 08:40:05,774 DEBUG    Scheduler    creating 5 workers -- scheduler.py:run:93
          2014-02-12 08:40:05,776 INFO     Main         Init Plugins -- smarthome.py:start:274
          2014-02-12 08:40:05,815 DEBUG    Main         Plugin: knx -- plugin.py:__init__:43
          2014-02-12 08:40:05,868 DEBUG    Main         KNX time next time: 2014-02-12 08:40:17+01:00 -- scheduler.py:_next_time:289
          2014-02-12 08:40:05,875 DEBUG    Main         Plugin: cli -- plugin.py:__init__:43
          2014-02-12 08:40:05,895 DEBUG    Main         Plugin: visu -- plugin.py:__init__:43
          2014-02-12 08:40:06,001 DEBUG    Main         Plugin: sql -- plugin.py:__init__:43
          2014-02-12 08:40:06,070 DEBUG    Main         SQLite 3.7.13 -- __init__.py:__init__:62
          2014-02-12 08:40:07,223 DEBUG    Main         SQLite: database integrity ok -- __init__.py:__init__:78
          2014-02-12 08:40:07,257 DEBUG    Main         SQLite pack next time: 2014-02-13 03:02:00+01:00 -- scheduler.py:_next_time:289
          2014-02-12 08:40:07,267 DEBUG    Main         Plugin: rrd -- plugin.py:__init__:43
          2014-02-12 08:40:07,602 DEBUG    Main         Plugin: fritzbox -- plugin.py:__init__:43
          2014-02-12 08:40:07,707 INFO     Main         Init Items -- smarthome.py:start:280
          2014-02-12 08:40:07,903 DEBUG    Main         KNX: Sonstiges.Datum listen on 14/2/1 -- __init__.py:parse_item:235
          2014-02-12 08:40:07,917 DEBUG    Main         KNX: Sonstiges.Uhrzeit listen on 14/2/2 -- __init__.py:parse_item:235
          2014-02-12 08:40:07,926 DEBUG    Main         Item Sonstiges: no type specified. -- item.py:__init__:242
          2014-02-12 08:40:07,938 DEBUG    Main         Item log: no type specified. -- item.py:__init__:242
          2014-02-12 08:40:07,966 DEBUG    Main         Item prot: no type specified. -- item.py:__init__:242
          2014-02-12 08:40:07,978 DEBUG    Main         Item t1: no type specified. -- item.py:__init__:242
          2014-02-12 08:40:08,011 DEBUG    Main         Item buttons: no type specified. -- item.py:__init__:242
          2014-02-12 08:40:08,540 DEBUG    Main         Item env.core.memory = 16031314.53832549 via SQLite None None -- item.py:set:457
          2014-02-12 08:40:09,001 DEBUG    Main         Item env.core.threads = 7.0 via SQLite None None -- item.py:set:457
          2014-02-12 08:40:09,465 DEBUG    Main         Item env.core.garbage = 0.0 via SQLite None None -- item.py:set:457
          2014-02-12 08:40:09,486 DEBUG    Main         Item env.core: no type specified. -- item.py:__init__:242
          2014-02-12 08:40:09,576 DEBUG    Main         Item env.location: no type specified. -- item.py:__init__:242
          2014-02-12 08:40:10,064 DEBUG    Main         Item env.system.load = 0.29658541863573606 via SQLite None None -- item.py:set:457
          2014-02-12 08:40:10,089 DEBUG    Main         Item env.system: no type specified. -- item.py:__init__:242
          2014-02-12 08:40:10,106 DEBUG    Main         Item env: no type specified. -- item.py:__init__:242
          2014-02-12 08:40:10,174 DEBUG    Main         KNX: UG.Buero.Rollo.Rollo_Carport.step listen on 10/2/3 -- __init__.py:parse_item:235
          2014-02-12 08:40:10,207 DEBUG    Main         KNX: UG.Buero.Rollo.Rollo_Carport.move listen on 10/2/4 -- __init__.py:parse_item:235
          2014-02-12 08:40:10,230 DEBUG    Main         KNX: UG.Buero.Rollo.Rollo_Carport.zielproz listen on 10/2/6 -- __init__.py:parse_item:235
          2014-02-12 08:40:10,272 DEBUG    Main         Item UG.Buero.Rollo.Rollo_Carport: no type specified. -- item.py:__init__:242
          2014-02-12 08:40:10,291 DEBUG    Main         Item UG.Buero.Rollo: no type specified. -- item.py:__init__:242
          2014-02-12 08:40:11,266 INFO     Main         Start Plugins -- plugin.py:start:65
          2014-02-12 08:40:11,339 DEBUG    rrd          RRDtool next time: 2014-02-12 08:41:51+01:00 -- scheduler.py:_next_time:289
          2014-02-12 08:40:11,363 INFO     Main         Start Logics -- logic.py:__init__:33
          2014-02-12 08:40:11,370 DEBUG    Main         Reading Logics from /usr/smarthome/lib/env/logic_conf -- logic.py:_read_logics:64
          2014-02-12 08:40:11,410 DEBUG    Main         Reading Logics from /usr/smarthome/etc/logic.conf -- logic.py:_read_logics:64
          2014-02-12 08:40:11,452 DEBUG    Main         Logic: rollo_move -- logic.py:__init__:44
          2014-02-12 08:40:11,552 DEBUG    Main         Logic: initial -- logic.py:__init__:44
          2014-02-12 08:40:11,581 DEBUG    Main         Logic: env_loc -- logic.py:__init__:44
          2014-02-12 08:40:11,610 DEBUG    Main         Logic: prot -- logic.py:__init__:44
          2014-02-12 08:40:11,671 DEBUG    Main         Logic: env_stat -- logic.py:__init__:44
          2014-02-12 08:40:11,741 DEBUG    Main         env_stat next time: 2014-02-12 08:40:24+01:00 -- scheduler.py:_next_time:289
          2014-02-12 08:40:11,761 DEBUG    Main         Logic: rcd_status_get -- logic.py:__init__:44
          2014-02-12 08:40:11,839 DEBUG    Connections  KNX: connected to 192.168.1.210:6720 -- connection.py:connect:384
          2014-02-12 08:40:11,851 DEBUG    Connections  KNX: reading eibd cache -- __init__.py:handle_connect:113
          2014-02-12 08:40:11,848 DEBUG    Main         Logic: room_licht_status -- logic.py:__init__:44
          2014-02-12 08:40:11,962 DEBUG    Connections  KNX: enable group monitor -- __init__.py:handle_connect:117
          2014-02-12 08:40:12,026 DEBUG    Main         Logic: rcd_status_set -- logic.py:__init__:44
          2014-02-12 08:40:12,106 DEBUG    Connections  CLI: binding to 0.0.0.0:2323 (TCP) -- connection.py:connect:160
          2014-02-12 08:40:12,220 DEBUG    Connections  WebSocket: binding to 0.0.0.0:2424 (TCP) -- connection.py:connect:160
          2014-02-12 08:40:12,271 DEBUG    Main         Logic: raspi_still_alive -- logic.py:__init__:44
          2014-02-12 08:40:12,300 DEBUG    Main         KNX: raspi_still_alive listen on 12/4/0 -- __init__.py:parse_logic:298
          2014-02-12 08:40:12,309 DEBUG    Main         Logic: hello -- logic.py:__init__:44
          2014-02-12 08:40:12,323 DEBUG    Main         Logic: env_init -- logic.py:__init__:44
          2014-02-12 08:40:13,607 DEBUG    Main         knx: 1.1.33 set 10/7/8 to 22.0 -- __init__.py:parse_telegram:190
          2014-02-12 08:40:13,620 DEBUG    Main         Item UG.Buero.RCD.soll_Tmp = 22.0 via KNX 1.1.33 10/7/8 -- item.py:__update:363
          2014-02-12 08:40:13,829 DEBUG    Main         knx: 1.1.33 set 10/7/9 to 21.4 -- __init__.py:parse_telegram:190
          2014-02-12 08:40:13,838 DEBUG    Main         Item UG.Buero.RCD.ist_Tmp = 21.4 via KNX 1.1.33 10/7/9 -- item.py:__update:363
          2014-02-12 08:40:13,923 DEBUG    Main         knx: 1.1.3 set 10/7/3 to True -- __init__.py:parse_telegram:190
          2014-02-12 08:40:16,832 DEBUG    env_loc      Item env.location.sunrise = 2014-02-13 07:34:57.829678+01:00 via Logic None None -- item.py:__update:363
          2014-02-12 08:40:16,902 DEBUG    env_loc      Item env.location.sunset = 2014-02-12 17:28:46.174749+01:00 via Logic None None -- item.py:__update:363
          2014-02-12 08:40:16,961 DEBUG    env_loc      Item env.location.moonrise = 2014-02-12 15:20:52.908802+01:00 via Logic None None -- item.py:__update:363
          2014-02-12 08:40:17,006 DEBUG    env_loc      Item env.location.moonset = 2014-02-13 06:22:39.275566+01:00 via Logic None None -- item.py:__update:363
          2014-02-12 08:40:17,032 DEBUG    env_loc      Item env.location.moonphase = 3 via Logic None None -- item.py:__update:363
          2014-02-12 08:40:17,075 DEBUG    env_loc      Item env.location.day = True via Logic None None -- item.py:__update:363
          2014-02-12 08:40:17,366 DEBUG    Scheduler    env_loc next time: 2014-02-12 09:10:17+01:00 -- scheduler.py:_next_time:289
          2014-02-12 08:40:17,382 DEBUG    Main         knx: 0.0.0 set 14/2/2 to 08:40:17 -- __init__.py:parse_telegram:190
          2014-02-12 08:40:17,394 DEBUG    Main         Item Sonstiges.Uhrzeit = 08:40:17 via KNX 0.0.0 14/2/2 -- item.py:__update:363
          2014-02-12 08:40:17,409 DEBUG    Main         knx: 0.0.0 set 14/2/1 to 2014-02-12 -- __init__.py:parse_telegram:190
          2014-02-12 08:40:17,417 DEBUG    Main         Item Sonstiges.Datum = 2014-02-12 via KNX 0.0.0 14/2/1 -- item.py:__update:363
          2014-02-12 08:40:17,888 DEBUG    Scheduler    KNX time next time: 2014-02-12 08:50:17+01:00 -- scheduler.py:_next_time:289
          2014-02-12 08:40:17,898 INFO     hello        Hello World! -- hello.py:<module>:3
          2014-02-12 08:40:17,980 DEBUG    env_init     Item env.core.version = 1.0-5-g5300605+ via Logic None None -- item.py:__update:363
          2014-02-12 08:40:17,988 DEBUG    sh.gc        Garbage collector: collected 0 objects. -- smarthome.py:_garbage_collection:498
          2014-02-12 08:40:17,996 DEBUG    env_init     Item env.core.start = 2014-02-12 08:40:17.992079+01:00 via Logic None None -- item.py:__update:363
          2014-02-12 08:40:18,030 DEBUG    env_init     Item env.system.name = smarthome.local via Logic None None -- item.py:__update:363
          2014-02-12 08:40:18,067 DEBUG    env_init     Item env.system.start = 2014-02-12 08:39:32.063627+01:00 via Logic None None -- item.py:__update:363
          2014-02-12 08:40:18,210 DEBUG    sh.gc        Object references: 9473 -- smarthome.py:_maintenance:490
          2014-02-12 08:40:18,515 DEBUG    Scheduler    sh.gc next time: 2014-02-13 02:04:00+01:00 -- scheduler.py:_next_time:289
          2014-02-12 08:40:18,989 INFO     hello        Smarthome -- hello.py:<module>:9
          2014-02-12 08:40:18,997 DEBUG    hello        Item UG.Buero.Rollo.Rollo_Carport.step = True via Logic None None -- item.py:__update:363
          2014-02-12 08:40:19,013 DEBUG    Main         knx: 0.0.0 set 10/2/3 to True -- __init__.py:parse_telegram:190
          2014-02-12 08:40:19,020 DEBUG    hello        Triggering rollo_move - by: Item source: UG.Buero.Rollo.Rollo_Carport.step dest: None value: True -- scheduler.py:trigger:162
          2014-02-12 08:40:19,034 INFO     hello        Timer -- hello.py:<module>:12
          2014-02-12 08:40:19,025 DEBUG    Main         Triggering rollo_move - by: Item source: UG.Buero.Rollo.Rollo_Carport.step dest: None value: True -- scheduler.py:trigger:162
          2014-02-12 08:40:19,043 INFO     rollo_move   Input: UG.Buero.Rollo.Rollo_Carport.step/ True (True=AB) / Richtung alt: 0 (+1 = AB) / Art alt: -1 -- rollo.py:<module>:139
          2014-02-12 08:40:19,052 INFO     rollo_move     Changed by: Logic:None -- rollo.py:<module>:140
          2014-02-12 08:40:19,056 INFO     rollo_move   Input: UG.Buero.Rollo.Rollo_Carport.step/ True (True=AB) / Richtung alt: 0 (+1 = AB) / Art alt: -1 -- rollo.py:<module>:139
          2014-02-12 08:40:19,061 INFO     rollo_move   {'dest': None, 'source': 'UG.Buero.Rollo.Rollo_Carport.step', 'by': 'Item', 'value': True} -- rollo.py:<module>:141
          2014-02-12 08:40:19,075 INFO     rollo_move     Changed by: Logic:None -- rollo.py:<module>:140
          2014-02-12 08:40:19,080 INFO     rollo_move   {'dest': None, 'source': 'UG.Buero.Rollo.Rollo_Carport.step', 'by': 'Item', 'value': True} -- rollo.py:<module>:141
          2014-02-12 08:40:20,545 DEBUG    Main         knx: 0.0.0 set 10/2/3 to True -- __init__.py:parse_telegram:190
          2014-02-12 08:40:20,557 DEBUG    Main         Triggering rollo_move - by: Item source: UG.Buero.Rollo.Rollo_Carport.step dest: None value: True -- scheduler.py:trigger:162
          2014-02-12 08:40:20,548 DEBUG    UG.Buero.Rollo.Rollo_Carport.step-Timer Triggering rollo_move - by: Item source: UG.Buero.Rollo.Rollo_Carport.step dest: None value: True -- scheduler.py:trigger:162
          2014-02-12 08:40:20,569 INFO     rollo_move   Input: UG.Buero.Rollo.Rollo_Carport.step/ True (True=AB) / Richtung alt: 0 (+1 = AB) / Art alt: -1 -- rollo.py:<module>:139
          2014-02-12 08:40:20,576 INFO     rollo_move     Changed by: Logic:None -- rollo.py:<module>:140
          2014-02-12 08:40:20,573 INFO     rollo_move   Input: UG.Buero.Rollo.Rollo_Carport.step/ True (True=AB) / Richtung alt: 0 (+1 = AB) / Art alt: -1 -- rollo.py:<module>:139
          2014-02-12 08:40:20,585 INFO     rollo_move   {'dest': None, 'source': 'UG.Buero.Rollo.Rollo_Carport.step', 'by': 'Item', 'value': True} -- rollo.py:<module>:141
          2014-02-12 08:40:20,595 INFO     rollo_move     Changed by: Logic:None -- rollo.py:<module>:140
          2014-02-12 08:40:20,600 INFO     rollo_move   {'dest': None, 'source': 'UG.Buero.Rollo.Rollo_Carport.step', 'by': 'Item', 'value': True} -- rollo.py:<module>:141
          2014-02-12 08:40:24,129 DEBUG    env_stat     Item env.core.memory = 16920576 via Logic None None -- item.py:__update:363
          2014-02-12 08:40:24,152 DEBUG    env_stat     Item env.system.load = 0.4 via Logic None None -- item.py:__update:363
          2014-02-12 08:40:24,167 DEBUG    env_stat     Item env.location.moonlight = 93 via Logic None None -- item.py:__update:363
          2014-02-12 08:40:24,568 DEBUG    Scheduler    env_stat next time: 2014-02-12 08:45:24+01:00 -- scheduler.py:_next_time:289
          -------------------------------------------------------------------------------------------------------------------
          jetzt folgt Bedienung aus smartVisu
          -------------------------------------------------------------------------------------------------------------------
          2014-02-12 08:41:51,992 DEBUG    Scheduler    RRDtool next time: 2014-02-12 08:46:51+01:00 -- scheduler.py:_next_time:289
          2014-02-12 08:41:56,347 DEBUG    Main         WebSocket: incoming connection from 192.168.1.108:51575 to 0.0.0.0:2424 -- connection.py:accept:187
          2014-02-12 08:41:56,557 DEBUG    Main         192.168.1.108:51575 sent '{"cmd":"proto","ver":3}' -- __init__.py:json_parse:269
          2014-02-12 08:41:56,570 DEBUG    Main         192.168.1.108:51575 sent '{"cmd":"monitor","items":["UG.Buero.Rollo.Rollo_Carport.move","UG.Buero.Rollo.Rollo_Carport.zielproz","UG.Buero.Rollo.Rollo_Carport.step"]}' -- __init__.py:json_parse:269
          2014-02-12 08:41:58,318 DEBUG    Main         192.168.1.108:51575 sent '{"cmd":"item","id":"UG.Buero.Rollo.Rollo_Carport.move","val":"0"}' -- __init__.py:json_parse:269
          2014-02-12 08:41:58,331 DEBUG    Main         Triggering rollo_move - by: Item source: UG.Buero.Rollo.Rollo_Carport.move dest: None value: False -- scheduler.py:trigger:162
          2014-02-12 08:41:58,341 INFO     rollo_move   Input: UG.Buero.Rollo.Rollo_Carport.move/ False (True=AB) / Richtung alt: 0 (+1 = AB) / Art alt: -1 -- rollo.py:<module>:139
          2014-02-12 08:41:58,345 INFO     rollo_move     Changed by: Init:None -- rollo.py:<module>:140
          2014-02-12 08:41:58,351 DEBUG    Main         knx: 0.0.0 set 10/2/4 to False -- __init__.py:parse_telegram:190
          2014-02-12 08:41:58,362 DEBUG    Main         Triggering rollo_move - by: Item source: UG.Buero.Rollo.Rollo_Carport.move dest: None value: False -- scheduler.py:trigger:162
          2014-02-12 08:41:58,356 INFO     rollo_move   {'dest': None, 'source': 'UG.Buero.Rollo.Rollo_Carport.move', 'by': 'Item', 'value': False} -- rollo.py:<module>:141
          2014-02-12 08:41:58,381 INFO     rollo_move   Input: UG.Buero.Rollo.Rollo_Carport.move/ False (True=AB) / Richtung alt: 0 (+1 = AB) / Art alt: -1 -- rollo.py:<module>:139
          2014-02-12 08:41:58,384 INFO     rollo_move     Changed by: Init:None -- rollo.py:<module>:140
          2014-02-12 08:41:58,389 INFO     rollo_move   {'dest': None, 'source': 'UG.Buero.Rollo.Rollo_Carport.move', 'by': 'Item', 'value': False} -- rollo.py:<module>:141
          2014-02-12 08:41:58,937 DEBUG    Main         knx: 1.1.37 set 14/1/2 to 00 -- __init__.py:parse_telegram:181
          2014-02-12 08:42:01,309 DEBUG    Main         192.168.1.108:51575 sent '{"cmd":"item","id":"UG.Buero.Rollo.Rollo_Carport.step","val":"1"}' -- __init__.py:json_parse:269
          2014-02-12 08:42:01,316 DEBUG    Main         Triggering rollo_move - by: Item source: UG.Buero.Rollo.Rollo_Carport.step dest: None value: True -- scheduler.py:trigger:162
          2014-02-12 08:42:01,333 INFO     rollo_move   Input: UG.Buero.Rollo.Rollo_Carport.step/ True (True=AB) / Richtung alt: 0 (+1 = AB) / Art alt: -1 -- rollo.py:<module>:139
          2014-02-12 08:42:01,336 INFO     rollo_move     Changed by: Logic:None -- rollo.py:<module>:140
          2014-02-12 08:42:01,346 INFO     rollo_move   {'dest': None, 'source': 'UG.Buero.Rollo.Rollo_Carport.step', 'by': 'Item', 'value': True} -- rollo.py:<module>:141
          2014-02-12 08:42:01,343 DEBUG    Main         knx: 0.0.0 set 10/2/3 to True -- __init__.py:parse_telegram:190
          2014-02-12 08:42:01,369 DEBUG    Main         Triggering rollo_move - by: Item source: UG.Buero.Rollo.Rollo_Carport.step dest: None value: True -- scheduler.py:trigger:162
          2014-02-12 08:42:01,376 INFO     rollo_move   Input: UG.Buero.Rollo.Rollo_Carport.step/ True (True=AB) / Richtung alt: 0 (+1 = AB) / Art alt: -1 -- rollo.py:<module>:139
          2014-02-12 08:42:01,379 INFO     rollo_move     Changed by: Logic:None -- rollo.py:<module>:140
          2014-02-12 08:42:01,383 INFO     rollo_move   {'dest': None, 'source': 'UG.Buero.Rollo.Rollo_Carport.step', 'by': 'Item', 'value': True} -- rollo.py:<module>:141
          -------------------------------------------------------------------------------------------------------------------
          jetzt folgt Bedienung über KNX-Bus
          -------------------------------------------------------------------------------------------------------------------
          2014-02-12 08:43:01,649 DEBUG    Main         knx: 1.1.33 set 10/3/2 to 00 -- __init__.py:parse_telegram:181
          2014-02-12 08:43:29,398 DEBUG    Main         knx: 1.1.33 set 10/2/3 to False -- __init__.py:parse_telegram:190
          2014-02-12 08:43:29,403 DEBUG    Main         Item UG.Buero.Rollo.Rollo_Carport.step = False via KNX 1.1.33 10/2/3 -- item.py:__update:363
          2014-02-12 08:43:29,419 DEBUG    Main         Triggering rollo_move - by: Item source: UG.Buero.Rollo.Rollo_Carport.step dest: None value: False -- scheduler.py:trigger:162
          2014-02-12 08:43:29,427 INFO     rollo_move   Input: UG.Buero.Rollo.Rollo_Carport.step/ False (True=AB) / Richtung alt: 0 (+1 = AB) / Art alt: -1 -- rollo.py:<module>:139
          2014-02-12 08:43:29,431 INFO     rollo_move     Changed by: KNX:1.1.33 -- rollo.py:<module>:140
          2014-02-12 08:43:29,440 INFO     rollo_move   {'dest': None, 'source': 'UG.Buero.Rollo.Rollo_Carport.step', 'by': 'Item', 'value': False} -- rollo.py:<module>:141
          2014-02-12 08:43:29,600 DEBUG    Main         knx: 1.1.33 set 10/2/4 to False -- __init__.py:parse_telegram:190
          2014-02-12 08:43:29,611 DEBUG    Main         Triggering rollo_move - by: Item source: UG.Buero.Rollo.Rollo_Carport.move dest: None value: False -- scheduler.py:trigger:162
          2014-02-12 08:43:29,624 INFO     rollo_move   Input: UG.Buero.Rollo.Rollo_Carport.move/ False (True=AB) / Richtung alt: 0 (+1 = AB) / Art alt: -1 -- rollo.py:<module>:139
          2014-02-12 08:43:29,627 INFO     rollo_move     [B][COLOR="Red"]Changed by: Init:None[/COLOR][/B] -- rollo.py:<module>:140
          2014-02-12 08:43:29,631 INFO     rollo_move   {'dest': None, 'source': 'UG.Buero.Rollo.Rollo_Carport.move', 'by': 'Item', 'value': False} -- rollo.py:<module>:141
          2014-02-12 08:43:32,728 DEBUG    Main         knx: 1.1.33 set 10/2/3 to True -- __init__.py:parse_telegram:190
          2014-02-12 08:43:32,733 DEBUG    Main         Item UG.Buero.Rollo.Rollo_Carport.step = True via KNX 1.1.33 10/2/3 -- item.py:__update:363
          2014-02-12 08:43:32,750 DEBUG    Main         Triggering rollo_move - by: Item source: UG.Buero.Rollo.Rollo_Carport.step dest: None value: True -- scheduler.py:trigger:162
          2014-02-12 08:43:32,760 INFO     rollo_move   Input: UG.Buero.Rollo.Rollo_Carport.step/ True (True=AB) / Richtung alt: 0 (+1 = AB) / Art alt: -1 -- rollo.py:<module>:139
          2014-02-12 08:43:32,763 INFO     rollo_move     Changed by: KNX:1.1.33 -- rollo.py:<module>:140
          2014-02-12 08:43:32,770 INFO     rollo_move   {'dest': None, 'source': 'UG.Buero.Rollo.Rollo_Carport.step', 'by': 'Item', 'value': True} -- rollo.py:<module>:141
          2014-02-12 08:43:34,221 DEBUG    Main         knx: 1.1.33 set 10/2/3 to True -- __init__.py:parse_telegram:190
          2014-02-12 08:43:34,227 DEBUG    Main         Triggering rollo_move - by: Item source: UG.Buero.Rollo.Rollo_Carport.step dest: None value: True -- scheduler.py:trigger:162
          2014-02-12 08:43:34,244 INFO     rollo_move   Input: UG.Buero.Rollo.Rollo_Carport.step/ True (True=AB) / Richtung alt: 0 (+1 = AB) / Art alt: -1 -- rollo.py:<module>:139
          2014-02-12 08:43:34,247 INFO     rollo_move     Changed by: KNX:1.1.33 -- rollo.py:<module>:140
          2014-02-12 08:43:34,251 INFO     rollo_move   {'dest': None, 'source': 'UG.Buero.Rollo.Rollo_Carport.step', 'by': 'Item', 'value': True} -- rollo.py:<module>:141
          2014-02-12 08:43:34,551 DEBUG    Main         knx: 1.1.33 set 10/2/4 to True -- __init__.py:parse_telegram:190
          2014-02-12 08:43:34,573 DEBUG    Main         Item UG.Buero.Rollo.Rollo_Carport.move = True via KNX 1.1.33 10/2/4 -- item.py:__update:363
          2014-02-12 08:43:34,585 DEBUG    Main         Triggering rollo_move - by: Item source: UG.Buero.Rollo.Rollo_Carport.move dest: None value: True -- scheduler.py:trigger:162
          2014-02-12 08:43:34,597 INFO     rollo_move   Input: UG.Buero.Rollo.Rollo_Carport.move/ True (True=AB) / Richtung alt: 0 (+1 = AB) / Art alt: -1 -- rollo.py:<module>:139
          2014-02-12 08:43:34,600 INFO     rollo_move     Changed by: KNX:1.1.33 -- rollo.py:<module>:140
          2014-02-12 08:43:34,605 INFO     rollo_move   {'dest': None, 'source': 'UG.Buero.Rollo.Rollo_Carport.move', 'by': 'Item', 'value': True} -- rollo.py:<module>:141
          2014-02-12 08:43:36,881 DEBUG    Main         knx: 1.1.33 set 10/2/3 to True -- __init__.py:parse_telegram:190
          2014-02-12 08:43:36,887 DEBUG    Main         Triggering rollo_move - by: Item source: UG.Buero.Rollo.Rollo_Carport.step dest: None value: True -- scheduler.py:trigger:162
          2014-02-12 08:43:36,903 INFO     rollo_move   Input: UG.Buero.Rollo.Rollo_Carport.step/ True (True=AB) / Richtung alt: 0 (+1 = AB) / Art alt: -1 -- rollo.py:<module>:139
          2014-02-12 08:43:36,906 INFO     rollo_move     Changed by: KNX:1.1.33 -- rollo.py:<module>:140
          2014-02-12 08:43:36,910 INFO     rollo_move   {'dest': None, 'source': 'UG.Buero.Rollo.Rollo_Carport.step', 'by': 'Item', 'value': True} -- rollo.py:<module>:141
          trigger liefert immer die gleiche Information.
          changed_by kann zumindest meist KNX erkennen. Das funktioniert aber auch nicht zuverlässig. Einmal (oben rot markiert) wird Init gemeldet, obwohl die Änderung vom Bus kam. Bei der Bedienung aus smartVisu wird entweder Logic oder Init ausgegeben. Änderungen aus Python oder durch einen Trigger haben in diesem Beispiel immer Logic.

          Falls ich keinen Denkfehler drin habe und es keine andere Möglichkeit gibt und es sich auch um keinen Bug in sH/sV handelt, dann muss ich wohl oder übel zusätzliche Items einführen, die zwar alle auf die gleiche Bus-Adresse gehen, aber von unterschiedlichen Stellen getriggert werden.

          Gruß
          Peter

          Kommentar


            #6
            Hi Peter,

            das mit dem Init ist kein Bug, aus meiner Sicht.
            Das musst Du in Deiner Logik abfragen.

            Bis bald

            Marcus

            Kommentar


              #7
              Zitat von mknx Beitrag anzeigen
              das mit dem Init ist kein Bug, aus meiner Sicht.
              Das musst Du in Deiner Logik abfragen.
              Was meinst Du damit? Die Zeile kommt ja aus meiner Logik:

              Code:
              logger.info('  Changed by: ' + str(source.changed_by()))
              Gruß
              Peter

              Kommentar


                #8
                Hi,

                so etwas:

                Code:
                if source.changed_by() == 'Init:None':
                   do something
                
                elif source.changed_by().startswith('KNX'):
                    do something else
                Bis bald

                Marcus

                Kommentar


                  #9
                  Das hatte ich auch vor, aber dazu muss die Funktion source.changed_by() auch den richtigen Wert liefern. Und das ist definitiv nicht so.

                  Gruß
                  Peter

                  Kommentar


                    #10
                    Hi Peter,

                    das liegt an dem initialen Wert von dem Item. Jedes Item wird mit einem default Wert initialisiert (num = 0, bool = False, ...), solange das nicht geändert wird, bleibt changed_by auf Init.

                    Das ist einfach so und musst Du akzeptieren, oder einen guten Patch einreichen.
                    Mit ist bis jetzt noch keine sinnvolle/praktikable Möglichkeit eingefallen wie ich diesen Umstand ändern sollte.

                    Evtl. könnte Dir ein cache Attribut helfen, Deine erwartetes Verhalten zu erreichen.

                    Bis bald

                    Marcus

                    Kommentar


                      #11
                      Hallo Marcus,

                      das mit dem Cache Attribut probiere ich gerne aus.

                      Zitat von mknx Beitrag anzeigen
                      Das ist einfach so und musst Du akzeptieren, oder einen guten Patch einreichen.
                      Mit ist bis jetzt noch keine sinnvolle/praktikable Möglichkeit eingefallen wie ich diesen Umstand ändern sollte.
                      Meine Postings von oben waren nicht als Kritik gedacht, falls Du das so aufgefasst hast. Dazu habt Ihr viel zu viel geleistet und ein super Tool entwickelt als dass ich mir anmaßen würde, dies zu kritisieren.

                      Was ich nur sagen wollte ist, wenn sH weiß, dass knx einen Wert geschrieben hat (DEBUG-Eintrag 3 Zeilen vor dem rot markierten), dann könnte man ja das changed_by() auf KNX setzen, auch wenn der geschriebene Wert identisch zu dem vorherigen ist. Oder man würde eine weitere Funktion einführen written_by(), die anzeigt, wer als letztes dieses Item geschrieben hat, unabhängig davon, ob es geändert wurde oder nicht. Das wäre wahrscheinlich eine bessere Lösung.

                      Wenn ich die Logik von sH durchschauen würde, dann bekämst Du auch einen Vorschlag für einen Patch von mir, aber derzeit bin ich froh, wenn ich es schaffe, Python, Twix und js so hinzukriegen, dass das passiert, was ich gerne möchte ;-)

                      Gruß und schönes WE
                      Peter

                      Kommentar


                        #12
                        Hi Peter,

                        ich habe es nicht als Kritik aufgefasst.

                        Über Deinen Vorschlag bzgl. written_by bzw. updated_by denke ich noch mal nach.

                        Bis bald

                        Marcus

                        Kommentar


                          #13
                          OK, prima. Und ich mach' mich mal an das Update von Rolladen positionieren.

                          Gruß
                          Peter

                          Kommentar

                          Lädt...
                          X