andyboeh / mediola2mqtt

Mediola MQTT Gateway
11 stars 13 forks source link

Not getting many debug messages #10

Closed MirandaPoth closed 2 years ago

MirandaPoth commented 2 years ago

I've just installed this addon and it starts fine. I have Internorm blinds on my Mediola v5+ gateway and they're not responding, so I want to debug so that I can see what's happening. However with debug: true all I get is this (this is the entire log just after it's been restarted):

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
Running in hass.io add-on mode
Debugging messages enabled
Sending CONNECT (u0, p0, wr0, wq0, wf0, c1, k60) client_id=b''
Received CONNACK (0, 0)
Sending PUBLISH (d0, q0, r1, m1), 'b'homeassistant/device_automation/mediola_IT_3d5e00/config'', ... (238 bytes)
Sending SUBSCRIBE (d0, m2) [(b'mediola/blinds/mediola/ER_01/set', 0)]
Sending PUBLISH (d0, q0, r1, m3), 'b'homeassistant/cover/mediola_ER_01/config'', ... (381 bytes)
Sending SUBSCRIBE (d0, m4) [(b'mediola/blinds/mediola/ER_02/set', 0)]
Sending PUBLISH (d0, q0, r1, m5), 'b'homeassistant/cover/mediola_ER_02/config'', ... (381 bytes)
Pub: 1
Pub: 3
Pub: 5
Received SUBACK
Subscribed: 2 (128,)
Received SUBACK
Subscribed: 4 (128,)
Sending PINGREQ
Received PINGRESP
Sending PINGREQ
Received PINGRESP
Sending PINGREQ
Received PINGRESP

I was hoping to see details of the messages sent to/received by the Mediola, as I know what they should be for my blinds. Is this possible?

andyboeh commented 2 years ago

All messages the Mediola sends out via UDP and which are received by mediola2mqtt are included in the debug log - your log doesn't show any received message. Is your forwarding for 1902/UDP working properly? Which blinds does your Mediola know about (XC_FNC=GetStates)?

MirandaPoth commented 2 years ago

I've tried both 1901 and 1902 in the Network settings and it doesn't seem to make any difference. How do I check the port forwarding?

GetStates give me this: {XC_SUC}[{"type":"IN","sid":"01","adr":"01","config":"","state":"000063","deviceType":"01"},{"type":"IN","sid":"02","adr":"02","config":"","state":"000064","deviceType":"01"},{"type":"IN","sid":"03","adr":"03","config":"","state":"000000","deviceType":"01"},{"type":"IN","sid":"04","adr":"04","config":"","state":"000064","deviceType":"01"},{"type":"IN","sid":"05","adr":"05","config":"","state":"000064","deviceType":"01"},{"type":"IN","sid":"06","adr":"06","config":"","state":"000064","deviceType":"01"},{"type":"IN","sid":"07","adr":"07","config":"","state":"080064","deviceType":"01"},{"type":"IN","sid":"08","adr":"08","config":"","state":"080064","deviceType":"01"},{"type":"IN","sid":"09","adr":"09","config":"","state":"000064","deviceType":"01"},{"type":"IN","sid":"0A","adr":"10","config":"","state":"000064","deviceType":"01"},{"type":"IN","sid":"0B","adr":"11","config":"","state":"000064","deviceType":"01"},{"type":"IN","sid":"0C","adr":"12","config":"","state":"000064","deviceType":"01"},{"type":"IN","sid":"0D","adr":"13","config":"","state":"000064","deviceType":"01"},{"type":"IN","sid":"0E","adr":"14","config":"","state":"080000","deviceType":"01"}]

andyboeh commented 2 years ago

Sorry, forget about the ports and UDP for the time being. Let's first try to figure out how to control the blinds. Unfortunately, the commands for Internorm blinds are different than for the Elero blinds. Please go to https://api.mediola.com/v5 and request access to the API. You can find a section on "Internorm" there. Then, you need to add the device type "IN" and the commands to mediola2mqtt. The API documentation for the v4 gateway does not list Internorm blinds at all.

I'm sorry, I can't be of further help here since I a) do not have any Internorm blinds b) do not have a v5 gateway and c) do not have the necessary time to develop and debug it remotely.

MirandaPoth commented 2 years ago

I actually know how to control the blinds, I'm currently opening & closing them using scripts in HA. I'm also very happy to do the code changes required to make them work, however I need to be able to see debug messages. I would really appreciate it if you could help just with this part?

andyboeh commented 2 years ago

You are already seeing all debug message mediola2mqtt.py spits out.

MirandaPoth commented 2 years ago

Thanks. I've added some extra messages (and rebuilt etc) and I'm not seeing any messages after mqttc.loop_start() in mediolamqtt.py. Is there a way to see these?

andyboeh commented 2 years ago

I'm sorry, but since I don't know what you have changed, I have no way of helping you. Just a tip for development: Forget about the add-on. Just run the Python script manually on your computer until you're sure it works correctly.