-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path4-telegram-kaukosaadin.json
1 lines (1 loc) · 2.15 KB
/
4-telegram-kaukosaadin.json
1
[{"id":"edc9d29b.ff1e6","type":"function","z":"4a0b88f7.ccc958","name":"Initialize Keyboard","func":"if (msg.payload.content.startsWith('/start')) {\n var opts = {\n reply_to_message_id: msg.payload.messageId,\n reply_markup:\n JSON.stringify({keyboard: [['ON', 'OFF']]})\n }\n msg.payload.options = opts\n return [msg]\n}\n","outputs":1,"noerr":0,"x":450,"y":900,"wires":[["a4026a26.9309d8"]]},{"id":"b70cdde3.8a85f","type":"telegram receiver","z":"4a0b88f7.ccc958","name":"","bot":"1cfd4baa.816844","saveDataDir":"","x":190,"y":900,"wires":[["edc9d29b.ff1e6","46b95d9d.c46bb4"],[]]},{"id":"a4026a26.9309d8","type":"telegram sender","z":"4a0b88f7.ccc958","name":"","bot":"1cfd4baa.816844","x":670,"y":900,"wires":[[]]},{"id":"46b95d9d.c46bb4","type":"function","z":"4a0b88f7.ccc958","name":"Handle Command","func":"let cmd = msg.payload.content\n\nif (cmd in ['ON', 'OFF']) {\n msg.payload = {'state': msg.payload.content}\n msg.topic = `zigbee2mqtt/lights/set`\n return msg;\n}\n\n","outputs":1,"noerr":0,"x":450,"y":960,"wires":[["4c7d817b.96d3f"]]},{"id":"4c7d817b.96d3f","type":"mqtt out","z":"4a0b88f7.ccc958","name":"zigbee2mqtt/X/set","topic":"","qos":"","retain":"","broker":"cf7e7082.ddd0e","x":670,"y":960,"wires":[]},{"id":"1cfd4baa.816844","type":"telegram bot","z":"","botname":"mytelegrambot","usernames":"","chatids":"","baseapiurl":"","pollinterval":"300","usesocks":false,"sockshost":"","socksport":"","socksusername":"","sockspassword":"","bothost":"","localbotport":"","publicbotport":"","privatekey":"","certificate":"","useselfsignedcertificate":false,"verboselogging":false},{"id":"cf7e7082.ddd0e","type":"mqtt-broker","z":"","name":"localhost","broker":"localhost","port":"1883","tls":"28153bed.8f4294","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""},{"id":"28153bed.8f4294","type":"tls-config","z":"","name":"gbridge-tls","cert":"","key":"","ca":"","certname":"","keyname":"","caname":"","servername":"mqtt.gbridge.io","verifyservercert":true}]