Mediola2mqtt: Simple Mediola to MQTT bridge with HA support

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?

Hey @andyboeh I recently purchased the Mediola Gateway on the cheap on eBay, waiting for the delivery now. But I’d love to know more what was your alternative solution that you went with?

I changed quite a bit since the initial setup of my Mediola:

  • Elero blinds are now controlled using esphome-elero
  • Somfy blinds are now controlled using ESPSomfy-RTS
  • The single Intertechno switch that I had has been replaced by a Homematic switch as I moved the thermostats from MAX! to Homematic anyway

Sounds interesting, what hardware did you use for the 868 Mhz solution?

ESP32 (WT32-ETH01 as I have it connected via Ethernet) and TI CC1101 RF module (“rescued” from an old smart home central that is no longer supported by the manufacturer).

Thanks! I was looking for something to control my Elero blinds. Also, in the meantime I found your website :slight_smile: The part with copying the values from the pilot looks slightly challenging :slight_smile:
Also, I noted that tilting is done by sending just one command? Yet you can tilt the blinds two way?

I do not have any blinds that support tilt, so this was implemented with a user. There is one issue open at github that deals with thtat: Example config.yaml · Issue #1 · andyboeh/esphome-elero · GitHub

It really isn’t. You just look at the log and figure out the values.

I finally got my hands on the eBay Mediola gateway. Unfortunately it doesn’t work properly (I’m unable to add any of my Elero devices for weird reason “unable to enter pairing mode”) so I’m ditching the idea.
Started looking into your solution with ESP/CC1101. I read that you caniballised the chip from another device. Do you think that the cheap CC1101 modules from AliExpress will work? Or is it a waste of time?

Which Gateway version did you get?
I once bought a used gateway v4 where no Elero ID was set. You can check by running the following command in your browser:

http://mediola.lan/command?XC_FNC=GetSI

This returns a lot of status codes, check if there is a value set for “EID”. If not, you can manually set one - I forgot where I learned that from but it wasn’t easy to find:

http://mediola.lan/command?XC_FNC=rfchipcmd&type=setERAdr&adr=aabbcc

aabbcc is your Elero ID in hex. You can pick any number, they should not collide with your blinds.

That said: Sure, any CC1101 module will work if it isn’t broken. You might have to experiment and/or measure the correct frequency settings (they are configurable). You can use a cheap RTL433-based SDR for that. I’ve used these modules in the past for various Homematic projects (but they needed frequency calibration).

The gateway is a v5, so not officially supported by your solution :slight_smile: But I’ll give it a try, thanks!
I’m ordering a CC1101 from Ali anyway, we’ll see what it can do.

Nope, that didn’t work :confused: the EID was set, I changed it to my my own string, but that didn’t work either. Here’s the full dump from the first command you mentioned above:

{XC_SUC}{“HWV”:“E1”,“HWRV”:“01”,“FWV”:“1.0.31”,“BUILD”:“0007”,“TZ”:“21”,“TIME”:“20:13:53 18.3.2024”,“LONG”:“00D2”,“LAT”:“020A”,“RFM”:“1601”,“RFCAL”:“170C”,“PIN”:“XXXX”,“EID”:“031337”,“RGB”:“03”,“DC”:“0000/88B8”,“ststart”:“20:05:25 18.3.2024”,“HM”:{“ADR”:“343939”,“KEY”:“FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF”}}

Hello, can someone help me with the installation? I have HomeAssistant in a VM on a Windows PC. So I tried to run mediola2mqtt directly on the windows pc. But when I start it with the CMD I got the following error:

Running in local mode
Exception ignored in: <function Client.__del__ at 0x000001F36E1656C0>
Traceback (most recent call last):
  File "C:\Python312\Lib\site-packages\paho\mqtt\client.py", line 874, in __del__
    self._reset_sockets()
  File "C:\Python312\Lib\site-packages\paho\mqtt\client.py", line 1133, in _reset_sockets
    self._sock_close()
  File "C:\Python312\Lib\site-packages\paho\mqtt\client.py", line 1119, in _sock_close
    if not self._sock:
           ^^^^^^^^^^
AttributeError: 'Client' object has no attribute '_sock'
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\mediola2mqtt\mediola2mqtt.py", line 309, in <module>
    mqttc = mqtt.Client()
            ^^^^^^^^^^^^^
TypeError: Client.__init__() missing 1 required positional argument: 'callback_api_version'

  1. Windows is completely untested, you are on your own.
  2. Paho-MQTT 2.0.0 seems to have introduced a backwards-incompatible API change. Use one of the 1.x.x releases or fix the error message - read client module — Eclipse paho-mqtt documentation

Hi Andyboeh, thanks for the quick reply. It works with Paho-MQTT 1.6.1.

1 Like