cant publish with mqtt to zipabox

Tom Säll shared this question 2 years ago
Answered

Hi,

I have created a virtual switch which i want to control using mqtt.

If i subscribe to its topic i receive the change of states (true/false) so its working as it should.


but when i try to publish to the device nothing happens.

im using bevywise mqttroute as broker and i can see that the broker sends the message to the zipabox in the webui.

according to mqttroute my zipabox is subscribing to /boxserial/request/#

i have tried the following syntax.


/boxserial/request/attributes/uuid/textValue -> true

/boxserial/request/attributes/uuid/value-> {"value":true}

request/attributes/uuid/value-> {"value":true}

request/attributes/uuid/textValue -> true

also tried to replace true and false with 1 and 0

im using mqtt.fx when im subscribing and try to publish. i can publish to all my other topics except the for the zipabox.


// Thanks

Comments (6)

photo
1

Hi,


I have the same issue, for example when i use cloudMQTT. On change status of virtual, i see on the console:

/zipato/attributes/XXXXX/value{"value":true,"timestamp":"2018-02-26T13:06:34Z"}

But if i tried to publish with this syntax:

request/attributes/0ded8ce4-XXXX2b5b473f/Valuetrue (or json ssyntax)


Nothing appened......

I do not help but it shows that there is little concern

photo
1

I have the exact same issue, I've been trying 1.3.13 beta firmware today with no success.It used to work in firmware 1.2.29 released one hear ago (......), where you could publish to topics such as request/attributes/uuid/value to have the value updated. In versions after that sadly it's been broken.

In versions after 1.2.29 it seems that they have added the topicBase and topicPrefix to the request topic as it subscribes to the pattern topicBase/topicPrefix/request/# (which I think is more correct). However, just like you I've tried to publish all sorts of topic combinations with no success, but I know for a fact that it used to work before.

photo
1

I've just been trying to set up MQTT today. I had firmware 1.3.13, which indeed doesn't work. Rather than trying to roll back - having seen comments suggesting that you need to get in touch with support and ask them to roll back to a firmware version on which MQTT worked properly - I updated to the latest beta firmware 1.3.44. I've only tried setting values on switches, but that now works well on 1.3.44, having not worked on 1.3.13.

photo
2

Hi Neil,

Can you update us on experience with Zipato 1.3.44 during last month of using it? Have you encountered any issues or everything workes fine?

Thanks in advance!

photo
1

Everything works fine. This comes with a disclaimer that I no longer have all that much going on on the Zipabox, so the scope of "everything" is limited - I'd moved a lot of devices to SmartThings shortly before discovering this MQTT feature. The few devices and rules I've still got on the Zipabox have been working flawlessly on the beta firmware.

The one thing which I did need to intervene on was that once the Zipabox disconnected from the MQTT broker. It was fixed by a simple empty PUT request. I think it was probably an issue with the broker rather than the Zipabox though, and it's trivial to recover.

photo
1

Hi,

Unfortunately I have observed that beta 1.3.44 can't connect to MQTT broker. Zipato Support confirmed that issue exists in latest beta and they recommend to keep version 1.2.29 until the bug is resolved. So information for MQTT users is that beta 1.3.44 doesn't work with MQTT .

photo
1

It must depend on the broker. What have you tried Tomasz? I've got an installation of the Docker eclipse-mosquitto image running on my local network, and that connects just fine. It's over mqtt protocol (not websockets), uses user/pass authentication but not tls.

photo
1

I used mosquitto without security (no websockets, no ssl, no user-pass) and I had no connection attempt from zipabox. Support confirmed issue and asked me to wait for update announcement. I don't know if there can be various versions of 1.3.44, but mine certainly doesn't connect to broker :)

photo
photo
1

That's great news! Could you please share experience with 1.3.44 version in one week or so? Maybe it's good way to go, however with unstable version it's hard to tell...

photo
1

HI,

so can you please advise what is the latest firmware that MQTT is working correctly on?

and what endpoint syntax to use?


Thanx,

D

photo
2

Latest software that works with MQTT is 1.2.29, Zipabox is listening to topic request/# and you can send attribute change requests to topics in format:

request/attributes/ATTRIBUTE-GUID-HERE/value with payload {"value":true}

photo
2

I can't make it work for me with firmware 1.3.61. Is it me the problem or it is the firmware version ? Please advise. I im trying to send request from Jeedom with plugin MQTT (I already receive all info of my zipabox devices without any issue). I'm trying to change http request to virtual switches with MQTT requests. Thanks.

photo
2

Hi

pleae find attached the latest version of MQTT documentation. We hope it helps.

photo
1

Hi,

I believe I'm doing the right thing according to the documentation.

Set attribute Request Topic: request/attributes/UUID/value

Response/Result Topic: /local/ha/bridges/zipato/attributes/UUID/attributeChangeEvents

Request Topic Payload Type: JSON Payload example: (for binary switches for example) { "value": "true" }

Description: Set attribute state with simple JSON objects

I'll will experiment more, but I was wondering if I was bound to fail with the firmaware version I'm using.

Thanks.

photo
1

Hi,

I don't think 1.3.61 is a problem. Although i'm on 1.3.98 in the past i was on 1.3.61 and never encountered a problem.

For UUID: did you use the UUID of the STATE attribute of the virtual switch?

photo
1

Thanks everyone. I managed to changer my virtual switch status with mosquitto_pub. So my problem is with my jeedom plugin.

photo
1

@John Rabbit,

do you really managed to publish to devices on 1.3.61 ? It does not works on my side (zipabox 1, mosquitto broker), the support told me that it wont work on this fw version so I gave up using MQTT...

Thanks

Alain

photo
1

@Alain

Yes I am sure. But to be more sure: this morning i rolled back to fw 1.3.61. And everything was working perfectly.

However: i am using Zipabox2. Maybe that's the reason. I don't know.


John

photo
photo
1

For me firmware 1.3.61 works on zipabox1. Just to confirm.

photo
1

@Olivier,


Thanks for your observation. We now know QTT works on 1.3.61 for zipabox1 and 2 as well.

@Alain: is it possible to give a example of the topic to which you are publishing and the value? Maybe there is some error in this.

photo
1

Thank you all,


This is my config:

{

"className": "com.zipato.network.mqtt.MqttNetwork",

"password": null,

"clientId": null,

"qos": 2,

"topicPrefix": null,

"name": "MQTT-zipabox",

"broker": "tcp://192.168.1.70:1883",

"uuid": "** UUID of mqtt network **",

"topicBase": null,

"username": null,

"tags": null,

"order": null

}


mosquitto_pub I tried without success:

mosquitto_pub -h localhost -t request/attributes/** UUID of STATE of virtual switch **/textValue -m true

mosquitto_pub -h localhost -t request/attributes/** UUID of STATE of virtual switch **/value -m {\"value":\"true"}


mosquitto_pub -h localhost -t request/attributes/** UUID of STATE of virtual switch **/value -m {"value":true}

mosquitto_pub -h localhost -t request/attributes/** UUID of STATE of virtual meter **/value -m {"value":10}

photo
1

Hi Alain,,

I compared your config with mine. The only difference is that i have filled in clientid with "zipato" in the config.

My topics are starting with "/zipato/request/attributes/....." so starting with "/"+ clientid. Just for a wild guess: with a clientid of : "null" should your topic start with: "/"+ "request...". So an additional "/" in front? So: /request/attributes/** UUID of STATE of virtual switch **/textValue?


Good luck!

photo
1

Hi Alain.This query string looks like this to me

/ZT782AC4 ********/request/attributes/******* - 0a1c-4e5f-9e4c - ******/textValue

The value to send is "0 or 1"

photo
1

Hi Dima,

@Alain. Dima you're right. if the clientid is null, the box serial number is inserted.

Look at this code;

  1. String effectiveClientId = clientId != null ? clientId : ZipatoHelper.getSerial();
  2. String base = topicBase;
  3. if (base == null) {
  4. base = "/";
  5. }
  6. String prefix = topicPrefix;
  7. if (prefix == null) {
  8. prefix = effectiveClientId + '/';
  9. }
  10. root = base + prefix;

So Dima you're topic is /serialnumber/request/attr.... and that's exactly what Alain should use. Or he must change the clientid in the config in a value <> null.


Cheers,

John

photo
1

I agree with you John.

"Or he must change the clientid in the config in a value <> null."

photo
1

Thank you for your advises.

I think that I have try every combinaison possibles with or without clientId, all with no luck....


with "clientId": "client" :

client/request/attributes/91****39f/textValue -m "1"

/client/request/attributes/91****39f/textValue -m "1"

/0*serial*3/request/attributes/91***39f/textValue -m "1"

0***3/request/attributes/91***39f/textValue -m "1"

/request/attributes/91***39f/textValue -m "1"

request/attributes/91***39f/textValue -m "1"


and with "clientId": null

/0***3/request/attributes/91***39f/textValue -m "1"

0***3/request/attributes/91***39f/textValue -m "1"

/request/attributes/91***39f/textValue -m "1"

request/attributes/91***39f/textValue -m "1"

Note in the documentation there is a response topic:

Request Topic: request/attributes/UUID/textValue

Response/Result Topic: /local/ha/bridges/zipato/attributes/UUID/attributeChangeEvents

I have never seen any message on this /local/ha topic

photo
1

@Alain,

Can you add the -d option to the request: so:

/client/request/attributes/91****39f/textValue -m "1" -d

Maybe this debug option can give some additional info.

photo
2

well, I did a reboot of the box and now it is working with this format :

/serial/request/attributes/UUID/textValue

Thank you so much John, Dima and Olivier for your help

Alain

photo
1

For me it's working with mosquitto_pub -t "zipatozipabox/request/attributes/UUID/value" -m '{"value":true}'

my config is

"clientId": null,

"qos": 2,

"topicPrefix": "zipabox",

"name": "MQTT",

"topicBase": "zipato"

photo
1

Yes, thank you Olivier, that is working for me too.

I should advise support that MQTT is ok !!

photo