i use item for the selector value....
it calls a ON-flow which adds the rest of the values like the idx of the uservar and the ON statement
When IFTTT supports more then one TextFields i only need one flow for ON and OFF...
Code: Select all
[{"id":"7d0d51d5.bda63","type":"tab","label":"switch by name uservar","disabled":false,"info":""},{"id":"efd89514.ce9718","type":"http in","z":"7d0d51d5.bda63","name":"LIVE met post","url":"/pvkapi4","method":"post","upload":false,"swaggerDoc":"","x":150,"y":300,"wires":[["1181d507.972f4b","7654a96c.61c898"]]},{"id":"1181d507.972f4b","type":"http response","z":"7d0d51d5.bda63","name":"responce post","statusCode":"","headers":{"content-type":"application/json"},"x":320,"y":80,"wires":[]},{"id":"f1f5763f.01d648","type":"mqtt out","z":"7d0d51d5.bda63","name":"","topic":"domoticz/in","qos":"","retain":"","broker":"21fd69bf.668b46","x":850,"y":180,"wires":[]},{"id":"d0f0155b.51fc88","type":"debug","z":"7d0d51d5.bda63","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"payload","targetType":"msg","x":850,"y":300,"wires":[]},{"id":"7654a96c.61c898","type":"function","z":"7d0d51d5.bda63","name":"changemsg","func":"//var onoff = context.get('onoff')||'ON';\nonoff = 'ON';\ndelim = '/';\nitem = msg.payload.item;\n\n// store the value back\n//context.set('onoff',onoff);\nmsg.payload.command = \"setuservariable\";\nmsg.payload.idx = 12;\nmsg.payload.value = msg.payload.value + delim + onoff + delim + item;\nreturn msg;","outputs":1,"noerr":0,"x":570,"y":300,"wires":[["f1f5763f.01d648","d0f0155b.51fc88"]]},{"id":"f533574f.ce41e8","type":"inject","z":"7d0d51d5.bda63","name":"input switch lantaarn by name","topic":"","payload":"{\"value\":\"lantaarn\",\"item\":\"\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":260,"y":420,"wires":[["7654a96c.61c898"]]},{"id":"83b507da.d09258","type":"inject","z":"7d0d51d5.bda63","name":"input selector usb lamp by name","topic":"","payload":"{\"value\":\"usb lamp\",\"item\":\"Flame\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":270,"y":460,"wires":[["7654a96c.61c898"]]},{"id":"78f9f3e.f12710c","type":"inject","z":"7d0d51d5.bda63","name":"input group Sfeerverlichting by name","topic":"","payload":"{\"value\":\"Sfeerverlichting\",\"item\":\"\"}","payloadType":"json","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":280,"y":500,"wires":[["7654a96c.61c898"]]},{"id":"21fd69bf.668b46","type":"mqtt-broker","z":"","name":"mqttdomoticz","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":""}]