Hey,
I'm having a problem with the trigger node and I'm not quite sure if it's the way it's meant to work or a bug.
The functionality I'm trying to achieve is:
- forward all messages
- if no message has arrived for 5 mins, set offline mode
Does the trigger node swallow all messages (except the first one) or should it always forward the input message when configured to send the input message?
[{"id":"50923526.944fbc","type":"trigger","z":"60e86883.187908","name":"","op1":"","op2":"{\"online\": false}","op1type":"pay","op2type":"json","duration":"5","extend":true,"overrideDelay":false,"units":"min","reset":"","bytopic":"topic","topic":"topic","outputs":1,"x":550,"y":140,"wires":[["2600df68.b08ce"]]},{"id":"540ee0c9.953ba","type":"function","z":"60e86883.187908","name":"Map","func":"return {\n payload: {\n on: msg.payload.state === 'ON',\n online: true,\n },\n topic: msg.topic,\n};","outputs":1,"noerr":0,"initialize":"","finalize":"","libs":[],"x":330,"y":140,"wires":[["50923526.944fbc","398563bd.8873ec"]]},{"id":"c1e5338b.31e34","type":"mqtt in","z":"60e86883.187908","name":"","topic":"zigbee2mqtt/light/+","qos":"2","datatype":"json","broker":"f569d34c.8c7ed","nl":false,"rap":true,"rh":0,"x":150,"y":140,"wires":[["540ee0c9.953ba"]]},{"id":"2600df68.b08ce","type":"debug","z":"60e86883.187908","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":730,"y":140,"wires":[]},{"id":"398563bd.8873ec","type":"debug","z":"60e86883.187908","name":"","active":true,"tosidebar":true,"console":true,"tostatus":false,"complete":"true","targetType":"full","statusVal":"","statusType":"auto","x":730,"y":80,"wires":[]},{"id":"f569d34c.8c7ed","type":"mqtt-broker","name":"","broker":"localhost","port":"1883","clientid":"node-red","usetls":false,"protocolVersion":"4","keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","birthMsg":{},"closeTopic":"","closeQos":"0","closePayload":"","closeMsg":{},"willTopic":"","willQos":"0","willPayload":"","willMsg":{},"sessionExpiry":""}]
Cheers!