[ { "id": "f6f2187d.f17ca8", "type": "tab", "label": "Interactions SMS Jeedom", "disabled": false, "info": "" }, { "id": "c5b96ef3d1a10991", "type": "mqtt in", "z": "f6f2187d.f17ca8", "name": "", "topic": "domotique/protocole/sms2mqtt/received", "qos": "2", "datatype": "auto", "broker": "363e6f8f3abfe491", "nl": false, "rap": true, "rh": 0, "x": 290, "y": 200, "wires": [ [ "50d5660bd928430b" ] ] }, { "id": "8b3399d9321b53a8", "type": "http request", "z": "f6f2187d.f17ca8", "name": "Interactions Jeedom", "method": "GET", "ret": "txt", "paytoqs": "ignore", "url": "http://jeedom/core/api/jeeApi.php?apikey=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx&type=interact&query={{payload.text}}&emptyReply=0", "tls": "", "persist": false, "proxy": "", "authType": "", "x": 640, "y": 360, "wires": [ [ "04f3a01841a1105d" ] ] }, { "id": "4901bb18b2dfc1f0", "type": "switch", "z": "f6f2187d.f17ca8", "name": "Numero autorise ?", "property": "payload.number", "propertyType": "msg", "rules": [ { "t": "cont", "v": "+336xxxxxxx1", "vt": "str" }, { "t": "cont", "v": "+336xxxxxxx2", "vt": "str" }, { "t": "else" } ], "checkall": "true", "repair": false, "outputs": 3, "x": 370, "y": 300, "wires": [ [ "a725c2c145da63d6" ], [ "a725c2c145da63d6" ], [ "d9250ed804e331dd" ] ] }, { "id": "50d5660bd928430b", "type": "json", "z": "f6f2187d.f17ca8", "name": "", "property": "payload", "action": "obj", "pretty": false, "x": 550, "y": 200, "wires": [ [ "4901bb18b2dfc1f0", "f182276c9e9f3ca6" ] ] }, { "id": "5620a2a80a602001", "type": "inject", "z": "f6f2187d.f17ca8", "name": "Ça va ?", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"datetime\": \"2021-08-29 14:07:58\", \"number\": \"+336xxxxxxx1\", \"text\": \"ca va ?\"}", "payloadType": "json", "x": 330, "y": 100, "wires": [ [ "50d5660bd928430b" ] ] }, { "id": "a725c2c145da63d6", "type": "change", "z": "f6f2187d.f17ca8", "name": "Sauvegarde", "rules": [ { "t": "set", "p": "backup", "pt": "msg", "to": "payload", "tot": "msg" } ], "action": "", "property": "", "from": "", "to": "", "reg": false, "x": 610, "y": 300, "wires": [ [ "8b3399d9321b53a8" ] ] }, { "id": "f182276c9e9f3ca6", "type": "debug", "z": "f6f2187d.f17ca8", "name": "", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "false", "statusVal": "", "statusType": "auto", "x": 630, "y": 120, "wires": [] }, { "id": "2e77b9307fc4730b", "type": "debug", "z": "f6f2187d.f17ca8", "name": "", "active": false, "tosidebar": true, "console": false, "tostatus": false, "complete": "payload", "targetType": "msg", "statusVal": "", "statusType": "auto", "x": 930, "y": 420, "wires": [] }, { "id": "04f3a01841a1105d", "type": "function", "z": "f6f2187d.f17ca8", "name": "Reponse par SMS", "func": "msg.payload = {\n \"number\":msg.backup.number,\n \"text\":msg.payload\n};\n\n//delete the backup\nmsg.backup = null;\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 650, "y": 420, "wires": [ [ "2e77b9307fc4730b", "cd850e5a357b0290" ] ] }, { "id": "cd850e5a357b0290", "type": "mqtt out", "z": "f6f2187d.f17ca8", "name": "", "topic": "domotique/protocole/sms2mqtt/send", "qos": "1", "retain": "true", "respTopic": "", "contentType": "", "userProps": "", "correl": "", "expiry": "", "broker": "363e6f8f3abfe491", "x": 1010, "y": 480, "wires": [] }, { "id": "d9250ed804e331dd", "type": "function", "z": "f6f2187d.f17ca8", "name": "Renvoi du SMS non autorise", "func": "var text = \"Le numéro \"+msg.payload.number+\" a envoyé le message suivant : \"+msg.payload.text;\n\nmsg.payload = {\n \"number\":\"+336xxxxxxx1\",\n \"text\":text\n};\n\nreturn msg;", "outputs": 1, "noerr": 0, "initialize": "", "finalize": "", "libs": [], "x": 620, "y": 480, "wires": [ [ "cd850e5a357b0290", "2e77b9307fc4730b" ] ] }, { "id": "613dc508cf880d96", "type": "inject", "z": "f6f2187d.f17ca8", "name": "Numero inconnu", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"datetime\": \"2021-08-29 14:07:58\", \"number\": \"+336xxxxxxx1\", \"text\": \"bla bla bla\"}", "payloadType": "json", "x": 300, "y": 140, "wires": [ [ "50d5660bd928430b" ] ] }, { "id": "fda485af74b4ccc8", "type": "inject", "z": "f6f2187d.f17ca8", "name": "Hello !", "props": [ { "p": "payload" } ], "repeat": "", "crontab": "", "once": false, "onceDelay": 0.1, "topic": "", "payload": "{\"number\": \"+336xxxxxxx1\", \"text\": \"Hello !\"}", "payloadType": "json", "x": 710, "y": 560, "wires": [ [ "cd850e5a357b0290" ] ] }, { "id": "363e6f8f3abfe491", "type": "mqtt-broker", "name": "Mosquitto", "broker": "Jeedom", "port": "1883", "clientid": "", "usetls": false, "protocolVersion": "4", "keepalive": "60", "cleansession": true, "birthTopic": "", "birthQos": "0", "birthPayload": "", "birthMsg": {}, "closeTopic": "", "closeQos": "0", "closePayload": "", "closeMsg": {}, "willTopic": "", "willQos": "0", "willPayload": "", "willMsg": {}, "sessionExpiry": "" } ]