Zigbee2mqtt struggling with inputs PTVO unit and Nodered [SOLVED]
Posted: Sunday 20 September 2020 15:32
I want to use a PTVO unit (based on a CC2530 + CC2591) with 2 inputs and 1 output. The configuration is as follows:
The unit was easy to paire using the python plugin zigbee2mqtt. The following devices have been created automatically (see attachment 1 bottom page)
The results of the testing are as follows:
Activation of a switch on input 1 of the PTVO unit gives no response in Domoticz (IDX 112)
Activation of a switch on input 2 of the PTVO unit does not give a response in Domoticz (IDX 113)
Activation of IDX 114 in the Domoticz web interface activates the corresponding output of the PTVO unit as desired.
Switching inputs 1 and 2 gives the following reactions in the Domoticz log.
The PTVO unit is working properly. I need some help linking the inputs of the unit to Domoticz.
I know I have to use NodeRed but I get stuck on the function node.
Output DEBUG PTVO schuur (see attachment 3)
Output DEBUG function node (see attechment 2)
IDX 118 switches as desired, IDX 117 does not.
Thanks in advance!
Code: Select all
Board type: CC2530 + CC2591
Model ID: ptvo.switch
Location description: Schuur
Power saving mode (PSM): No
Output pins:
P13: Output 1, GPIO, Pull-down, Remember state
P12: Output 2, GPIO, Pull-down, Remember state
P16: Output 3, GPIO, Pull-down, Remember state
Input pins:
P03: Input 1, GPIO, Pull-down, Switch, Link to out 1
P02: Input 2, GPIO, Pull-down, Switch, Link to out 2
The results of the testing are as follows:
Activation of a switch on input 1 of the PTVO unit gives no response in Domoticz (IDX 112)
Activation of a switch on input 2 of the PTVO unit does not give a response in Domoticz (IDX 113)
Activation of IDX 114 in the Domoticz web interface activates the corresponding output of the PTVO unit as desired.
Switching inputs 1 and 2 gives the following reactions in the Domoticz log.
Code: Select all
2020-09-20 15:22:04.251 (Zigbee bridge) MqttClient::ping
2020-09-20 15:22:04.553 (Zigbee bridge) MQTT message: zigbee2mqtt/Schuur {'linkquality': 85, 'state_l1': 'OFF', 'state_l2': 'OFF', 'state_l3': 'OFF'}
2020-09-20 15:22:04.607 (Zigbee bridge) MQTT message: zigbee2mqtt/Schuur {'linkquality': 85, 'state_l1': 'OFF', 'state_l2': 'OFF', 'state_l3': 'OFF'}
2020-09-20 15:22:04.610 (Zigbee bridge) MQTT message: zigbee2mqtt/Schuur {'linkquality': 85, 'state_l1': 'OFF', 'state_l2': 'OFF', 'state_l3': 'OFF'}
2020-09-20 15:22:05.415 (Zigbee bridge) MQTT message: zigbee2mqtt/Schuur {'linkquality': 83, 'state_l1': 'OFF', 'state_l2': 'ON', 'state_l3': 'OFF'}
2020-09-20 15:22:07.533 (Zigbee bridge) MQTT message: zigbee2mqtt/Schuur {'linkquality': 80, 'state_l1': 'OFF', 'state_l2': 'OFF', 'state_l3': 'OFF'}
2020-09-20 15:22:12.050 (Zigbee bridge) MQTT message: zigbee2mqtt/Schuur {'linkquality': 88, 'state_l1': 'ON', 'state_l2': 'OFF', 'state_l3': 'OFF'}
2020-09-20 15:22:13.066 (Zigbee bridge) MQTT message: zigbee2mqtt/Schuur {'linkquality': 85, 'state_l1': 'OFF', 'state_l2': 'OFF', 'state_l3': 'OFF'}
2020-09-20 15:22:14.231 (Zigbee bridge) MqttClient::ping
I know I have to use NodeRed but I get stuck on the function node.
Code: Select all
[{"id":"f67e81dd.a7aef","type":"tab","label":"Schuur","disabled":false,"info":""},{"id":"68a4ac18.550654","type":"mqtt in","z":"f67e81dd.a7aef","name":"PTVO schuur","topic":"zigbee2mqtt/Schuur","qos":"2","datatype":"auto","broker":"4595d216.dc87fc","x":160,"y":180,"wires":[["d4661a0c.c08fd8"]]},{"id":"d4661a0c.c08fd8","type":"json","z":"f67e81dd.a7aef","name":"","property":"payload","action":"","pretty":false,"x":390,"y":180,"wires":[["73382182.355cc","e1b3a50c.4adfc8"]]},{"id":"73382182.355cc","type":"function","z":"f67e81dd.a7aef","name":"","func":"var msg1 ={}; // Deurcontact IDX:117\nvar msg2 ={}; // PIR IDX:118\n\ndelete msg.payload.linkquality;\ndelete msg.payload.state_l3;\n\n\nreturn [[msg1,msg2]];","outputs":1,"noerr":0,"initialize":"","finalize":"","x":580,"y":180,"wires":[["57907cc1.d8a824"]]},{"id":"57907cc1.d8a824","type":"mqtt out","z":"f67e81dd.a7aef","name":"Domoticz In","topic":"domoticz/in","qos":"","retain":"","broker":"9220d244.9bc46","x":830,"y":180,"wires":[]},{"id":"e1b3a50c.4adfc8","type":"debug","z":"f67e81dd.a7aef","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":580,"y":260,"wires":[]},{"id":"4595d216.dc87fc","type":"mqtt-broker","z":"","name":"Zigbee","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"domoticz/bridge/state","birthQos":"0","birthPayload":"online","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"9220d244.9bc46","type":"mqtt-broker","z":"","name":"MQTT_Server","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
Output DEBUG function node (see attechment 2)
IDX 118 switches as desired, IDX 117 does not.
Thanks in advance!