@gaelbillon hier sind die Erklärungen für das Freebox-Modul von Node-RED
Zuerst muss ein MQTT-Gerät mit den Funktionen Position des Rollladens und Zustand des Rollladens erstellt werden
In Node-RED muss das Modul node-red-contrib-freebox installiert und natürlich die Verbindung mit dem MQTT-Broker Gladys erstellt werden.
Bei der ersten Anfrage muss die Verwendung von Node-RED mit der Freebox bestätigt werden.
Dazu muss auf der Frontseite deiner Freebox bestätigt werden.
Anschließend muss Node-RED die Berechtigung erhalten, die Informationen des Sicherheits-Packs in den Einstellungen der Freebox zu lesen.
Dazu auf Freebox-OS, Einstellungen / Zugriffsverwaltung gehen

In der Zugriffsverwaltung, im Tab Anwendung, muss eine Zeile gefunden werden, die Node-RED entspricht
Auf den Stift zum Bearbeiten rechts klicken
Die Option Alarmanlage und Smart Home aktivieren

Unten ein erster Flow, um die Verbindung zu testen und die Rückmeldung aller Geräte des Sicherheits-Packs zu erhalten.
[
{
"id": "1d67dee27a16208d",
"type": "group",
"z": "d7c3929073ea7b03",
"name": "Call API Freebox",
"style": {
"fill": "#dbcbe7",
"label": true,
"color": "#000000"
},
"nodes": [
"4f8f16965ae54f50",
"72e75292b4cb21f9",
"7dd73ca182891c1b"
],
"x": 1254,
"y": 699,
"w": 552,
"h": 82
},
{
"id": "4f8f16965ae54f50",
"type": "api",
"z": "d7c3929073ea7b03",
"g": "1d67dee27a16208d",
"name": "",
"url": "",
"server": "35b9faf136b9302a",
"x": 1530,
"y": 740,
"wires": [
[
"72e75292b4cb21f9"
]
]
},
{
"id": "72e75292b4cb21f9",
"type": "debug",
"z": "d7c3929073ea7b03",
"g": "1d67dee27a16208d",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1690,
"y": 740,
"wires": []
},
{
"id": "7dd73ca182891c1b",
"type": "inject",
"z": "d7c3929073ea7b03",
"g": "1d67dee27a16208d",
"name": "/home/tileset",
"props": [
{
"p": "url",
"v": "/home/tileset/all",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"x": 1370,
"y": 740,
"wires": [
[
"4f8f16965ae54f50"
]
]
},
{
"id": "35b9faf136b9302a",
"type": "freebox-server",
"host": "https://mafreebox.freebox.fr",
"port": "443"
}
]
Hier der Ablauf eines Flügels
[
{
"id": "18e154108b13c26c",
"type": "group",
"z": "d7c3929073ea7b03",
"name": "Bürofenster",
"style": {
"stroke": "#7fb7df",
"label": true,
"fill": "#92d04f",
"color": "#000000"
},
"nodes": [
"3e15afd9376757c9",
"a49eaa136556eee7",
"a748fcd15020c73e",
"10b39b8328881bdb",
"1ecb5525b3ad37c6",
"a7c2664d98109c89",
"fd923244d0fb66d2",
"2a32a9e720ae58f3",
"31a13ffcc844be3f",
"26f4754086a73f61",
"768a96d8a1add8e5",
"3bdfec7e2be1d3cb",
"3dab952dd0a739a3",
"83331d58417a9467",
"30d53f3a1ed9df4c",
"277875ed0aa28e4b"
],
"x": 54,
"y": 1179,
"w": 1512,
"h": 342
},
{
"id": "3e15afd9376757c9",
"type": "mqtt in",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "Gladys-Wert",
"topic": "gladys/device/mqtt:volet_bureau/feature/mqtt:position_volet_bureau/state",
"qos": "2",
"datatype": "auto-detect",
"broker": "05eac840560ca08c",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 150,
"y": 1220,
"wires": [
[
"83331d58417a9467"
]
]
},
{
"id": "a49eaa136556eee7",
"type": "mqtt out",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "Gladys-Wert aktualisieren",
"topic": "gladys/master/device/mqtt:volet_bureau/feature/mqtt:position_volet_bureau/state",
"qos": "2",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "05eac840560ca08c",
"x": 1080,
"y": 1480,
"wires": []
},
{
"id": "a748fcd15020c73e",
"type": "mqtt in",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "Gladys-Wert",
"topic": "gladys/device/mqtt:volet_bureau/feature/mqtt:cmd_volet_bureau/state",
"qos": "2",
"datatype": "auto-detect",
"broker": "05eac840560ca08c",
"nl": false,
"rap": true,
"rh": 0,
"inputs": 0,
"x": 150,
"y": 1320,
"wires": [
[
"10b39b8328881bdb"
]
]
},
{
"id": "10b39b8328881bdb",
"type": "json",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 290,
"y": 1320,
"wires": [
[
"1ecb5525b3ad37c6"
]
]
},
{
"id": "1ecb5525b3ad37c6",
"type": "switch",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "num"
},
{
"t": "eq",
"v": "0",
"vt": "num"
},
{
"t": "eq",
"v": "-1",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 3,
"x": 410,
"y": 1320,
"wires": [
[
"fd923244d0fb66d2",
"31a13ffcc844be3f"
],
[
"a7c2664d98109c89"
],
[
"2a32a9e720ae58f3",
"31a13ffcc844be3f"
]
],
"outputLabels": [
"Öffnen",
"Stop",
"Schließen"
]
},
{
"id": "a7c2664d98109c89",
"type": "function",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "STOP",
"func": "msg.url = \"/home/endpoints/30/1\"\nmsg.method = \"PUT\"\nmsg.payload = {\n \"value\": null\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 710,
"y": 1320,
"wires": [
[
"30d53f3a1ed9df4c"
]
]
},
{
"id": "fd923244d0fb66d2",
"type": "function",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "ÖFFNEN",
"func": "msg.url = \"/home/endpoints/30/3\"\nmsg.method = \"PUT\"\nmsg.payload = {\n \"value\": 0\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 710,
"y": 1280,
"wires": [
[
"30d53f3a1ed9df4c"
]
]
},
{
"id": "2a32a9e720ae58f3",
"type": "function",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "SCHLIESSEN",
"func": "msg.url = \"/home/endpoints/30/3\"\nmsg.method = \"PUT\"\nmsg.payload = {\n \"value\": 100\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 720,
"y": 1360,
"wires": [
[
"30d53f3a1ed9df4c"
]
]
},
{
"id": "31a13ffcc844be3f",
"type": "trigger",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "Warten auf stabilen Wert",
"op1": "",
"op2": "",
"op1type": "nul",
"op2type": "payl",
"duration": "15",
"extend": true,
"overrideDelay": false,
"units": "s",
"reset": "",
"bytopic": "all",
"topic": "topic",
"outputs": 1,
"x": 500,
"y": 1400,
"wires": [
[
"3dab952dd0a739a3"
]
]
},
{
"id": "26f4754086a73f61",
"type": "poll",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "Bürofenster",
"url": "/home/tileset/30",
"interval": "3000",
"server": "35b9faf136b9302a",
"x": 150,
"y": 1480,
"wires": [
[
"768a96d8a1add8e5"
]
]
},
{
"id": "768a96d8a1add8e5",
"type": "function",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "Nur den Wert erhalten",
"func": "msg.payload = 100 - msg.payload[0].data[0].value;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 750,
"y": 1480,
"wires": [
[
"a49eaa136556eee7"
]
]
},
{
"id": "3bdfec7e2be1d3cb",
"type": "mqtt out",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "Gladys-Wert aktualisieren",
"topic": "gladys/master/device/mqtt:volet_bureau/feature/mqtt:cmd_volet_bureau/state",
"qos": "2",
"retain": "",
"respTopic": "",
"contentType": "",
"userProps": "",
"correl": "",
"expiry": "",
"broker": "05eac840560ca08c",
"x": 1080,
"y": 1400,
"wires": []
},
{
"id": "3dab952dd0a739a3",
"type": "function",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "Wert auf 0 setzen",
"func": "msg.payload = 0;\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 740,
"y": 1400,
"wires": [
[
"3bdfec7e2be1d3cb"
]
]
},
{
"id": "83331d58417a9467",
"type": "function",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "In den korrekten Wert umwandeln",
"func": "msg.url = \"/home/endpoints/30/3\"\nmsg.method = \"PUT\"\nmsg.payload = {\n \"value\": 100 - msg.payload\n}\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 780,
"y": 1220,
"wires": [
[
"30d53f3a1ed9df4c"
]
]
},
{
"id": "30d53f3a1ed9df4c",
"type": "api",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "",
"url": "",
"server": "35b9faf136b9302a",
"x": 1250,
"y": 1320,
"wires": [
[
"277875ed0aa28e4b"
]
]
},
{
"id": "277875ed0aa28e4b",
"type": "debug",
"z": "d7c3929073ea7b03",
"g": "18e154108b13c26c",
"name": "",
"active": true,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "payload",
"targetType": "msg",
"statusVal": "",
"statusType": "auto",
"x": 1450,
"y": 1320,
"wires": []
},
{
"id": "05eac840560ca08c",
"type": "mqtt-broker",
"name": "GladysMQTT",
"broker": "192.168.*.***",
"port": "1883",
"clientid": "",
"autoConnect": true,
"usetls": false,
"protocolVersion": "4",
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"birthMsg": {},
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"closeMsg": {},
"willTopic": "",
"willQos": "0",
"willPayload": "",
"willMsg": {},
"userProps": "",
"sessionExpiry": ""
},
{
"id": "35b9faf136b9302a",
"type": "freebox-server",
"host": "https://mafreebox.freebox.fr",
"port": "443"
}
]
Was du in Gladys erhalten wirst
Falls du Fragen hast, zögere nicht.