Python Plugin : Mitsubishi AC MQTT interface

Python and python framework

Moderator: leecollings

Post Reply
Masure
Posts: 35
Joined: Sunday 22 April 2018 11:23
Target OS: Windows
Domoticz version:
Contact:

Python Plugin : Mitsubishi AC MQTT interface

Post by Masure »

Hi,

Here is my second plugin :
https://github.com/Masurov/Domoticz-Mit ... QTT-Plugin

It uses the great MQTT serial interface from Swicago

Prerequisites :
- have an ESP flashed with Swicago's MQTT program (see examples folder)
- wiring the ESP according to the schema
- MQTT broker

To sum it up, what you'll get from the plugin :

Image

Hope it will be useful to others
Masure
Posts: 35
Joined: Sunday 22 April 2018 11:23
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin : Mitsubishi AC MQTT interface

Post by Masure »

Plugin updated to 1.1
fixes a bug with python < 3.7 : selector states were messed up at the device creation
Masure
Posts: 35
Joined: Sunday 22 April 2018 11:23
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin : Mitsubishi AC MQTT interface

Post by Masure »

The plugin has been updated :
1.3 Added remote temperature sending to the heatpump

Also forgot to mention this done a while ago :
1.2 Added login and password parameters for MQTT broker connection
DemonAV
Posts: 1
Joined: Monday 05 December 2022 14:58
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin : Mitsubishi AC MQTT interface

Post by DemonAV »

Hello.
Can you check this plugin with last Domoticz for windows beta updates (2022_1.14455 and newer 2022.2...).
Now I have installed 2022.1 (build 14350) and everething work well, but if I try to install any newer, have many erors in Domoticz log about MQTT and can't connect to any heatpump.
I tried several updates (build 14455), (build 14784), (build 14801), (build 14821) but the problem remains, I have to go back to (build 14350).
The second problem is that after updating to (build 14784 and newer) it is no longer possible to return to a working one (build 14350), since the updated database does not allow running the older one (build 14350), so I lose some of the statistical data by restoring the old backup (from build 14350)
Below is the log with errors (build 14821), where only one of your plugins and two heat pumps are added.
Spoiler: show

Code: Select all

2022-12-05 18:42:22.063 Sunrise: 08:44:00 SunSet: 16:00:00
2022-12-05 18:42:22.064 Day length: 07:16:00 Sun at south: 12:22:00
2022-12-05 18:42:22.064 Civil twilight start: 07:58:00 Civil twilight end: 16:45:00
2022-12-05 18:42:22.064 Nautical twilight start: 07:10:00 Nautical twilight end: 17:34:00
2022-12-05 18:42:22.064 Astronomical twilight start: 06:25:00 Astronomical twilight end: 18:19:00
2022-12-05 18:42:22.126 Active notification Subsystems: (0/13)
2022-12-05 18:42:22.150 Starting shared server on: :::6144
2022-12-05 18:42:22.032 Status: Domoticz V2022.2 (build 14821) (c)2012-2022 GizMoCuz
2022-12-05 18:42:22.032 Status: Build Hash: 692d8e93c, Date: 2022-12-05 17:26:33
2022-12-05 18:42:22.033 Status: Startup Path: C:\Program Files (x86)\Domoticz\
2022-12-05 18:42:22.120 Status: PluginSystem: Started, Python version '3.5.2', 1 plugin definitions loaded.
2022-12-05 18:42:22.135 Status: WebServer(HTTP) started on address: :: with port 8081
2022-12-05 18:42:22.136 Status: [web:8081] Adding IPv4 network (127.0.0.*) to list of trusted networks.
2022-12-05 18:42:22.136 Status: [web:8081] Adding IPv4 network (192.168.1.*) to list of trusted networks.
2022-12-05 18:42:22.149 Status: WebServer(SSL) started on address: :: with port 443
2022-12-05 18:42:22.149 Status: [web:443] Adding IPv4 network (127.0.0.*) to list of trusted networks.
2022-12-05 18:42:22.149 Status: [web:443] Adding IPv4 network (192.168.1.*) to list of trusted networks.
2022-12-05 18:42:22.151 Status: TCPServer: shared server started...
2022-12-05 18:42:22.151 Status: RxQueue: queue worker started...
2022-12-05 18:42:22.753 Status: [web:8081] Incoming connection from: 127.0.0.1
2022-12-05 18:42:24.406 HP: Worker thread started.
2022-12-05 18:42:24.624 AC2: Worker thread started.
2022-12-05 18:42:24.445 Status: HP: Entering work loop.
2022-12-05 18:42:24.469 Status: HP: Started.
2022-12-05 18:42:24.634 Status: AC2: Entering work loop.
2022-12-05 18:42:24.692 Status: AC2: Started.
2022-12-05 18:42:25.365 HP: Device named "Power" (key : POW) already exists
2022-12-05 18:42:25.398 HP: Device named "Mode" (key : MODE) already exists
2022-12-05 18:42:25.418 HP: Device named "Flux" (key : FAN) already exists
2022-12-05 18:42:25.419 HP: Device named "Inclinaison" (key : VVANE) already exists
2022-12-05 18:42:25.421 HP: Device named "Direction" (key : WVANE) already exists
2022-12-05 18:42:25.421 HP: Device named "Thermostat" (key : TEMPSET) already exists
2022-12-05 18:42:25.421 HP: Device named "T° Split" (key : TEMP) already exists
2022-12-05 18:42:25.475 HP: Successful connect to: 127.0.0.1:1883
2022-12-05 18:42:25.475 HP: MQTT CONNECT ID: 'Domoticz_MitsubishiHpMqtt_2_1670254945'
2022-12-05 18:42:25.575 AC2: Device named "Power" (key : POW) already exists
2022-12-05 18:42:25.576 AC2: Device named "Mode" (key : MODE) already exists
2022-12-05 18:42:25.576 AC2: Device named "Flux" (key : FAN) already exists
2022-12-05 18:42:25.576 AC2: Device named "Inclinaison" (key : VVANE) already exists
2022-12-05 18:42:25.577 AC2: Device named "Direction" (key : WVANE) already exists
2022-12-05 18:42:25.577 AC2: Device named "Thermostat" (key : TEMPSET) already exists
2022-12-05 18:42:25.577 AC2: Device named "T° Split" (key : TEMP) already exists
2022-12-05 18:42:25.598 HP: MqttClient::onDisonnect Disconnected from: 127.0.0.1:1883
2022-12-05 18:42:25.637 AC2: Successful connect to: 127.0.0.1:1883
2022-12-05 18:42:25.640 AC2: MQTT CONNECT ID: 'Domoticz_MitsubishiHpMqtt_3_1670254945'
2022-12-05 18:42:25.646 AC2: MqttClient::onDisonnect Disconnected from: 127.0.0.1:1883
2022-12-05 18:42:24.913 Status: EventSystem: reset all events...
2022-12-05 18:42:24.913 Status: PluginSystem: 2 plugins started.
2022-12-05 18:42:24.963 Status: NotificationSystem: thread started...
2022-12-05 18:42:25.011 Status: EventSystem: reset all device statuses...
2022-12-05 18:42:25.337 Status: HP: Initialized version 1.3, author 'Masure'
2022-12-05 18:42:25.476 Status: Python EventSystem: Initializing event module.
2022-12-05 18:42:25.477 Status: EventSystem: Started
2022-12-05 18:42:25.477 Status: EventSystem: Queue thread started...
2022-12-05 18:42:25.565 Status: AC2: Initialized version 1.3, author 'Masure'
2022-12-05 18:42:25.598 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 95 for packet type '3' (iQoS:0, topicLen:2048)
2022-12-05 18:42:25.598 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2022-12-05 18:42:25.598 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2022-12-05 18:42:25.641 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 96 for packet type '3' (iQoS:0, topicLen:1536)
2022-12-05 18:42:25.641 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2022-12-05 18:42:25.642 Error: AC2: Call to function 'onMessage' failed, exception details:
2022-12-05 18:42:25.644 Error: AC2: Traceback (most recent call last):
2022-12-05 18:42:25.645 Error: AC2: File "C:\Program Files (x86)\Domoticz\plugins\Domoticz-MitsubishiHpMQTT-Plugin-master\plugin.py", line 313, in onMessage
2022-12-05 18:42:25.645 Error: AC2: _plugin.onMessage(Connection, Data)
2022-12-05 18:42:25.645 Error: AC2: File "C:\Program Files (x86)\Domoticz\plugins\Domoticz-MitsubishiHpMQTT-Plugin-master\plugin.py", line 193, in onMessage
2022-12-05 18:42:25.646 Error: AC2: self.mqttClient.onMessage(Connection, Data)
2022-12-05 18:42:25.646 Error: AC2: File "C:\Program Files (x86)\Domoticz\plugins\Domoticz-MitsubishiHpMQTT-Plugin-master\mqttclient.py", line 95, in onMessage
2022-12-05 18:42:25.646 Error: AC2: if 'Topic' in Data:
2022-12-05 18:42:25.646 Error: AC2: TypeError: a bytes-like object is required, not 'str'
2022-12-05 18:42:34.131 HP: Successful connect to: 127.0.0.1:1883
2022-12-05 18:42:34.131 HP: MQTT CONNECT ID: 'Domoticz_MitsubishiHpMqtt_2_1670254954'
2022-12-05 18:42:34.132 AC2: Successful connect to: 127.0.0.1:1883
2022-12-05 18:42:34.132 AC2: MQTT CONNECT ID: 'Domoticz_MitsubishiHpMqtt_3_1670254954'
2022-12-05 18:42:34.194 AC2: MqttClient::onDisonnect Disconnected from: 127.0.0.1:1883
2022-12-05 18:42:34.194 HP: MqttClient::onDisonnect Disconnected from: 127.0.0.1:1883
2022-12-05 18:42:34.193 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 96 for packet type '3' (iQoS:0, topicLen:1536)
2022-12-05 18:42:34.193 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2022-12-05 18:42:34.193 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2022-12-05 18:42:34.193 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 95 for packet type '3' (iQoS:0, topicLen:2048)
2022-12-05 18:42:34.193 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2022-12-05 18:42:34.193 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2022-12-05 18:42:44.076 HP: Successful connect to: 127.0.0.1:1883
2022-12-05 18:42:44.077 HP: MQTT CONNECT ID: 'Domoticz_MitsubishiHpMqtt_2_1670254964'
2022-12-05 18:42:44.137 AC2: Successful connect to: 127.0.0.1:1883
2022-12-05 18:42:44.137 AC2: MQTT CONNECT ID: 'Domoticz_MitsubishiHpMqtt_3_1670254964'
2022-12-05 18:42:44.202 HP: MqttClient::onDisonnect Disconnected from: 127.0.0.1:1883
2022-12-05 18:42:44.203 AC2: MqttClient::onDisonnect Disconnected from: 127.0.0.1:1883
2022-12-05 18:42:44.201 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 95 for packet type '3' (iQoS:0, topicLen:2048)
2022-12-05 18:42:44.201 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2022-12-05 18:42:44.201 Error: (ProcessInbound) MQTT protocol violation: Invalid message length 96 for packet type '3' (iQoS:0, topicLen:1536)
2022-12-05 18:42:44.201 Error: (ProcessInbound) MQTT protocol violation, sending DisconnectedEvent to Connection.
2022-12-05 18:42:44.202 Error: AC2: Call to function 'onMessage' failed, exception details:
2022-12-05 18:42:44.202 Error: (ProcessInbound) MQTT protocol errored, discarding additional data.
2022-12-05 18:42:44.202 Error: AC2: Traceback (most recent call last):
2022-12-05 18:42:44.203 Error: AC2: File "C:\Program Files (x86)\Domoticz\plugins\Domoticz-MitsubishiHpMQTT-Plugin-master\plugin.py", line 313, in onMessage
2022-12-05 18:42:44.203 Error: AC2: _plugin.onMessage(Connection, Data)
2022-12-05 18:42:44.203 Error: AC2: File "C:\Program Files (x86)\Domoticz\plugins\Domoticz-MitsubishiHpMQTT-Plugin-master\plugin.py", line 193, in onMessage
2022-12-05 18:42:44.203 Error: AC2: self.mqttClient.onMessage(Connection, Data)
2022-12-05 18:42:44.203 Error: AC2: File "C:\Program Files (x86)\Domoticz\plugins\Domoticz-MitsubishiHpMQTT-Plugin-master\mqttclient.py", line 95, in onMessage
2022-12-05 18:42:44.203 Error: AC2: if 'Topic' in Data:
2022-12-05 18:42:44.203 Error: AC2: TypeError: a bytes-like object is required, not 'str'
© 2012-2022 Domoticz | WWW: Domoticz.com
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest