Problem with Zigbee2mqtt out node

Hi,
Hoping someone can assist me with an issue using zigbee2mqtt out node (node-red-contrib-zigbee2mqtt) and an Aqara wireless dual relay.
I am receiving correct states from the relay:

Jul 13 20:55:08 lysekil npm[12867]: zigbee2mqtt:info  2020-07-13 20:55:08: MQTT publish: topic 'zigbee2mqtt/0x00158d000444ebab', payload '{"power":0.03,"consumption":0,"temperature":30,"linkquality":10,"state":"ON","state_l1":"OFF","state_l2":"OFF"}'

I am unable to inject a correct command to the out node in order to turn on the two relays and this is the first time using the this node, as my other sensors are motion sensors, which only use the "in"-node.

The documentation on zigbee2mqtt.io states that this sensor take the following commands:

switch:
  - platform: "mqtt"
    state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
    availability_topic: "zigbee2mqtt/bridge/state"
    payload_off: "OFF"
    payload_on: "ON"
    value_template: "{{ value_json.state_l1 }}"
    command_topic: "zigbee2mqtt/<FRIENDLY_NAME>/l1/set"

l1 for relay 1 and l2 for relay 2.
So my inject and out node looks like this:

[{"id":"396506a0.bf435a","type":"inject","z":"75d53786.992d","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"zigbee2mqtt/0x00158d000444ebab//l1/set","payload":"{\"state\":\"ON\"}","payloadType":"json","x":250,"y":360,"wires":[["23bdb543.5a12ea","9ac0fee2.5060d"]]},{"id":"9ac0fee2.5060d","type":"zigbee2mqtt-out","z":"75d53786.992d","name":"Switch out","server":"2965400e.bf4508","friendly_name":"0x00158d000444ebab","device_id":"0x00158d000444ebab","command":"state","commandType":"z2m_cmd","payload":"on","payloadType":"z2m_payload","transition":0,"x":470,"y":360,"wires":[]},{"id":"2965400e.bf4508","type":"zigbee2mqtt-server","z":"","name":"","host":"localhost","mqtt_port":"1883","mqtt_username":"xxxxxx","mqtt_password":"xxxxxx.","base_topic":"zigbee2mqtt"}]

Basically I am trying to inject a payload {"state":"ON"} to this topic zigbee2mqtt/0x00158d000444ebab//l1/set , but that is obviously wrong as
it gives me this error:

Jul 13 21:32:04 lysekil npm[12867]: zigbee2mqtt:info  2020-07-13 21:32:04: MQTT publish: topic 'zigbee2mqtt/bridge/log', payload '{"type":"zigbee_publish_error","message":"Publish 'set' 'state' to '0x00158d000444ebab' failed: 'Error: Command 0x00158d000444ebab/1 genOnOff.off({}, {\"timeout\":10000,\"disableResponse\":false,\"disableDefaultResponse\":false,\"direction\":0,\"srcEndpoint\":null,\"reservedBits\":0,\"manufacturerCode\":null,\"transactionSequenceNumber\":null}) failed (Error: Data request failed with error: 'MAC no ack' (233))'","meta":{"friendly_name":"0x00158d000444ebab"}}'

Furthermore I am a little puzzled as to how to set the "command" and "payload" options in the the "out" node.

I hope all this makes sense - otherwise please ask. Basically just looking for the correct message to inject to out node, in order to turn on/off the 2 relays.

Thanks!

I didn't check your flow but here you have 2 slashes // in the topic instead of one. Also based on the documentation you sent, I think the payload should be just "ON" or "OFF.

Thanks a lot for your reply. The double slash was an error that I had already fixed, but the ON instead of "state":"ON" fixed it :slight_smile:
Thanks!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.