MQTT Support

MQTT support would be very great.

you would have all readings centrally under FHEM in view and could switch further events with status "finisch". e.g. switch off a Sonow POW (tasmato) and thus switch off the printer.

Comments

  • MQTT is on list for future interface options. But first other more important features will come.
  • What is the current status of MQTT support?
    Viele Grüße
    Florian
  • Won't start this year due to lower priority over other functions.
  • If would like to get only information  from reptierserver you can use this software. Docker is also supported.


  • Lukas1818 said:
    If would like to get only information  from reptierserver you can use this software. Docker is also supported.
    That is awesome, I tried it but it won't work on my raspberry pi´s. Both stop at the same spot. Running it with python 3.7 and paho-mqtt installed.

    Every time I try to run the script it results in:

      File "repeqtt.py", line 94, in <module>

        queryRepetier()

      File "repeqtt.py", line 67, in queryRepetier

        serverKey = srvdata['apikey']

    KeyError: 'apikey'


    I already tried to use add another user with all rights and easy non special characters password.
    API should be working, since I use it in ioBroker already, that reads the data.

    I did not find any information how to maybe enable "REST API" if that is a different thing.
    Any ideas?

    Or maybe any idea how I could change the script to not query the API via User + PW but instead directly using the according API Key?
  • I have a running Home automation with OpenHab and using mosquitto to communicate between the Raspberrys and devices, i.e. to get energy consumption from smart sockets.

    So I only want to send an "event" from the Repetier-Server (when print starts) via extcommands.xml to my existing mqqt broker, what package(s) have I to install?

    Any hints? Thx!
  • Hello,
    i`m saerching also an solution for this.

    I use an raspberry pi running repetier server and another one running openhab2 with mosquitto installed.
    Can anyone describe how to run this python-script on which of the both raspberries?

    Or ist ther another way using the API to get state of printers?

    Regards

    Jürgen
  • edited October 2021
    @LordMM
    I running the script using docker. So I not addicted to the available packages of the os.
    my `doker-compose.yml`:
    ```yaml
    version: '3'
    services:
      repeqtt:
        build: .
        volumes:
          - './repeqtt.conf:/repeqtt.conf:ro'
        user: 1000:1000
        restart: unless-stopped
    ```

    my `repeqtt.conf` (you need to set the missing values):
    ```
    [repeqtt]
    name=repeqtt

    [server]
    address =
    port = 80
    user =
    secret =

    [broker]
    address =
    port = 1833
    user =
    secret =
    root_topic =
    update_interval = 30
    ```

    Because I do not build an docker image at the ci in the moment, you must build it by yourself.
    install docker (if is not intalled),
    create your `docker-compose.yml`,
    create your `repeqtt.conf`
    clone the git repo
    run `sudo docker-compose up -d`

    you can show logs with `sudo docker-compose logs -f` now

    of course you can also try to run it without docker.
    At this case you must install python and `run pip install paho-mqtt` after cloning the repo. (I did never try this)
  • edited October 2021
    I have not use the software for a long time, because I have start using webactions instead. I have check it today again but it seems to not work anymore, may a breaking change at python. Sadly I personal have no interest in dealing with this python issues.

    How you can see at the git history, I have not write it by myself, I only have adjust it to my needs.
    May I will write a completely new software one day.

    At the current state the software fail at the import of paho.mqtt library.

    ```
    repeqtt_1  | Traceback (most recent call last):
    repeqtt_1  |   File "//repeqtt.py", line 20, in <module>
    repeqtt_1  |     import paho.mqtt.publish as publish
    repeqtt_1  |   File "/usr/local/lib/python3.10/site-packages/paho/mqtt/publish.py", line 31, in <module>
    repeqtt_1  |     from . import client as paho
    repeqtt_1  |   File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 18, in <module>
    repeqtt_1  |     import logging
    repeqtt_1  |   File "/usr/local/lib/python3.10/logging/__init__.py", line 57, in <module>
    repeqtt_1  |     _startTime = time.time()
    repeqtt_1  | PermissionError: [Errno 1] Operation not permitted
    repeqtt_1  | Traceback (most recent call last):
    repeqtt_1  |   File "//repeqtt.py", line 20, in <module>
    repeqtt_1  |     import paho.mqtt.publish as publish
    repeqtt_1  |   File "/usr/local/lib/python3.10/site-packages/paho/mqtt/publish.py", line 31, in <module>
    repeqtt_1  |     from . import client as paho
    repeqtt_1  |   File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 18, in <module>
    repeqtt_1  |     import logging
    repeqtt_1  |   File "/usr/local/lib/python3.10/logging/__init__.py", line 57, in <module>
    repeqtt_1  |     _startTime = time.time()
    repeqtt_1  | PermissionError: [Errno 1] Operation not permitted
    repeqtt_1  | Traceback (most recent call last):
    repeqtt_1  |   File "//repeqtt.py", line 20, in <module>
    repeqtt_1  |     import paho.mqtt.publish as publish
    repeqtt_1  |   File "/usr/local/lib/python3.10/site-packages/paho/mqtt/publish.py", line 31, in <module>
    repeqtt_1  |     from . import client as paho
    repeqtt_1  |   File "/usr/local/lib/python3.10/site-packages/paho/mqtt/client.py", line 18, in <module>
    repeqtt_1  |     import logging
    repeqtt_1  |   File "/usr/local/lib/python3.10/logging/__init__.py", line 57, in <module>
    repeqtt_1  |     _startTime = time.time()
    repeqtt_1  | PermissionError: [Errno 1] Operation not permitted
    mqttrepetierserver_repeqtt_1 exited with code 1
    ```

Sign In or Register to comment.