Zigbeetasmota sensor not working

Hi All , this is driving me crazy for a day now , should be simpel , but can't get it to work
I'm trying my Zigbee sensor to give a simple message if it is closed or open.Probably i'm doing something wrong :slight_smile: Please direct me in the correct direction before i lose all my hair :wink:


http://www.midesign.be/zigbee_flows.json

PS: trying to figure out how to place my files here so bear with me

Hi,

Firstly, dont use JSONata for a simple number compare (unnecessary processing) - use a number
image

Secondly, there is no need for a separate JSON node (set the MQTT to return a parsed object)
image

Lastly, your output debug nodes are set to look at msg.Open and msg.Dicht - these properties do not exist in your message.

Paste code / flow into your reply. Surround your code with three backticks
```
like this
```

See this post for more details - How to share code or flow json

[{"id":"1bb49c42.6eb8e4","type":"tab","label":"Flow 2","disabled":false,"info":""},{"id":"213bd662.a9417a","type":"mqtt in","z":"1bb49c42.6eb8e4","name":"Zigbee Sensor","topic":"tele/ZigbeeBridge/SENSOR","qos":"2","datatype":"json","broker":"11f388b0.3a1d17","nl":false,"rap":true,"rh":0,"x":100,"y":300,"wires":[["bec711dd.04984","78f992a0.2f444c"]]},{"id":"bec711dd.04984","type":"switch","z":"1bb49c42.6eb8e4","name":"Open or Closed","property":"payload.ZbReceived[\"0xEAF9\"].Contact","propertyType":"jsonata","rules":[{"t":"eq","v":"1","vt":"num"},{"t":"eq","v":"0","vt":"num"}],"checkall":"true","repair":false,"outputs":2,"x":260,"y":160,"wires":[["66564a87.12f064"],["b8cb4a8e.f004b8"]]},{"id":"78f992a0.2f444c","type":"debug","z":"1bb49c42.6eb8e4","name":"","active":false,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":280,"y":400,"wires":[]},{"id":"66564a87.12f064","type":"debug","z":"1bb49c42.6eb8e4","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":490,"y":100,"wires":[]},{"id":"b8cb4a8e.f004b8","type":"debug","z":"1bb49c42.6eb8e4","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"payload","targetType":"msg","statusVal":"","statusType":"auto","x":500,"y":220,"wires":[]},{"id":"11f388b0.3a1d17","type":"mqtt-broker","name":"Domoticz master","broker":"127.0.0.1","port":"1883","clientid":"","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"anything","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]

unfortunally , gives the same, no output...

Without a copy of a sample payload, i cannot help.

Copy the output of the MQTT node (using copy value button)
image

paste it in a reply (inside backticks)

Changed it ot just msg.payload, but nothing comes trough

{"ZbReceived":{"0xEAF9":{"Device":"0xEAF9","Name":" Deurcontact Achterdeur","0500<00":"010000010000","ZoneStatusChange":1,"ZoneStatusChangeZone":1,"Contact":1,"Endpoint":1,"LinkQuality":139}}}

It's the Contact i'm trying to capture...

Hi, just for info the JSONata expression would be
payload.ZbReceived.*.Contact for any device
payload.ZbReceived.'0xEAF9'.Contact for the named device, back ticks or quotes.
But as Steve points out there is no need to call JSONata as msg will be fine

Thx, tought that i tried it already like this , but it's WORKING!

:+1: :facepunch: :muscle:

New question about new button , this one gives a response on a click , but the object name changes from 0006!02 for a click, 0006!01 for a double click and 0006!00 for a long click , but the value is always "" (empty) , so how do i do this ?

tele/ZigbeeBridge/SENSOR = {"ZbReceived":{"0x9A61":{"Device":"0x9A61","Name":" Schakelaar Rolluiken","0006!02":"","Power":2,"Endpoint":1,"LinkQuality":131}}}
tele/ZigbeeBridge/SENSOR = {"ZbReceived":{"0x9A61":{"Device":"0x9A61","Name":" Schakelaar Rolluiken","0006!01":"","Power":1,"Endpoint":1,"LinkQuality":120}}}
tele/ZigbeeBridge/SENSOR = {"ZbReceived":{"0x9A61":{"Device":"0x9A61","Name":" Schakelaar Rolluiken","0006!00":"","Power":0,"Endpoint":1,"LinkQuality":120}}}

EDIT: SOLVED: there is a value 'is empty' , so this worked, was to fast to post :relaxed:

1 Like

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