xComfort MQTT - problems

Others (MiLight, Hue, Toon etc...)

Moderator: leecollings

Post Reply
deve87
Posts: 45
Joined: Saturday 08 April 2017 8:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

xComfort MQTT - problems

Post by deve87 »

Raspberry PI

I'm trying to make this code work

https://github.com/karloygard/xcomfortd

When I run xcomfortd -v after I make. Program will connect successfully to mosquitto broker.

But if I tried to run an On command to one of my switch actuators. Mosquitto will disconnect xcomfortd and I get.

Code: Select all

"MQTT Disconnected, The connection was lost"
It will successfully run the On / Off command and actuator react.

Off

Code: Select all

"mosquitto_pub -h localhost -m 'false' -t 'xcomfort/1/set/switch'"
On

Code: Select all

"mosquitto_pub -h localhost -m 'true' -t 'xcomfort/1/set/switch'"
Mosquitto log:

Code: Select all

1561095917: mosquitto version 1.6.2 starting
1561095917: Config loaded from /etc/mosquitto/mosquitto.conf.
1561095917: Opening ipv4 listen socket on port 1883.
1561095917: Opening ipv6 listen socket on port 1883.
1561095933: New connection from ::1 on port 1883.
1561095933: New client connected from ::1 as xcomfort (p2, c0, k30).
1561095933: No will message specified.
1561095933: Sending CONNACK to xcomfort (0, 0)
1561095933: Received SUBSCRIBE from xcomfort
1561095933:   xcomfort/+/set/+ (QoS 0)
1561095933: xcomfort 0 xcomfort/+/set/+
1561095933: Sending SUBACK to xcomfort
1561095943: New connection from ::1 on port 1883.
1561095943: New client connected from ::1 as mosq/4vJKjkgge3tz1JJigB (p2, c1, k60).
1561095943: No will message specified.
1561095943: Sending CONNACK to mosq/4vJKjkgge3tz1JJigB (0, 0)
1561095943: Received PUBLISH from mosq/4vJKjkgge3tz1JJigB (d0, q0, r0, m0, 'xcomfort/1/set/switch', ... (5 bytes))
1561095943: Sending PUBLISH to xcomfort (d0, q0, r0, m0, 'xcomfort/1/set/switch', ... (5 bytes))
1561095943: Received DISCONNECT from mosq/4vJKjkgge3tz1JJigB
1561095943: Client mosq/4vJKjkgge3tz1JJigB disconnected
1561095970: Client xcomfort has exceeded timeout, disconnecting 
deve87
Posts: 45
Joined: Saturday 08 April 2017 8:21
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: xComfort MQTT - problems

Post by deve87 »

I notised something after I programmed a xComfort switch to ckoz0014 via Eaton MRF.
When I started ./xcomfortd -v I get

Code: Select all

MQTT Connected, Connection Accepted.
When I send ex:

Code: Select all

mosquitto_pub -h localhost -m 'true' -t 'xcomfort/1/set/switch'
Switch actuator goes on and verbose shows:

Code: Select all

setting DP 1 to 1 (seq no 0, retry 0)
CKOZ-00/14 version numbers: RFV1.08, USBV1.04
After that, I'm no longer abel to send any more commands.

But!

If I run ./xcomfortd -v and then press one of the buttons.

It's giving me:

Code: Select all

MQTT Connected, Connection Accepted.
CKOZ-00/14 version numbers: RFV1.08, USBV1.04
And if I send an On / Off command after that and then, in between every command, pressing one of the switch buttons. It's actually works..

So it's like it waiting for a respons before it continues.

When I changes line 172:

Code: Select all

if (mosquitto_socket(mosq) != -1)
to any other number than -1 (ex: 0)

Program works (not stabel), but I still need to press switch (one time, on start) after running ./xcomfortd to make it work.
After that, I can set dimming values and turn on/off switches from Domoticz. It will hang and disconnect from mosquitto after some minutes.
If I run ex: true to a switch actuator and than true again. ./xcomfortd program will stop because it don't getting any respons back again because it's already on.

So if that happens, I can press switch button (before 60 sec keep alive), and program will continue before disconnecting.
(Because program wait for a response??)

Like in Issues post 2 (Messages are "delayed" or "off by one") I have the same problem. When I mention that I only needed to press switch one time, I actually need to press it twice becuse message are delayed.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest