Miele-MQTT => Loxberry MQTT

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

  • Christian Fenzl
    antwortet
    Kurz überlegen…

    - cron.d/mielemqtt hab ich aufgeräumt und definiert mit
    @reboot loxberry sleep 30 && php /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php
    (hier war bei Jürgen Ticos Job mit minütlichem Start drin)

    - Außerdem chmod 644 cron.d/mielemqtt
    (das war bei Jürgen 755, was definitiv so nicht geht)

    - Sicherheitshalber dos2unix Miele-MQTT.php
    (hab ich nicht geprüft, hat aber imho vorher schon gepasst)

    Natürlich dann einen Reboot ausgeführt, damit der Cron mit @reboot ausgeführt wird.

    Beim Reboot startet das MQTT Gateway nicht sofort, also im Settings-Tab beobachtet, dass es nach Reboot wirklich running ist.
    Dann die Incoming Overview beobachtet.

    miele-MQTT.php pollt alle 30 Sekunden, dabei werden rechts auch die Timestamps aktualisiert.
    Zuletzt geändert von Christian Fenzl; 24.06.2021, 21:29.

    Einen Kommentar schreiben:


  • svethi
    antwortet
    Christian Fenzl kannst Du denn sagen woran es lag?

    Einen Kommentar schreiben:


  • JürgenW
    antwortet
    Christian, vielen vielen Dank dass du mir so schnell und unkompliziert helfen konntest. Ich habe keine Ahnung, wie du das gemacht hast, aber es läuft jetzt. Mein Abend ist gerettet. Echt toller Support.
    LG
    Jürgen

    Einen Kommentar schreiben:


  • JürgenW
    kommentierte 's Antwort
    Ich habe mit Tico Hilfe alles überprüft und konnte den regelmäßigen Aufruf nicht realisieren. MQTT empfängt Daten, wenn ich PuTTY offen habe und von dort das Script anstosse. In cron habe ich versucht alles wie beschrieben einzustellen.

    Svethi, Chistian,
    habt Ihr noch eine Idee? Könnte sich jemand aufschalten oder was könnte ich wie loggen?

  • JürgenW
    kommentierte 's Antwort
    Thanks for your help but again it doesn't work. I try to get Christian on this topic it looks cron is not activiating this script

  • Tico
    kommentierte 's Antwort
    The only thing I can think of is to change the permissions of mielemqtt to 0644. I had 0644 written down in one installation how-to, but 0755 in another. If that doesn't work, I afraid I'm out of ideas.
    Zuletzt geändert von Tico; 24.06.2021, 12:39.

  • JürgenW
    kommentierte 's Antwort
    Thanks again.
    I really followed all your instructions (3 times). Everything looks right if I open "php miele-MQTT.php" with PuTTY and let PuTTY active -> I recive every 30 second data from my Miele devices in MQTT. If I close putty immidetly transfer stops.

    I have created the cron job file (mielemqtt) and installed it in cron.d and adusted all user permissions (755, root:root, ...) like you stated.
    Notepad++ is configured correctly.

    Result: Still automatic refresh of MQTT not working.

    I have now really no idea anymore and this is really frustrating me.
    Jürgen

  • Tico
    antwortet
    When creating mielemqtt, you need to ensure the End of Line is encoded properly. In Notepad++, go to Edit / EOL Conversion, and ensure Unix (LF) is selected. In the bottom-right of the Notepad++ screen you should see Unix (LF) and UTF-8.

    The cronjob (mielemqtt) will need to have ownership root:root. That file should be in /opt/loxberry/system/cron/cron.d/

    The script (miele-MQTT.php) will need to have ownership loxberry:loxberry. That file should be in /opt/loxberry/webfrontend/legacy/miele/

    Permissions should be 755 for both.

    Einen Kommentar schreiben:


  • JürgenW
    kommentierte 's Antwort
    Sorry, I found all controls to change permissions.

    Still not working (after reboot of Loxberry)
    - I created mielemqtt with Notepad ++ (how described)
    - I changed to root:root and permissions of both scripts to 755

    I have no more idea to get it run.

  • JürgenW
    antwortet
    Hi Tico
    I followed your instruction and loged in as root. Script is always as owner loxberry:loxberry instead of root:root. How I can change?
    Klicke auf die Grafik für eine vergrößerte Ansicht

Name: 2021-06-22 (1).png
Ansichten: 456
Größe: 76,9 KB
ID: 309424

    Einen Kommentar schreiben:


  • Tico
    antwortet
    Ich habe einige Zeit mit dem Miele-Skript durchgehalten, aber Miele hat den Authentifizierungsprozess immer wieder geändert. Der Entwickler (Oklona) würde schließlich aufholen, aber es schien sehr temperamentvoll.

    Ich wechselte zu einem Node-Red-Flow, der seither stabil ist. Dieser fließt zu Loxberry MQTT und schreibt direkt in einen Loxone Virtual Input. Es werden also keine Polling-Ressourcen benötigt.

    Ich frage mich, ob jemand Miele-Geräte mit WLAN nutzt und auch Erfahrung als Entwickler hat? Ich habe die folgende Github-Ressource namens Miele-MQTT gefunden: "Ein sehr einfaches Skript, um Daten aus den Cloud-Diensten von Miele@home zu lesen und mit Mosquitto MQTT zu veröffentlichen". https://github.com/oklona/M




    Miele hat die API ausgereift, so dass die verbesserte Stabilität vielleicht nur ein Zufall war.

    Einen Kommentar schreiben:


  • JürgenW
    kommentierte 's Antwort
    ´Thank you. I will try to implement. May I ask why you are not using anymore Miele script? What solutions you are using now?

  • Tico
    antwortet
    Ich verwende das Miele-Skript nicht mehr, habe aber noch einige Installationshinweise.
    Erstellen Sie die folgende Datei und nennen Sie sie mielemqtt (die Datei hat keine Dateinamenerweiterung).

    Code:
    # Edit this file to introduce tasks to be run by cron.
    #
    # Each task to run has to be defined through a single line
    # indicating with different fields when the task will be run
    # and what command to run for the task
    #
    # To define the time you can provide concrete values for
    # minute (m), hour (h), day of month (dom), month (mon),
    # and day of week (dow) or use '*' in these fields (for 'any').#
    # Notice that tasks will be started based on the cron's system
    # daemon's notion of time and timezones.
    #
    # Output of the crontab jobs (including errors) is sent through
    # email to the user the crontab file belongs to (unless redirected).
    #
    # For example, you can run a backup of all your user accounts
    # at 5 a.m every week with:
    # 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/
    #
    # For more information see the manual pages of crontab(5) and cron(8)
    #
    # m h dom mon dow command
    * * * * * loxberry /usr/bin/php /opt/loxberry/webfrontend/legacy/miele/miele-MQTT.php >/dev/null 2>&1
    Kopieren Sie sowohl diese Datei als auch miele-MQTT.php in -
    /opt/loxberry/webfrontend/legacy/miele/

    Verschieben Sie dann (als root su -) mielemqtt nach /opt/loxberry/system/cron/cron.d/

    Sie müssen die Datei miele-MQTT.php manuell ausführen, um die Datei miele-config.php zu erstellen.

    Einen Kommentar schreiben:


  • svethi
    kommentierte 's Antwort
    Hab mir fast schon gedacht, dass das einfach nur zyklisch per Cron aufgerufen wird. Hattest Du nicht letztens irgendein Problem mit dem cron.d festgestellt? Vielleicht wird einfach das script nicht ausgeführt.

  • JürgenW
    kommentierte 's Antwort
    Christian, reichen dir die Informationen um mir weiterhelfen zu können?
    Könnte mein Problem im Bereich "Cron job" liegen? Habe einiges im Forum darüber gelesen, werde aber am Ende nicht ganz schlau draus. Am meisten hat mir der Beitrag #35 gesagt.
    Wenn ich noch ein weiteres Script/Datei installieren muss, dann wäre es nett, wenn du mir das senden könntest und eine Anleitung mitgibst, wie ich das über PuTTY einrichte und aktiviere (sorry, bin Anfänger in dem Bereich).
    Danke
    Zuletzt geändert von JürgenW; 22.06.2021, 05:42.
Lädt...