This object is in archive! 

cant publish with mqtt to zipabox

Tom Säll shared this question 6 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

Best Answer
photo

Very easy.

Install MQTT

For a switch (receive status and set value):

- platform: mqtt

name: 'room 1'

state_topic: "/**zipabox ID **/attributes/** switch UUID**/value"

command_topic: "/**zipabox ID **/request/attributes/** switch UUID**/value"

value_template: "{{ value_json.value }}"

payload_on: '{"value":true}'

payload_off: '{"value":false}'

state_on: true

state_off: false


Sensor:

- platform: mqtt

name: "Temp Freezer"

state_topic: "/**zipabox ID **/attributes/** sensor UUID**/value"

unit_of_measurement: '°'

value_template: "{{ value_json.value }}"


hope that help.

A.

Replies (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
1

Hi quizzical.

After each change of settings (via api too) you need to synchronize the device.

/143bef7b3c4365d52bedd36747c68a3d

photo
1

/4fc9885fdc22a46cb19195f55a93c8cf

Hope this helps. Be careful ;-)

photo
2

Very easy.

Install MQTT

For a switch (receive status and set value):

- platform: mqtt

name: 'room 1'

state_topic: "/**zipabox ID **/attributes/** switch UUID**/value"

command_topic: "/**zipabox ID **/request/attributes/** switch UUID**/value"

value_template: "{{ value_json.value }}"

payload_on: '{"value":true}'

payload_off: '{"value":false}'

state_on: true

state_off: false


Sensor:

- platform: mqtt

name: "Temp Freezer"

state_topic: "/**zipabox ID **/attributes/** sensor UUID**/value"

unit_of_measurement: '°'

value_template: "{{ value_json.value }}"


hope that help.

A.

photo
1

Hi,

I dont have a ventilation but this is a cover which I can set from 0 to 100%:

cover:

- platform: mqtt

unique_id: "store"

name: "store"

retain: false

position_topic: "/**zipato ID**/attributes/**UUID**/value"

set_position_topic: "/**zipato ID**/request/attributes/**UUID**/textValue"

value_template: "{{ value_json.value }}"

position_open: 100

position_closed: 0


I have never managed to use the autodiscovery. To find the UUID the best I find is to use the device manager (not device browser), unfold the hierarchy to STATE or the telemetry you want.

If a device has several attributes you must set one configuration per attribute.

photo
1

Hi,

you must define the state (for the switch button status) and brightness (for the slider) value to have a feedback of the state

- platform: mqtt

schema: template

command_topic: "//request/attributes//value"

state_topic: "//attributes//value"

command_on_template: >

{{%- if brightness is defined -%}

"value": {{ brightness | float | multiply(0.3922) | round(0) }}

{% else %}

"value": 100

{%- endif -%}}

command_off_template: '{"value": 0}'

state_template: '{% if value_json.value > 0 %}on{% else %}off{% endif %}'

brightness_template: '{{ value_json.value }}'

photo
1

quizzical, great job!

last week, i started building HA, and now i came to zipabox integration and your posts helped me to create entities. I set up mqtt on HA and on zipabox. I'm able to receive messages from zipabox, but when I send a message to zipabox, nothing happens.

command are:

    state_topic: "/zipato/attributes/154b9ccf-6ba4-4946-bfbf-72a488be165a/value"
    command_topic: "/zipato/request/attributes/154b9ccf-6ba4-4946-bfbf-72a488be165a/value"
i also tried to send commands directly from mqtt.fx.


i was able to turn on max logging on mqtt broker, and in log i see this subscription:

2020-11-17T08:13:21: Received SUBSCRIBE from zipato

2020-11-17T08:13:21: /zipato/request/# (QoS 0)

2020-11-17T08:13:21: zipato 0 /zipato/request/#

I also see, that messages are sent to zipabox:

2020-11-17T08:13:21: Sending PUBLISH to zipato (d0, q0, r1, m0, '/zipato/request/attributes/154b9ccf-6ba4-4946-bfbf-72a488be165a/value', ... (4 bytes))


but, nothings happens :( i also tried almost all combination within topic.


can you help please?

i'm on FW 1.3.13

photo
2

quizzical, "My zipabox seems to sometimes only pass some of the messages". i see same behaviour and no direct solution for it. For example, I see 2-3 times a day, that some door is open, even when it is closed.


I ordered a z-wave.me usb for mi RPI4 and will migrate easy accessible devices. i was able to migrate almost all rules except for heating, this must work these days.

photo
1

i ordered yesterday and it will arrive next week. i have taken z-wave.me because aeotec doesn't work with RPI4. for the inclusion, i will use a power bank for RPI and bring it closer :)

z-wave solution: i will have to read during weekend about it a then play around amd test it with few devices

photo
1

@quizzical: I'm interested in learning more about slave trick for the z-wave usb key. I'm now using jeedom on a RPI3 as my main controler and zipabox only as a gateway for zwave devices replicated in jeedom with mqtt. I also have bought a zwave.me usb key but nothing paired on it yet.

photo
Leave a Comment
 
Attach a file