gibts ein Kodi addon zum Schalten von Smart lIfe Steckdosen ?

  • Kein Problem. Das läuft nicht weg ;)

    AZi (DEV): Nexus auf LibreElec | Asrock J4205 | 4 GB RAM | 128 GB Sandisk| Rii mini
    DEV: PC Ubuntu 20.04 | Matrix
    AZi: Tanix TX3 | Android/CoreElec Dualboot (EMMC), Nexus
    WoZi: Nexus auf LibreElec | Asrock J4205 | 4GB RAM | 128 GB Sandisk SSD | Atric IR | URC7960
    NAS: unRaid, 3x6TB, 2x12TB | TV-Server: Futro S550 mit Hauppauge QuadHD DVB-C
    PayPal: paypal.me/pvdbj1

  • autoexec.py

    import sys
    import time
    sys.path.append('/storage/emulated/0/Android/data/http://net.kodinerds.maven.kodi/files/.kodi/ad…f/resources/lib')
    import os
    print(os.getcwd())

    [definition='1','0']log[/definition] eintrag:
    2022-03-29 18:55:28.737 T:8939 INFO <general>: CPythonInvoker(16, /storage/emulated/0/Android/data/http://net.kodinerds.maven.kodi/files/.kodi/ad…xec/autoexec.py): script successfully run

  • autoexec.py:

    import sys
    import time
    sys.path.append('/storage/emulated/0/Android/data/http://net.kodinerds.maven.kodi/files/.kodi/ad…f/resources/lib')
    from sonoff import *
    print(Sonoff().send('192.168.2.180', Sonoff().OFF[0]))
    time.sleep(5)
    print(Sonoff().send('192.168.2.180', Sonoff().ON[0]))

    log-file:

    2022-03-29 19:08:35.267 T:11466 ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
    - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
    Error Type: <class 'ModuleNotFoundError'>
    Error Contents: No module named 'requests'
    Traceback (most recent call last):
    File "/storage/emulated/0/Android/data/http://net.kodinerds.maven.kodi/files/.kodi/ad…xec/autoexec.py", line 4, in <module>
    from sonoff import *
    File "/storage/emulated/0/Android/data/http://net.kodinerds.maven.kodi/files/.kodi/ad…s/lib/sonoff.py", line 4, in <module>
    import requests
    ModuleNotFoundError: No module named 'requests'
    -->End of Python script error report<--

  • Das kann nicht sein, es sollte der Pfad ausgegeben werden, nicht die ausgeführte Datei. Bei /storage/emulated/0/Android/data/net.kodinerds.maven.kodi/files/.kodi/addons/service.autoexec/ wäre ich zufrieden gewesen. Mal Kodi neu gestartet? Ein weiterer Weg wäre auch, in den Einstellungen -> Addons -> Benutzeraddons -> Dienste -> Autoexec Service den Dienst zu deaktivieren und anschliessend wieder zu aktivieren.

    Kann man dem o.g. Pfad glauben, sollte das so in der autoexec.py aussehen:

    sys.path.append('/storage/emulated/0/Android/data/net.kodinerds.maven.kodi/files/.kodi/addons/script.homematic.sonoff/resources/lib')

    AZi (DEV): Nexus auf LibreElec | Asrock J4205 | 4 GB RAM | 128 GB Sandisk| Rii mini
    DEV: PC Ubuntu 20.04 | Matrix
    AZi: Tanix TX3 | Android/CoreElec Dualboot (EMMC), Nexus
    WoZi: Nexus auf LibreElec | Asrock J4205 | 4GB RAM | 128 GB Sandisk SSD | Atric IR | URC7960
    NAS: unRaid, 3x6TB, 2x12TB | TV-Server: Futro S550 mit Hauppauge QuadHD DVB-C
    PayPal: paypal.me/pvdbj1

  • ich hab noch mal neu gestartet, cache geleert.

    Inhalt der autoexec.py ist:

    Python: autoexec.py
    import sys
    import time
    sys.path.append('/storage/emulated/0/Android/data/net.kodinerds.maven.kodi/files/.kodi/addons/script.homematic.sonoff/resources/lib')
    from sonoff import *
    print(Sonoff().send('192.168.2.180', Sonoff().OFF[0]))
    time.sleep(5)
    print(Sonoff().send('192.168.2.180', Sonoff().ON[0]))

    Ausgabe im [definition=9,3]Kodi.[definition='1','0']log[/definition][/definition]:


    hmm. kein Plan, was da schief läuft.

    das ist hier ja ein build von maven.
    ich probier mal mit kodi original.

  • Na wenigstens wird das Sonoff-Modul geladen. Die Pfade stimmen also. Seltsam ist nur, dass das Modul requests nicht geladen werden kann, obwohl das Addon (Tasmota Switcher) offensichtlich kein Problem damit hat....

    Probiere mal, nach dem import time noch ein import requests in der autoexec.py einzufügen.

    EDIT: Und in der addon.xml noch folgendes im <requires> ... </requires> Abschnitt einfügen:

    <import addon="script.module.requests" version="2.22.0+matrix" />

    AZi (DEV): Nexus auf LibreElec | Asrock J4205 | 4 GB RAM | 128 GB Sandisk| Rii mini
    DEV: PC Ubuntu 20.04 | Matrix
    AZi: Tanix TX3 | Android/CoreElec Dualboot (EMMC), Nexus
    WoZi: Nexus auf LibreElec | Asrock J4205 | 4GB RAM | 128 GB Sandisk SSD | Atric IR | URC7960
    NAS: unRaid, 3x6TB, 2x12TB | TV-Server: Futro S550 mit Hauppauge QuadHD DVB-C
    PayPal: paypal.me/pvdbj1

    Einmal editiert, zuletzt von PvD (29. März 2022 um 20:19)

  • habe ich getan.

    import requests wird angemeckert

    [definition='1','0']log[/definition]:
    2022-03-29 20:15:58.433 T:22956 ERROR <general>: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
      - NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
      Error Type: <class 'ModuleNotFoundError'>
      Error Contents: No module named 'requests'
      Traceback (most recent call last):
      File "/storage/emulated/0/Android/data/net.kodinerds.maven.kodi/files/.kodi/addons/service.autoexec/autoexec.py", line 3, in <module>
      import requests
      ModuleNotFoundError: No module named 'requests'
      -->End of Python script error report<--

  • Habe ein EDIT im Post davor gemacht. Da ist noch eine Änderung in der addon.xml erforderlich.

    AZi (DEV): Nexus auf LibreElec | Asrock J4205 | 4 GB RAM | 128 GB Sandisk| Rii mini
    DEV: PC Ubuntu 20.04 | Matrix
    AZi: Tanix TX3 | Android/CoreElec Dualboot (EMMC), Nexus
    WoZi: Nexus auf LibreElec | Asrock J4205 | 4GB RAM | 128 GB Sandisk SSD | Atric IR | URC7960
    NAS: unRaid, 3x6TB, 2x12TB | TV-Server: Futro S550 mit Hauppauge QuadHD DVB-C
    PayPal: paypal.me/pvdbj1

  • das wars!

    2022-03-29 20:31:16.091 T:27000 INFO <general>: CPythonInvoker(16, /storage/emulated/0/Android/data/http://net.kodinerds.maven.kodi/files/.kodi/ad…xec/autoexec.py): script successfully run

    [bp]

    Ehrlich, Scripten und Programmieren wird für mich immer der Schwachpunkt sein.
    Da bin ich talentfrei.

    Herzlichen Dank für diesen support!

    Hab mal den Paypal link für ein Kaltgetränk benutzt [az]

  • [az]

    @DaVu: Könntest Du bitte in Deinem Post #6 noch den Hinweis einfügen, dass je nach Funktionalität eventuell noch erforderliche Module in den <requires> ... </requires> Abschnitt notiert werden müssen.

    @bylderup: Haste doch fein gemacht! [ay]

    AZi (DEV): Nexus auf LibreElec | Asrock J4205 | 4 GB RAM | 128 GB Sandisk| Rii mini
    DEV: PC Ubuntu 20.04 | Matrix
    AZi: Tanix TX3 | Android/CoreElec Dualboot (EMMC), Nexus
    WoZi: Nexus auf LibreElec | Asrock J4205 | 4GB RAM | 128 GB Sandisk SSD | Atric IR | URC7960
    NAS: unRaid, 3x6TB, 2x12TB | TV-Server: Futro S550 mit Hauppauge QuadHD DVB-C
    PayPal: paypal.me/pvdbj1

  • @bylderup: Merci! Besten Dank!

    AZi (DEV): Nexus auf LibreElec | Asrock J4205 | 4 GB RAM | 128 GB Sandisk| Rii mini
    DEV: PC Ubuntu 20.04 | Matrix
    AZi: Tanix TX3 | Android/CoreElec Dualboot (EMMC), Nexus
    WoZi: Nexus auf LibreElec | Asrock J4205 | 4GB RAM | 128 GB Sandisk SSD | Atric IR | URC7960
    NAS: unRaid, 3x6TB, 2x12TB | TV-Server: Futro S550 mit Hauppauge QuadHD DVB-C
    PayPal: paypal.me/pvdbj1

  • Hallo

    Ich habe auch einen Shelly Plug S bestellt und will auch zu Tasmota flashen.

    Ist es richtig im WIF des Shelly diese Zeile reinzukopieren?

    Code
    http://192.168.1.165/ota?url=http://ota.tasmota.com/tasmota/shelly/mg2tasmota-ShellyPlugS.zip

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!