andyboeh / mediola2mqtt

Mediola MQTT Gateway
11 stars 13 forks source link

Unable to control type ER blinds from Elero #8

Closed SKis274 closed 2 years ago

SKis274 commented 2 years ago

Hi there,

I got some elero blinds and a elero gateway, probably a v6. I'm able to control the blinds with an integer-like address like 10, 11 and so else. Here an log example for the blind with address 13.

Received PUBLISH (d0, q0, r0, m0), 'mediola/blinds/mediola/ER_13/set', ... (5 bytes) Msg: mediola/blinds/mediola/ER_13/set 0 b'close' Received PUBLISH (d0, q0, r0, m0), 'mediola/blinds/mediola/ER_13/set', ... (4 bytes) Msg: mediola/blinds/mediola/ER_13/set 0 b'stop' Received PUBLISH (d0, q0, r0, m0), 'mediola/blinds/mediola/ER_13/set', ... (4 bytes) Msg: mediola/blinds/mediola/ER_13/set 0 b'open'

Some other blinds got addresses with characters like 0E in the example below.

Received PUBLISH (d0, q0, r0, m0), 'mediola/blinds/mediola/ER_0E/set', ... (5 bytes) Msg: mediola/blinds/mediola/ER_0E/set 0 b'close' Caught exception in on_message: invalid literal for int() with base 10: '0E' Exception in thread Thread-1: Traceback (most recent call last): File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner self.run() File "/usr/lib/python3.9/threading.py", line 892, in run self._target(*self._args, **self._kwargs) File "/usr/lib/python3.9/site-packages/paho/mqtt/client.py", line 3591, in _thread_main self.loop_forever(retry_first_connection=True) File "/usr/lib/python3.9/site-packages/paho/mqtt/client.py", line 1756, in loop_forever rc = self._loop(timeout) File "/usr/lib/python3.9/site-packages/paho/mqtt/client.py", line 1164, in _loop rc = self.loop_read() File "/usr/lib/python3.9/site-packages/paho/mqtt/client.py", line 1556, in loop_read rc = self._packet_read() File "/usr/lib/python3.9/site-packages/paho/mqtt/client.py", line 2439, in _packet_read rc = self._packet_handle() File "/usr/lib/python3.9/site-packages/paho/mqtt/client.py", line 3033, in _packet_handle return self._handle_publish() File "/usr/lib/python3.9/site-packages/paho/mqtt/client.py", line 3327, in _handle_publish self._handle_on_message(message) File "/usr/lib/python3.9/site-packages/paho/mqtt/client.py", line 3570, in _handle_on_message on_message(self, self._userdata, message) File "//./mediola2mqtt.py", line 77, in on_message data = format(int(adr), "02x") + "00" ValueError: invalid literal for int() with base 10: '0E'

After that error I can't control any blinds till I restart the whole addon. Is there a way to fix this? Can I support you by collecting additional information?

Best regards and thank you

andyboeh commented 2 years ago

Hm, I thought I had finally fixed this integer <-> hex conversion thingie. I'll look into it.

andyboeh commented 2 years ago

OK, it's not a bug but a lack of documentation: You need to define all your Elero blinds in decimal notation in the configuration file, not in hex. So 0E becomes 14. mediola2mqtt takes care of the conversion to hex!

SKis274 commented 2 years ago

Hey, thank you for your fast reply! Awesome support :) It was just an odd coincidence that some hex values match with a decimal one.

After using the decimal notation I'm able to control all elero blinds. Great! I change the topic because it has nothing to do with strings.

ThoSig commented 2 years ago

So actually that did not work for me properly on my v6, so i updated the script a bit so it can accept hex values as well. If needed, i can provide those changes in some way or another. However, i did not find out why the conversion did not work properly..