Ankündigung

Einklappen
Keine Ankündigung bisher.

HUE Plugin, Probleme bei der Benutzung/Einrichtung

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

    [Handbuch] HUE Plugin, Probleme bei der Benutzung/Einrichtung

    Hallo,
    ich möchte gerne die Philips HUE an meine restliche KNX Installation anbinden.
    Es ist ziemlich unsmart, jedesmal das Handy für etwas Licht zu zücken.

    Gleichzeitig möchte ich so das Thema: "Stehlampen (dimmbar)" erschlagen.
    (... wie hier mehrfacch gelesen, ist das öfter ein Problem)
    zB: https://knx-user-forum.de/knx-eib-fo...e-per-knx.html

    Ziel ist es erstmal, die Lampen über einen KNX-Tastsensor (GA) zu dimmen.
    Da ich im Alleingang gescheitert bin was die Benutzung und Einrichtung des Plugins betrifft, möchte ich es hier einmal "laut" überdenken und nachvolziehbar
    festhalten. (Zweitziel: Tutorial fürs Wiki)

    Ausgangslage/ Komponenten:
    1) Philips HUE incl. Bridge (eingerichted und functionsfähig über Handy App)
    2) MDT Glastaster (bei mir, es kann aber auch ein anderer TS sein)
    3)funktionsfähige SH.py Umgebung (hier: Raspberry mit dem SH/SV image)
    von hier:https://knx-user-forum.de/smarthome-...-pi-2-1-a.html
    aufgesetzt wie hier: https://github.com/mknx/smarthome/wiki/SmartHome.pi

    In der Liste der Plugins für SH.py gibt es bereits eines für die HUE.
    Plugins ? SmartHome.py 1.0 documentation
    Phillips HUE ? SmartHome.py 1.0 documentation


    Im Folgenden, beschreibe ich mal mein Vorgehen, um zu sehen wo der/die Fehler liegen.

    1. Step: (Plugin aktivieren, bekannt machen)
    Folgendes habe ich an die plugin.conf (/usr/smarthome/etc/plugin.conf) angefügt
    Code:
    [HUE]
       class_name = HUE
       class_path = plugins.hue
       hue_user = 38f625a739562a8bd261ab9c7f5e62c8
    Die UserID ist beliebig wählbar und dient, wenn authorisiert, als Key für die externe Applikation zur Nutzung der API.
    Man kann die ID auch im Debugger der Hue-Bridge "generieren" (d.h. beliebig wählen und registrieren) und dann diese ID in die Config eintragen:
    http://www.developers.meethue.com/do...etting-started

    Ich habe einfach den aus der plugin Docu genommen.


    2. Step: (HUE Items anlegen)
    Eine neue Item Datei anlegen um den Rest(Items) nicht zu verändern.
    Datei liegt unter: /usr/smarthome/items/hue_items.conf
    Code:
    # items/hue_items.conf
     
    [huebulbs]
        [[hue1]]
                type = bool
                hue_id = 1
            [[[level]]]
                type = num
                hue_id = 1
            [[[effect]]]
                type = str
                hue_id = 1
                hue_feature = effect
            [[[all]]]
                type = dict
                hue_id = 1
                hue_feature = all
        [[hue2]]
                type = bool
                hue_id = 2
            [[[level]]]
                type = num
                hue_id = 2
            [[[effect]]]
                type = str
                hue_id = 2
                hue_feature = effect
            [[[all]]]
                type = dict
                hue_id = 2
                hue_feature = all
        [[hue3]]
                type = bool
                hue_id = 3
            [[[level]]]
                type = num
                hue_id = 3
            [[[effect]]]
                type = str
                hue_id = 3
                hue_feature = effect
            [[[all]]]
                type = dict
                hue_id = 3
                hue_feature = all
    2a. Step: (alternative HUE Items anlegen)
    Eine neue Item Datei anlegen um den Rest(Items) nicht zu verändern.
    Die Items sind so gewählt, dass beide .confs parallel existieren können
    Datei liegt unter: /usr/smarthome/items/hue_neu_items.conf
    Code:
    # items/hue_neu_items.conf
     
    [huebulb]
        [[hue_01]]
            [[[on_off]]]
                type = bool
                cache = on
                hue_id = 1
            [[[bri]]]
                type = num
                cache = on
            [[[sat]]]
                type = num
                cache = on
            [[[hue]]]
                type = num
                cache = on
            [[[control]]]
                type = dict   
                cache = on
                hue_id = 1
                eval = dict({'sat': sh.huebulb.hue_01.sat(),'bri': sh.huebulb.hue_01.bri(),'hue': sh.huebulb.hue_01.hue()})
                eval_trigger = huebulb.hue_01.bri | huebulb.hue_01.sat | huebulb.hue_01.hue
        [[hue_02]]
            [[[on_off]]]
                type = bool
                cache = on
                hue_id = 2
            [[[bri]]]
                type = num
                cache = on
            [[[sat]]]
                type = num
                cache = on
            [[[hue]]]
                type = num
                cache = on
            [[[control]]]
                type = dict   
                cache = on
                hue_id = 2
                eval = dict({'sat': sh.huebulb.hue_02.sat(),'bri': sh.huebulb.hue_02.bri(),'hue': sh.huebulb.hue_02.hue()})
                eval_trigger = huebulb.hue_02.bri | huebulb.hue_02.sat | huebulb.hue_02.hue
        [[hue_03]]
            [[[on_off]]]
                type = bool
                cache = on
                hue_id = 3
            [[[bri]]]
                type = num
                cache = on
            [[[sat]]]
                type = num
                cache = on
            [[[hue]]]
                type = num
                cache = on
            [[[control]]]
                type = dict   
                cache = on
                hue_id = 3
                eval = dict({'sat': sh.huebulb.hue_03.sat(),'bri': sh.huebulb.hue_03.bri(),'hue': sh.huebulb.hue_03.hue()})
                eval_trigger = huebulb.hue_03.bri | huebulb.hue_03.sat | huebulb.hue_03.hue
    3. Step: Restart SH
    SSH connection aufbauen, wenn nicht schon geschehen und eingeben:
    (alternative ist auch ein restart über das Webinterface möglich)
    Code:
    /usr/smarthome/bin/smarthome.py –-stop
    /usr/smarthome/bin/smarthome.py –-start

    4. Step: Restart SH im interaktive Modus
    SSH connection aufbauen, wenn nicht schon geschehen und eingeben:
    Code:
    /usr/smarthome/bin/smarthome.py –-stop
    /usr/smarthome/bin/smarthome.py –i
    5. Step: Authorisierung des HUE users
    in der SSH console hat man nun die Möglichkeit nach den ">>>" direkt mit SH.py zu interagieren.
    a) Link-Taste an der Bridge drücken.

    b) Eingabe im interaktive Modus
    Wichtig: Großbuchstaben beachten, scheinbar ein Unterschied zur Plugin Doku
    Code:
    sh.HUE.authorizeuser()
    Fehlermeldung:
    Cursor braucht lange (2min) um zurück zu kommen.
    Code:
    >>> sh.HUE.authorizeuser()
    Traceback (most recent call last):
      File "<console>", line 1, in <module>
      File "/usr/smarthome/plugins/hue/__init__.py", line 222, in authorizeuser
        con.request("POST", "/api", data)
      File "/usr/lib/python3.2/http/client.py", line 970, in request
        self._send_request(method, url, body, headers)
      File "/usr/lib/python3.2/http/client.py", line 1008, in _send_request
        self.endheaders(body)
      File "/usr/lib/python3.2/http/client.py", line 966, in endheaders
        self._send_output(message_body)
      File "/usr/lib/python3.2/http/client.py", line 811, in _send_output
        self.send(msg)
      File "/usr/lib/python3.2/http/client.py", line 749, in send
        self.connect()
      File "/usr/lib/python3.2/http/client.py", line 727, in connect
        self.timeout, self.source_address)
      File "/usr/lib/python3.2/socket.py", line 415, in create_connection
        raise err
      File "/usr/lib/python3.2/socket.py", line 406, in create_connection
        sock.connect(sa)
    socket.error: [Errno 110] Connection timed out
    Fehlermeldung mal anders:
    Wenn man eine User nimmt, der im Debugger der HUE schon bekannt war, gibt es eine andere Fehlermeldung.
    Cursor ist sofort wieder da.
    Code:
    >>> sh.HUE.authorizeuser()
    Traceback (most recent call last):
      File "<console>", line 1, in <module>
      File "/usr/smarthome/plugins/hue/__init__.py", line 233, in authorizeuser
        resp = json.loads(resp)
      File "/usr/lib/python3.2/json/__init__.py", line 309, in loads
        return _default_decoder.decode(s)
      File "/usr/lib/python3.2/json/decoder.py", line 353, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    TypeError: can't use a string pattern on a bytes-like object
    6. Step: Restart SH
    SSH connection aufbauen, wenn nicht schon geschehen und eingeben:
    Code:
    /usr/smarthome/bin/smarthome.py –-stop
    /usr/smarthome/bin/smarthome.py –d
    Log Ausgabe beachten, keine Fehlermeldung bezüglich der Autorisierung
    Code:
    2014-11-05 22:35:02,806 INFO     Main         Start SmartHome.py 1.0-5-g5300605 -- smarthome.py:__init__:231
    2014-11-05 22:35:02,811 DEBUG    Main         Python 3.2.3 -- smarthome.py:__init__:232
    2014-11-05 22:35:02,817 INFO     Main         Init Scheduler -- scheduler.py:__init__:86
    2014-11-05 22:35:02,824 INFO     Main         Init Plugins -- smarthome.py:start:274
    2014-11-05 22:35:02,836 DEBUG    Scheduler    creating 5 workers -- scheduler.py:run:93
    2014-11-05 22:35:02,851 DEBUG    Main         Plugin: knx -- plugin.py:__init__:43
    2014-11-05 22:35:02,883 DEBUG    Main         Plugin: visu -- plugin.py:__init__:43
    2014-11-05 22:35:02,973 DEBUG    Main         Plugin: cli -- plugin.py:__init__:43
    2014-11-05 22:35:02,986 DEBUG    Main         Plugin: sql -- plugin.py:__init__:43
    2014-11-05 22:35:03,019 DEBUG    Main         SQLite 3.7.13 -- __init__.py:__init__:62
    2014-11-05 22:35:05,512 DEBUG    Main         SQLite: database integrity ok -- __init__.py:__init__:78
    2014-11-05 22:35:05,539 DEBUG    Main         SQLite pack next time: 2014-11-06 03:02:00+01:00 -- scheduler.py:_next_time:289
    2014-11-05 22:35:05,545 DEBUG    Main         Plugin: HUE -- plugin.py:__init__:43
    2014-11-05 22:35:05,559 DEBUG    Main         hue-update next time: 2014-11-05 22:35:17+01:00 -- scheduler.py:_next_time:289
    2014-11-05 22:35:05,564 DEBUG    Main         Triggering hue-update - by: Logic source: None dest: None value: None -- scheduler.py:trigger:162
    Das Testen der HUE ist mit den Fehlemeldungen trotzdem möglich und sollte auch trotzdem funktionieren. (jedenfals bei mir)
    So bald klar ist, was die Ursache dafür ist, könnte hier noch etwas nachgebessert werden.

    7. Step: Testen der HUE im interaktive Modus
    "Ein" und "Aus" mit Zwischenwerten geht so: z.b.
    Code:
    >>> sh.huebulbs.hue3.level(100)
    >>> sh.huebulbs.hue3.level(255)
    >>> sh.huebulbs.hue3.level(0)
    >>>
    7a. Step: Testen der HUE (alternativ Items) im interaktive Modus
    zum Beispiel:
    Code:
    >>> sh.huebulb.hue_03.on_off(1)
    >>> sh.huebulb.hue_03.on_off(0)
    >>> sh.huebulb.hue_03.sat(255)
    >>> sh.huebulb.hue_03.sat(0)
    >>> sh.huebulb.hue_03.bri(0)
    >>> sh.huebulb.hue_03.bri(255)
    >>> sh.huebulb.hue_03.hue(35000)
    >>> sh.huebulb.hue_03.hue(65000)
    >>> sh.huebulb.hue_03.hue(0)


    Ab hier werde ich unsicherer....
    (der Beitrag wird von mir immer editiert, sobald sich etwas ergibt)

    Die Funktionsbeschreibungen von sat, bri, hue muss ich noch einmal recherchieren.
    Bei den einfachen Test erschloss sich mir die Logik noch nicht ganz.


    8. Step: Farbe beeinflussen der HUE im interaktive Modus
    TBD (to be done)
    TBW (to be written)

    Ich bedanke mich jetzt schon für eure Mithilfe.
    Gruß Stefan

    #2
    Bin gerade unterwegs und erst am Wochenende wieder da, habe aber vor kurzem eine hue in Betrieb genommen. Ist etwas trickreich, wenn man mehr Funktionen verwenden will.

    Michel

    Kommentar


      #3
      Das wäre super,
      Bis dahin versuch ich mal weiter ...
      Danke

      Kommentar


        #4
        Hi,

        irgendwas passt bei Deiner geposteten Config nicht.
        1. Du verwendest HUE für das Plugin und für ein Item == Konflikt
        2. im CLI gibst Du sh.hue.... an. Woher kommt das Item?


        UPDATE: das ist nicht das CLI, sondern der interaktive Modus.

        Bis bald

        Marcus

        Kommentar


          #5
          Ich habe SH.py noch mal neu gestartet.
          Code:
          smarthome.py --stop
          smarthome.py -d

          Code:
          2014-11-05 21:34:35,719 INFO     Main         Start SmartHome.py 1.0-5-g5300605 -- smarthome.py:__init__:231
          2014-11-05 21:34:35,725 DEBUG    Main         Python 3.2.3 -- smarthome.py:__init__:232
          2014-11-05 21:34:35,731 INFO     Main         Init Scheduler -- scheduler.py:__init__:86
          2014-11-05 21:34:35,737 INFO     Main         Init Plugins -- smarthome.py:start:274
          2014-11-05 21:34:35,754 DEBUG    Scheduler    creating 5 workers -- scheduler.py:run:93
          2014-11-05 21:34:35,761 DEBUG    Main         Plugin: knx -- plugin.py:__init__:43
          2014-11-05 21:34:35,788 DEBUG    Main         Plugin: visu -- plugin.py:__init__:43
          2014-11-05 21:34:35,882 DEBUG    Main         Plugin: cli -- plugin.py:__init__:43
          2014-11-05 21:34:35,895 DEBUG    Main         Plugin: sql -- plugin.py:__init__:43
          2014-11-05 21:34:35,928 DEBUG    Main         SQLite 3.7.13 -- __init__.py:__init__:62
          2014-11-05 21:34:38,471 DEBUG    Main         SQLite: database integrity ok -- __init__.py:__init__:78
          2014-11-05 21:34:38,498 DEBUG    Main         SQLite pack next time: 2014-11-06 03:02:00+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:34:38,504 DEBUG    Main         Plugin: HUE -- plugin.py:__init__:43
          2014-11-05 21:34:38,519 DEBUG    Main         hue-update next time: 2014-11-05 21:34:53+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:34:38,524 DEBUG    Main         Triggering hue-update - by: Logic source: None dest: None value: None -- scheduler.py:trigger:162
          2014-11-05 21:34:38,529 INFO     Main         Init Items -- smarthome.py:start:280
          2014-11-05 21:34:38,768 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:34:38,819 DEBUG    Main         KNX: OG.Kind1.Deckenlicht.EinAus listen on 2/1/0 -- __init__.py:parse_item:235
          2014-11-05 21:34:38,825 DEBUG    Main         KNX: OG.Kind1.Deckenlicht.EinAus listen on and init with 2/1/0 -- __init__.py:parse_item:244
          2014-11-05 21:34:38,830 DEBUG    Main         Item OG.Kind1.Deckenlicht: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:38,855 DEBUG    Main         KNX: OG.Kind1.Rollo.pos listen on 2/3/1 -- __init__.py:parse_item:235
          2014-11-05 21:34:38,860 DEBUG    Main         Item OG.Kind1.Rollo: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:38,865 DEBUG    Main         Item OG.Kind1: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:38,882 DEBUG    Main         KNX: OG.Kind2.Deckenlicht.EinAus listen on 2/1/3 -- __init__.py:parse_item:235
          2014-11-05 21:34:38,887 DEBUG    Main         KNX: OG.Kind2.Deckenlicht.EinAus listen on and init with 2/1/3 -- __init__.py:parse_item:244
          2014-11-05 21:34:38,892 DEBUG    Main         Item OG.Kind2.Deckenlicht: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:38,916 DEBUG    Main         KNX: OG.Kind2.Rollo.pos listen on 2/3/1 -- __init__.py:parse_item:235
          2014-11-05 21:34:38,921 DEBUG    Main         Item OG.Kind2.Rollo: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:38,925 DEBUG    Main         Item OG.Kind2: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:38,943 DEBUG    Main         KNX: OG.Kinderbad.Deckenlicht.EinAus listen on 2/1/6 -- __init__.py:parse_item:235
          2014-11-05 21:34:38,947 DEBUG    Main         KNX: OG.Kinderbad.Deckenlicht.EinAus listen on and init with 2/1/6 -- __init__.py:parse_item:244
          2014-11-05 21:34:38,952 DEBUG    Main         Item OG.Kinderbad.Deckenlicht: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:38,976 DEBUG    Main         KNX: OG.Kinderbad.Rollo.pos listen on 2/3/1 -- __init__.py:parse_item:235
          2014-11-05 21:34:38,981 DEBUG    Main         Item OG.Kinderbad.Rollo: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:38,986 DEBUG    Main         Item OG.Kinderbad: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,006 DEBUG    Main         KNX: OG.Flur.Deckenlicht.EinAus listen on 2/1/9 -- __init__.py:parse_item:235
          2014-11-05 21:34:39,010 DEBUG    Main         KNX: OG.Flur.Deckenlicht.EinAus listen on and init with 2/1/9 -- __init__.py:parse_item:244
          2014-11-05 21:34:39,016 DEBUG    Main         Item OG.Flur.Deckenlicht: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,039 DEBUG    Main         KNX: OG.Flur.Rollo.pos listen on 2/3/1 -- __init__.py:parse_item:235
          2014-11-05 21:34:39,044 DEBUG    Main         Item OG.Flur.Rollo: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,049 DEBUG    Main         Item OG.Flur: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,054 DEBUG    Main         Item OG: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,072 DEBUG    Main         parse item: hue.hue1.level -- __init__.py:parse_item:52
          2014-11-05 21:34:39,081 DEBUG    Main         parse item: hue.hue1.effect -- __init__.py:parse_item:52
          2014-11-05 21:34:39,091 DEBUG    Main         parse item: hue.hue1.all -- __init__.py:parse_item:52
          2014-11-05 21:34:39,096 DEBUG    Main         parse item: hue.hue1 -- __init__.py:parse_item:52
          2014-11-05 21:34:39,110 DEBUG    Main         parse item: hue.hue2.level -- __init__.py:parse_item:52
          2014-11-05 21:34:39,120 DEBUG    Main         parse item: hue.hue2.effect -- __init__.py:parse_item:52
          2014-11-05 21:34:39,130 DEBUG    Main         parse item: hue.hue2.all -- __init__.py:parse_item:52
          2014-11-05 21:34:39,135 DEBUG    Main         parse item: hue.hue2 -- __init__.py:parse_item:52
          2014-11-05 21:34:39,149 DEBUG    Main         parse item: hue.hue3.level -- __init__.py:parse_item:52
          2014-11-05 21:34:39,159 DEBUG    Main         parse item: hue.hue3.effect -- __init__.py:parse_item:52
          2014-11-05 21:34:39,169 DEBUG    Main         parse item: hue.hue3.all -- __init__.py:parse_item:52
          2014-11-05 21:34:39,174 DEBUG    Main         parse item: hue.hue3 -- __init__.py:parse_item:52
          2014-11-05 21:34:39,179 DEBUG    Main         Item hue: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,201 DEBUG    Main         KNX: EG.Kueche.Deckenlicht.EinAus listen on 1/1/0 -- __init__.py:parse_item:235
          2014-11-05 21:34:39,205 DEBUG    Main         KNX: EG.Kueche.Deckenlicht.EinAus listen on and init with 1/1/0 -- __init__.py:parse_item:244
          2014-11-05 21:34:39,210 DEBUG    Main         Item EG.Kueche.Deckenlicht: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,234 DEBUG    Main         KNX: EG.Kueche.Rollo.pos listen on 2/3/1 -- __init__.py:parse_item:235
          2014-11-05 21:34:39,239 DEBUG    Main         Item EG.Kueche.Rollo: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,244 DEBUG    Main         Item EG.Kueche: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,261 DEBUG    Main         KNX: EG.Esszimmer.Deckenlicht.EinAus listen on 1/1/9 -- __init__.py:parse_item:235
          2014-11-05 21:34:39,265 DEBUG    Main         KNX: EG.Esszimmer.Deckenlicht.EinAus listen on and init with 1/1/9 -- __init__.py:parse_item:244
          2014-11-05 21:34:39,270 DEBUG    Main         Item EG.Esszimmer.Deckenlicht: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,294 DEBUG    Main         KNX: EG.Esszimmer.Rollo.pos listen on 2/3/1 -- __init__.py:parse_item:235
          2014-11-05 21:34:39,299 DEBUG    Main         Item EG.Esszimmer.Rollo: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,304 DEBUG    Main         Item EG.Esszimmer: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,324 DEBUG    Main         KNX: EG.Wohnzimmer.Deckenlicht_vorne.EinAus listen on 1/1/15 -- __init__.py:parse_item:235
          2014-11-05 21:34:39,328 DEBUG    Main         KNX: EG.Wohnzimmer.Deckenlicht_vorne.EinAus listen on and init with 1/1/15 -- __init__.py:parse_item:244
          2014-11-05 21:34:39,334 DEBUG    Main         Item EG.Wohnzimmer.Deckenlicht_vorne: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,349 DEBUG    Main         KNX: EG.Wohnzimmer.Deckenlicht_hinten.EinAus listen on 1/1/18 -- __init__.py:parse_item:235
          2014-11-05 21:34:39,354 DEBUG    Main         KNX: EG.Wohnzimmer.Deckenlicht_hinten.EinAus listen on and init with 1/1/18 -- __init__.py:parse_item:244
          2014-11-05 21:34:39,359 DEBUG    Main         Item EG.Wohnzimmer.Deckenlicht_hinten: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,383 DEBUG    Main         KNX: EG.Wohnzimmer.Rollo_Hof.pos listen on 2/3/1 -- __init__.py:parse_item:235
          2014-11-05 21:34:39,388 DEBUG    Main         Item EG.Wohnzimmer.Rollo_Hof: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,411 DEBUG    Main         KNX: EG.Wohnzimmer.Rollo_Balkon.pos listen on 2/3/1 -- __init__.py:parse_item:235
          2014-11-05 21:34:39,416 DEBUG    Main         Item EG.Wohnzimmer.Rollo_Balkon: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,421 DEBUG    Main         Item EG.Wohnzimmer: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,426 DEBUG    Main         Item EG: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:39,999 DEBUG    Main         Item env.core.memory = 16576279.533069996 via SQLite None None -- item.py:set:457
          2014-11-05 21:34:40,554 DEBUG    Main         Item env.core.threads = 8.0 via SQLite None None -- item.py:set:457
          2014-11-05 21:34:41,095 DEBUG    Main         Item env.core.garbage = 0.0 via SQLite None None -- item.py:set:457
          2014-11-05 21:34:41,102 DEBUG    Main         Item env.core: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:41,146 DEBUG    Main         Item env.location: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:41,684 DEBUG    Main         Item env.system.load = 0.019408530805687208 via SQLite None None -- item.py:set:457
          2014-11-05 21:34:41,695 DEBUG    Main         Item env.system: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:41,700 DEBUG    Main         Item env: no type specified. -- item.py:__init__:242
          2014-11-05 21:34:41,711 INFO     Main         Start Plugins -- plugin.py:start:65
          2014-11-05 21:34:41,787 INFO     Main         Start Logics -- logic.py:__init__:33
          2014-11-05 21:34:41,792 DEBUG    Main         Reading Logics from /usr/smarthome/lib/env/logic_conf -- logic.py:_read_logics:64
          2014-11-05 21:34:41,821 DEBUG    Main         Reading Logics from /usr/smarthome/etc/logic.conf -- logic.py:_read_logics:64
          2014-11-05 21:34:41,840 DEBUG    Main         Logic: dummy -- logic.py:__init__:44
          2014-11-05 21:34:41,892 DEBUG    Connections  KNX: connected to 192.168.1.206:6720 -- connection.py:connect:384
          2014-11-05 21:34:41,897 DEBUG    Connections  KNX: enable group monitor -- __init__.py:handle_connect:117
          2014-11-05 21:34:41,906 DEBUG    Connections  KNX: init read -- __init__.py:handle_connect:123
          2014-11-05 21:34:41,903 DEBUG    Main         dummy next time: 2014-11-05 21:34:56+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:34:41,916 DEBUG    Main         Logic: hello -- logic.py:__init__:44
          2014-11-05 21:34:41,934 DEBUG    Main         Logic: env_init -- logic.py:__init__:44
          2014-11-05 21:34:41,925 DEBUG    Connections  WebSocket: binding to 192.168.1.206:2424 (TCP) -- connection.py:connect:160
          2014-11-05 21:34:41,945 DEBUG    Connections  CLI: binding to 0.0.0.0:2323 (TCP) -- connection.py:connect:160
          2014-11-05 21:34:41,955 DEBUG    Main         Logic: env_stat -- logic.py:__init__:44
          2014-11-05 21:34:41,974 DEBUG    Main         env_stat next time: 2014-11-05 21:34:56+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:34:41,979 DEBUG    Main         Logic: env_loc -- logic.py:__init__:44
          2014-11-05 21:34:42,004 DEBUG    Main         KNX: 0.0.0 read 2/1/0 -- __init__.py:parse_telegram:203
          2014-11-05 21:34:42,013 DEBUG    Main         KNX: 0.0.0 read 2/1/3 -- __init__.py:parse_telegram:203
          2014-11-05 21:34:42,024 DEBUG    Main         KNX: 0.0.0 read 2/1/6 -- __init__.py:parse_telegram:203
          2014-11-05 21:34:42,034 DEBUG    Main         KNX: 0.0.0 read 2/1/9 -- __init__.py:parse_telegram:203
          2014-11-05 21:34:42,039 DEBUG    Main         KNX: 0.0.0 read 1/1/0 -- __init__.py:parse_telegram:203
          2014-11-05 21:34:42,048 DEBUG    Main         KNX: 0.0.0 read 1/1/9 -- __init__.py:parse_telegram:203
          2014-11-05 21:34:42,055 DEBUG    Main         KNX: 0.0.0 read 1/1/15 -- __init__.py:parse_telegram:203
          2014-11-05 21:34:42,061 DEBUG    Main         KNX: 0.0.0 read 1/1/18 -- __init__.py:parse_telegram:203
          2014-11-05 21:34:42,092 DEBUG    Main         knx: 1.1.5 set 2/1/0 to False -- __init__.py:parse_telegram:190
          2014-11-05 21:34:42,108 DEBUG    Main         knx: 1.1.6 set 2/1/3 to False -- __init__.py:parse_telegram:190
          2014-11-05 21:34:42,171 DEBUG    Main         knx: 1.1.4 set 2/1/6 to False -- __init__.py:parse_telegram:190
          2014-11-05 21:34:42,190 DEBUG    Main         knx: 1.1.8 set 1/1/32 to 01 -- __init__.py:parse_telegram:181
          2014-11-05 21:34:42,236 DEBUG    Main         knx: 1.1.9 set 1/1/0 to False -- __init__.py:parse_telegram:190
          2014-11-05 21:34:42,247 DEBUG    Main         knx: 1.1.2 set 2/1/0 to False -- __init__.py:parse_telegram:190
          2014-11-05 21:34:42,271 DEBUG    Main         knx: 1.1.8 set 1/1/18 to True -- __init__.py:parse_telegram:190
          2014-11-05 21:34:42,277 DEBUG    Main         Item EG.Wohnzimmer.Deckenlicht_hinten.EinAus = True via KNX 1.1.8 1/1/18 -- item.py:__update:363
          2014-11-05 21:34:42,303 DEBUG    Main         knx: 1.1.2 set 2/1/3 to False -- __init__.py:parse_telegram:190
          2014-11-05 21:34:42,319 DEBUG    Main         knx: 1.1.2 set 2/1/6 to False -- __init__.py:parse_telegram:190
          2014-11-05 21:34:45,187 DEBUG    Main         knx: 1.1.5 set 2/5/3 to 0c10 -- __init__.py:parse_telegram:181
          2014-11-05 21:34:47,456 INFO     hello        Hello World! -- hello.py:<module>:3
          2014-11-05 21:34:47,458 DEBUG    sh.gc        Garbage collector: collected 0 objects. -- smarthome.py:_garbage_collection:498
          2014-11-05 21:34:47,468 DEBUG    env_loc      Item env.location.sunrise = 2014-11-06 07:18:49.264581+01:00 via Logic None None -- item.py:__update:363
          2014-11-05 21:34:47,461 DEBUG    env_init     Item env.core.version = 1.0-5-g5300605 via Logic None None -- item.py:__update:363
          2014-11-05 21:34:47,512 DEBUG    env_init     Item env.core.start = 2014-11-05 21:34:47.509250+01:00 via Logic None None -- item.py:__update:363
          2014-11-05 21:34:47,528 DEBUG    env_loc      Item env.location.sunset = 2014-11-06 16:44:11.364474+01:00 via Logic None None -- item.py:__update:363
          2014-11-05 21:34:47,570 DEBUG    env_init     Item env.system.name = smarthome.local via Logic None None -- item.py:__update:363
          2014-11-05 21:34:47,611 DEBUG    env_init     Item env.system.start = 2014-09-21 19:21:41.607748+02:00 via Logic None None -- item.py:__update:363
          2014-11-05 21:34:47,634 DEBUG    env_loc      Item env.location.moonrise = 2014-11-06 16:43:11.299640+01:00 via Logic None None -- item.py:__update:363
          2014-11-05 21:34:47,694 DEBUG    env_loc      Item env.location.moonset = 2014-11-06 06:27:20.346775+01:00 via Logic None None -- item.py:__update:363
          2014-11-05 21:34:47,737 DEBUG    env_loc      Item env.location.moonphase = 4 via Logic None None -- item.py:__update:363
          2014-11-05 21:34:47,794 DEBUG    env_loc      Item env.location.night = True via Logic None None -- item.py:__update:363
          2014-11-05 21:34:47,835 DEBUG    sh.gc        Object references: 9117 -- smarthome.py:_maintenance:490
          2014-11-05 21:34:48,016 DEBUG    Scheduler    env_loc next time: 2014-11-05 22:04:47+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:34:48,038 DEBUG    Scheduler    sh.gc next time: 2014-11-06 02:04:00+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:34:50,051 DEBUG    Main         knx: 1.1.10 set 1/1/30 to 00 -- __init__.py:parse_telegram:181
          2014-11-05 21:34:50,182 DEBUG    Main         knx: 1.1.8 set 1/1/32 to 00 -- __init__.py:parse_telegram:181
          2014-11-05 21:34:52,933 DEBUG    Main         knx: 1.1.8 set 1/1/36 to 01 -- __init__.py:parse_telegram:181
          2014-11-05 21:34:53,129 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:34:53,584 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:35:03+01:00 -- scheduler.py:_next_time:289
          c2014-11-05 21:34:53,959 DEBUG    Main         knx: 1.1.18 set 1/1/39 to 00 -- __init__.py:parse_telegram:181
          2014-11-05 21:34:54,058 DEBUG    Main         knx: 1.1.8 set 1/1/9 to False -- __init__.py:parse_telegram:190
          2014-11-05 21:34:56,171 ERROR    dummy        Logic: dummy, File: /usr/smarthome/logics/dummy_series.py, Line: 2, Method: <module>, Exception: 'SmartHome' object has no attribute 'first' -- scheduler.py:_task:334
          Traceback (most recent call last):
            File "/usr/smarthome/lib/scheduler.py", line 327, in _task
              exec(obj.bytecode)
            File "/usr/smarthome/logics/dummy_series.py", line 2, in <module>
              sh.first.living.temperature(random.randint(20, 23))
          AttributeError: 'SmartHome' object has no attribute 'first'
          2014-11-05 21:34:56,177 DEBUG    env_stat     Item env.core.threads = 7 via Logic None None -- item.py:__update:363
          2014-11-05 21:34:56,197 DEBUG    env_stat     Item env.core.memory = 15859712 via Logic None None -- item.py:__update:363
          2014-11-05 21:34:56,206 DEBUG    env_stat     Item env.system.load = 0.08 via Logic None None -- item.py:__update:363
          2014-11-05 21:34:56,214 DEBUG    env_stat     Item env.location.moonlight = 99 via Logic None None -- item.py:__update:363
          2014-11-05 21:34:56,614 DEBUG    Scheduler    dummy next time: 2014-11-05 21:39:56+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:34:56,620 DEBUG    Scheduler    env_stat next time: 2014-11-05 21:39:56+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:34:56,769 DEBUG    Main         knx: 1.1.4 set 2/5/9 to 0c33 -- __init__.py:parse_telegram:181
          ^[2014-11-05 21:34:58,934 DEBUG    Main         knx: 1.1.8 set 1/1/36 to 00 -- __init__.py:parse_telegram:181
          2014-11-05 21:35:03,201 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:35:03,660 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:35:13+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:35:13,256 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:35:13,713 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:35:23+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:35:16,455 DEBUG    Main         knx: 1.1.6 set 2/5/6 to 0c06 -- __init__.py:parse_telegram:181
          2014-11-05 21:35:23,313 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:35:23,766 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:35:33+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:35:29,479 DEBUG    Main         knx: 1.1.9 set 1/5/9 to 0c10 -- __init__.py:parse_telegram:181
          2014-11-05 21:35:33,361 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:35:33,819 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:35:43+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:35:43,417 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:35:43,871 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:35:53+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:35:45,178 DEBUG    Main         knx: 1.1.5 set 2/5/3 to 0c10 -- __init__.py:parse_telegram:181
          2014-11-05 21:35:53,473 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:35:53,924 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:36:03+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:35:56,760 DEBUG    Main         knx: 1.1.4 set 2/5/9 to 0c38 -- __init__.py:parse_telegram:181
          2014-11-05 21:36:03,518 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:36:03,977 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:36:13+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:36:13,072 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:36:13,528 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:36:23+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:36:16,450 DEBUG    Main         knx: 1.1.6 set 2/5/6 to 0c01 -- __init__.py:parse_telegram:181
          2014-11-05 21:36:23,127 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:36:23,580 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:36:33+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:36:29,476 DEBUG    Main         knx: 1.1.9 set 1/5/9 to 0c10 -- __init__.py:parse_telegram:181
          2014-11-05 21:36:33,187 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:36:33,633 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:36:43+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:36:43,234 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:36:43,685 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:36:53+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:36:45,172 DEBUG    Main         knx: 1.1.5 set 2/5/3 to 0c10 -- __init__.py:parse_telegram:181
          2014-11-05 21:36:53,289 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:36:53,738 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:37:03+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:36:56,748 DEBUG    Main         knx: 1.1.4 set 2/5/9 to 0c38 -- __init__.py:parse_telegram:181
          2014-11-05 21:37:03,338 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:37:03,791 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:37:13+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:37:13,392 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
          2014-11-05 21:37:13,844 DEBUG    Scheduler    hue-update next time: 2014-11-05 21:37:23+01:00 -- scheduler.py:_next_time:289
          2014-11-05 21:37:16,440 DEBUG    Main         knx: 1.1.6 set 2/5/6 to 0c01 -- __init__.py:parse_telegram:181

          Kommentar


            #6
            Zitat von mknx Beitrag anzeigen
            Hi,
            1. Du verwendest HUE für das Plugin und für ein Item == Konflikt
            OK, nach dreimaligem Lesen habe ich es verstanden.
            Ich passe das noch mal an.

            Zitat von mknx Beitrag anzeigen
            Hi,
            2. im CLI gibst Du sh.hue.... an. Woher kommt das Item?
            Das heißt, wenn ich ">>>" sehe ist das im CLI?
            Dann kann ich die Fragezeichen entsorgen.

            Danke

            Kommentar


              #7
              Ich habe es angepasst.

              … jetzt sehe ich im Log die Fehlermeldung:

              Code:
              2014-11-05 21:52:06,089 ERROR    hue-update   Error: unauthorized user (Need to specify correct hue user?) -- __init__.py:_request:146
              Die Autorisierung scheint nicht so zu laufen :-)

              Kommentar


                #8
                Zitat von mknx Beitrag anzeigen
                Hi,
                2. im CLI gibst Du sh.hue.... an. Woher kommt das Item?
                Die Frage versteh ich doch nicht so ganz.
                Ich habe das item in der conf nun umbenannt.
                … aber auch das führt zum Fehler:

                Code:
                >>> sh.huebulbs.authorizeuser()
                Traceback (most recent call last):
                  File "<console>", line 1, in <module>
                AttributeError: 'Item' object has no attribute 'authorize user'

                Kommentar


                  #9
                  Hi,

                  ich kenne das Plugin nicht wirklich und was es genau macht. Vllt. meldet sich ja der Author und kann helfen.

                  Bis bald

                  Marcus

                  Kommentar


                    #10
                    Zitat von sabinellina Beitrag anzeigen


                    1. Step: (Plugin aktivieren, bekannt machen)
                    Folgendes habe ich an die plugin.conf (/usr/smarthome/etc/plugin.conf) angefügt
                    Code:
                    [HUE]
                       class_name = HUE
                       class_path = plugins.hue
                       hue_user = 38f625a739562a8bd261ab9c7f5e62c8
                    Woher kommt der hash wert unter "hue_user = 38f625a739562a8bd261ab9c7f5e62c8"?
                    Ich habe einfacch den aus der plugin Docu genommen, würde aber als Kommentar gern die Quelle angeben.
                    Hi,

                    Die UserID ist beliebig wählbar und dient, wenn authorisiert, als Key für die externe Applikation zur Nutzung der API.

                    Du kannst die ID auch im Debugger der Hue-Bridge "generieren" (d.h. beliebig wählen und registrieren) und dann diese ID in die Config eintragen:

                    Getting started | Philips Hue API
                    Greetings, Torsten

                    Kommentar


                      #11
                      Danke

                      … vielleicht ließt der Author mit …

                      Update:
                      Autorisierung scheint zu laufen
                      (1. Beitrag wird editiert)

                      … mehrfach lesen, scheint heute der Schlüssel.
                      https://knx-user-forum.de/smarthome-...orisieren.html

                      Kommentar


                        #12
                        Hallo,

                        das war Quatsch mit dem CLI.
                        >>> ist der interaktive Modus von Python.

                        Bis bald

                        Marcus

                        Kommentar


                          #13
                          Ansprechen der HUE geht nun.
                          Siehe 7.Step.

                          Wie kann ich denn die Farbe ändern?
                          Der Syntax für das Item leuchtet mir nicht ein.
                          Zitat:
                          "Special: hue_feature = all - controls all settings via dict."
                          "type = dict - controls all features"

                          @ todro:
                          Ich habe deinen hilfreichen Tip mit dem Debugger mal eingebaut.
                          Bist du der Autor des Plugins?

                          Kommentar


                            #14
                            Also laut dem Debugger Tool gibt es zwei Farb-Modi
                            Einmal die Farbe ein "XY"-Feld, für den Regenbogen

                            Code:
                            "state": {
                            		"on": true,
                            		"bri": 50,
                            		"hue": 47124,
                            		"sat": 253,
                            		"xy": [
                            			0.2533,
                            			0.2101
                            		],

                            … und einmal den "CT"-Modus (farbtemperatur, von warm bis kalt)
                            Code:
                                            "ct": 155,
                            		"alert": "none",
                            		"effect": "none",
                            		"colormode": "ct",
                            		"reachable": true

                            Mit dem Debugger, kann ich mit dem folgenden String eine Farbe senden:
                            "rot"
                            Code:
                            "on":true, "sat":255, "bri":255,"hue":10000
                            blau
                            Code:
                            "on":true, "sat":255, "bri":255,"hue":35000
                            Wie kann ich den String in den folgenden Aufruf geben?
                            Code:
                            sh.huebulbs.hue3.effect()
                            Ist das Effect-feature überhaupt das richtige, oder ist "all" besser?

                            Kommentar


                              #15
                              ...immer noch unterwegs, aber mal die Richtung, die ich eingeschlagen habe:
                              Ich nutze nur einen Weg die Hue zu steuern, und zwar das "all" mit der Übergabe des vollständigen Dictionary. Man muß sich dann noch überlegen, wie man die einzelnen Item in das Dict übersetzt. Da kann ich dann ein paar Beispiel am Wochenende liefern.

                              Was noch eine Aufgabe bei mir ist: Manche Hue trenne ich vom Netz (weil die halt an einem geschaltetem Ausgang hängen). Damit muss ich erst die Hue anmachen, bevor ich Sie steuern kann. Dazu muß ich mir erst noch die Logik schreiben oder das Plugin anpassen (präferierte Lösung), die als weiteren Parameter das Schaltobjekt mit überträgt.

                              Michel

                              Kommentar

                              Lädt...
                              X