Mediola2mqtt: Simple Mediola to MQTT bridge with HA support

Thank you very much. I can´t find any Mediola V4 to buy and V6 is really expensive. V5 is about € 69,- and would be great.
Do you know whether V5 would also work? I haven´t found any information about V5.

I bought my v4+ (used) for about €15,- in Germany on an online market place. AFAIK, they are not sold anymore.

I have not received any feedback on v5 gateways.

How to use standalone without HASS? I copied your files onto ubuntu server and configured mediola2mqtt.yaml. Where do I get adr:?? and how should I start the script or is there something to install additionally?

Read section Usage in the README. There is an additional systemd init script provided, or you can just run the python script directly.

I have the same issue with my awening and am going to try this (maybe it helps):
Device (Bridge):
Sonoff - RF Bridge 433MHz - WLAN / 433MHz, 14,90 € (besmart24.de)

Teaching / learning:
Sonoff 433 RF Bridge User Guide – eWelink (coolkit.cc)

Using:
RFLink - Home Assistant (home-assistant.io)

Hi, I have troubles with setting it up.

I have exported it to /opt/mediola2mqtt on my Raspberr Pi where I am already running zigbee2mqtt.

Then I have copied the .yaml.example to .yaml and changed the settings accordingly.

But then it doesnt allow me to run
systemctl enable mediola2mqtt.service

I am getting the error:

Failed to enable unit: Unit file mediola2mqtt.service does not exist.

you need to copy this service file to /etc/systemd/system and then reload systemd (systemctl daemon-reload).

Make sure that the path to mediola2mqtt.py is correct and that the user and the group the script should run as exist on your system.

Stupid me…

Many thanks!

I am one step ahead. When I start the service I am getting in syslogs:

Mar  6 17:23:13 Weewx systemd[9217]: mediola2mqtt.service: Failed to determine user credentials: No such process
Mar  6 17:23:13 Weewx systemd[9217]: mediola2mqtt.service: Failed at step USER spawning /opt/mediola2mqtt/mediola2mqtt.py: No such process
Mar  6 17:23:13 Weewx systemd[1]: mediola2mqtt.service: Main process exited, code=exited, status=217/USER
Mar  6 17:23:13 Weewx systemd[1]: mediola2mqtt.service: Failed with result 'exit-code'.

I kept the default pass on the Gateway “admin” and I have set it in the config file.

ok, my issue was the wrong user “in” the services file.

Looks like a systemd problem - did you add the user account mediola2mqtt to your pi or change it in the service file as mentioned before?

Yes, I interpreted your statement with the user “wrongly” and was thinking about the ownership of the files/directories.

Now I am getting this error:

Mar  6 17:42:35 Weewx mediola2mqtt.py[10603]:   File "/opt/mediola2mqtt/mediola2mqtt.py", line 2
Mar  6 17:42:35 Weewx mediola2mqtt.py[10603]: SyntaxError: Non-ASCII character '\xc3' in file /opt/mediola2mqtt/mediola2mqtt.py on line 2, but no encoding declared; see http://python.org/dev/peps/pep-0263/ for details
Mar  6 17:42:35 Weewx systemd[1]: mediola2mqtt.service: Main process exited, code=exited, status=1/FAILURE

my yaml looks the following:

mediola:
  - host: 192.168.1.x
    password: mediola-user-pass
    id: mediola

mqtt:
  host: 192.168.1.x
  port: 1883
  username: mqtt-user
  password: mqtt-pass
  discovery_prefix: homeassistant
  topic: mediola2mqtt
  debug: false

blinds:
  - type: ER
    adr: "03"
    name: Wohnzimmer Süd
    mediola: mediola

Does your pi default to python 2 or python 3?

Run mediola2mqtt once manually and try python and python3. Then prefix the command in the service file with the correct command.

If that doesn’t work, I can declare the encoding in the python script.

I checked and default is python 2.

So I started with “python3 /opt/mediola2mqtt/mediola2mqtt.py”

Now I am getting:

Mar  6 18:37:08 Weewx python3[14045]: Traceback (most recent call last):
Mar  6 18:37:08 Weewx python3[14045]:   File "/opt/mediola2mqtt/mediola2mqtt.py", line 9, in <module>
Mar  6 18:37:08 Weewx python3[14045]:     import yaml

Then you’re missing the yaml module for python. You can install it via apt.

got it.

making progress.

Mar  6 19:48:01 Weewx systemd[1]: Started mediola2mqtt.
Mar  6 19:48:01 Weewx python3[18074]: Running in local mode
Mar  6 19:48:01 Weewx python3[18074]: Debugging messages enabled
Mar  6 19:48:01 Weewx python3[18074]: Sending CONNECT (u1, p1, wr0, wq0, wf0, c1, k60) client_id=b''
Mar  6 19:48:01 Weewx python3[18074]: Received CONNACK (0, 0)
Mar  6 19:48:01 Weewx python3[18074]: Caught exception in on_connect: can only concatenate str (not "int") to str
Mar  6 19:49:01 Weewx python3[18074]: Sending PINGREQ
Mar  6 19:49:01 Weewx python3[18074]: Received PINGRESP
Mar  6 19:50:01 Weewx python3[18074]: Sending PINGREQ
Mar  6 19:50:01 Weewx python3[18074]: Received PINGRESP

Its working now, great.

Many thanks for your support!!!

1 Like

I archived this project and stopped working on it as I could finally move to another solution (based on ESP32+CC1101). Actually, I’m really happy to retire my Mediola Gateway.

I know this project is archived but I’m experiencing some issues with my Home Assistant Green (Trying to add a mediola2mqtt add-on fails) and I was wondering if someone had any pointers.

When I have set a password for my Mediola V6 Gateway (to use the Cloud Access) it is not possible to control my blinds in HA anymore. Even when I set the password in in the “Mediola to MQTT” configuration. Has somebody a hint for me?