Hallo Gemeinde,
ich bin der Neue…
Kurz zu mir, ich bin nach einem Defekt an meinem Fibaro HC2 auf homee umgestiegen, weil mir die, durch die zusätzlichen Würfel, möglichen Geräte gut gefallen haben.
Ich hätte mehr recherchieren sollen - aber das vielleicht mal in einem anderen Thread…
Da es bei homee mit Bordmitteln ja nichteinmal möglich ist, zwei Werte miteinander zu vergleichen, kam ich um Node Red ohnehin nicht herum, also habe ich in diesem Zuge auch noch ioBroker aufgesetzt. An dieser Stelle Danke an @Micha
Da Node Red und ioBroker nun einmal da waren, braucht man ja auch ein Projekt, um sich an die Materie heranzutasten.
Da es offenbar noch nix in Richtung Roomba zu geben scheint, habe ich damit mal angefangen.
Ich habe nur einen e5, mit Absicht, weil er meines Wissens keine Karten anlegt.
Der „spuckt“ aber sicher auch nicht soviele Infos aus, wie der ioBroker-Adapter erfassen könnte.
Da ginge noch viel mehr, die Frage ist nur, ist das auch sinnvoll.
Als Node Red Anfänger habe ich natürlich bei anderen Flows „geborgt“, also nicht meckern wenn euch Sachen bekannt vorkommen. Ob alles 100pro richtig ist, kann ich auch nicht garantieren.
Es ist eher ein Anfang, als völlig ausgereift.
Viel Spaß damit…
Der Schalter 1 startet die Reinigung (Ein), bzw. schickt den roomba zurück nach Hause (Aus).
Der Rest ich sicher selbsterklärend…
[
{
"id": "4ec44aab.defa54",
"type": "tab",
"label": "Saugroboter",
"disabled": false,
"info": ""
},
{
"id": "1821f3f2.19f014",
"type": "homeeDevice",
"z": "4ec44aab.defa54",
"virtual-homee": "",
"name": "Saugroboter",
"nodeId": "55",
"showNodeId": false,
"profile": "19",
"icon": "nodeicon_ventilationsystem",
"attributes": [
{
"instance": 0,
"minimum": 0,
"maximum": 1,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"unit": "Reinigung",
"step_value": 1,
"editable": 1,
"state": 1,
"last_changed": 12345555,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"data": "",
"id": 550,
"type": 1,
"node_id": 55
},
{
"instance": 2,
"minimum": 0,
"maximum": 1,
"current_value": 1,
"target_value": 1,
"last_value": 1,
"unit": "Ladevorgang",
"step_value": 1,
"editable": 1,
"state": 1,
"last_changed": 12345555,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"data": "",
"id": 551,
"type": 1,
"node_id": 55
},
{
"instance": 0,
"minimum": 0,
"maximum": 100,
"current_value": 100,
"target_value": 100,
"last_value": 100,
"unit": "%25",
"step_value": 1,
"editable": 0,
"state": 1,
"last_changed": 1573711842,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"data": "",
"id": 560,
"type": 8,
"node_id": 55
},
{
"instance": 0,
"minimum": 0,
"maximum": 4,
"current_value": 3,
"target_value": 3,
"last_value": 4,
"unit": "n%2Fa",
"step_value": 1,
"editable": 0,
"state": 1,
"last_changed": 1572634009,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 4,
"data": "",
"node": "[Circular ~.node]",
"id": 561,
"type": 33,
"node_id": 55
},
{
"state": 1,
"instance": 4,
"minimum": 0,
"maximum": 1,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"data": "",
"unit": "Fehler",
"step_value": 1,
"editable": 1,
"last_changed": 1602253984,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"options": [],
"id": 564,
"type": 1,
"node_id": 55
},
{
"state": 1,
"instance": 3,
"minimum": 0,
"maximum": 1,
"current_value": 0,
"target_value": 0,
"last_value": 0,
"data": "",
"unit": "Leeren",
"step_value": 1,
"editable": 1,
"last_changed": 1602253984,
"changed_by": 1,
"changed_by_id": 0,
"based_on": 1,
"options": [],
"id": 563,
"type": 1,
"node_id": 55
}
],
"statusTemplate": "",
"x": 660,
"y": 280,
"wires": [
[
"3f2c2e35.7cb6a2"
]
]
},
{
"id": "35b7c389.fc92dc",
"type": "ioBroker in",
"z": "4ec44aab.defa54",
"name": "Battery status",
"topic": "roomba.0.states.battery",
"payloadType": "value",
"onlyack": "",
"func": "rbe",
"gap": "",
"x": 190,
"y": 280,
"wires": [
[
"5eeea742.9d3f58"
]
]
},
{
"id": "4c47580.2012f28",
"type": "ioBroker in",
"z": "4ec44aab.defa54",
"name": "State whether bin status is full",
"topic": "roomba.0.states.binFull",
"payloadType": "value",
"onlyack": "",
"func": "rbe",
"gap": "",
"fireOnStart": "true",
"x": 140,
"y": 220,
"wires": [
[
"2d2d6e16.37a6d2"
]
]
},
{
"id": "41264f96.c6008",
"type": "ioBroker in",
"z": "4ec44aab.defa54",
"name": "Wifi RSSI",
"topic": "roomba.0.states.signal",
"payloadType": "value",
"onlyack": "",
"func": "rbe",
"gap": "",
"x": 200,
"y": 340,
"wires": [
[
"27355e41.15a7f2"
]
]
},
{
"id": "8d9bfd80.26bd3",
"type": "function",
"z": "4ec44aab.defa54",
"name": "Set Running",
"func": "var value = msg.payload;\nif (value === \"run\") {\n value = 1\n}\nelse if (value !== \"run\") {\n value = 0\n}\nmsg.payload = {\"attribute\":{ \"id\":550, \"value\": value}};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 370,
"y": 100,
"wires": [
[
"1821f3f2.19f014"
]
]
},
{
"id": "2d2d6e16.37a6d2",
"type": "function",
"z": "4ec44aab.defa54",
"name": "Set bin full",
"func": "var value = msg.payload;\nif (value === \"false\") {\n value = 0\n}\nelse if (value === \"true\") {\n value = 1\n}\nmsg.payload = {\"attribute\":{ \"id\":563, \"value\": value}};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 370,
"y": 220,
"wires": [
[
"1821f3f2.19f014"
]
]
},
{
"id": "5eeea742.9d3f58",
"type": "function",
"z": "4ec44aab.defa54",
"name": "Set Battery level",
"func": "var level = parseInt(msg.payload);\nmsg.payload = {\"attribute\":{ \"id\": 560, \"value\": level}};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"x": 380,
"y": 280,
"wires": [
[
"1821f3f2.19f014"
]
]
},
{
"id": "27355e41.15a7f2",
"type": "function",
"z": "4ec44aab.defa54",
"name": "Set Link Quality",
"func": "var level=parseInt(msg.payload);\n\n// Verbindungsqualität von dbm in 0-4 umrechnen\nif (level > 90) {\n level = 4\n}\nelse if (level > 60) {\n level = 3\n}\nelse if (level > 30) {\n level = 2\n}\nelse if (level > 10) {\n level = 1\n}\nelse {\n level = 0\n}\nmsg.payload = {\"attribute\":{ \"id\":561, \"value\": level}};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 380,
"y": 340,
"wires": [
[
"1821f3f2.19f014"
]
]
},
{
"id": "3f2c2e35.7cb6a2",
"type": "switch",
"z": "4ec44aab.defa54",
"name": "ID?",
"property": "payload.attributeId",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "550",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 650,
"y": 380,
"wires": [
[
"ae37db2b.02e458"
]
]
},
{
"id": "da6e5059.f8649",
"type": "ioBroker in",
"z": "4ec44aab.defa54",
"name": "Vacuum state",
"topic": "roomba.0.states.status",
"payloadType": "value",
"onlyack": "",
"func": "rbe",
"gap": "",
"fireOnStart": "true",
"x": 190,
"y": 100,
"wires": [
[
"8d9bfd80.26bd3",
"f945f73b.23b38",
"308e5d6a.d62a8a"
]
]
},
{
"id": "d6907b58.363928",
"type": "comment",
"z": "4ec44aab.defa54",
"name": "Node 55",
"info": "",
"x": 620,
"y": 240,
"wires": []
},
{
"id": "ae37db2b.02e458",
"type": "switch",
"z": "4ec44aab.defa54",
"name": "Control Cleaner",
"property": "payload.targetValue",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "0",
"vt": "num"
},
{
"t": "eq",
"v": "1",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 820,
"y": 360,
"wires": [
[
"5cc2edea.85f72c"
],
[
"ab80be48.f722"
]
]
},
{
"id": "ab80be48.f722",
"type": "ioBroker out",
"z": "4ec44aab.defa54",
"name": "Start a cleaning process",
"topic": "roomba.0.commands.start",
"ack": "false",
"autoCreate": "false",
"stateName": "",
"role": "",
"stateUnit": "",
"stateMin": "",
"stateMax": "",
"x": 1070,
"y": 360,
"wires": []
},
{
"id": "5cc2edea.85f72c",
"type": "ioBroker out",
"z": "4ec44aab.defa54",
"name": "Send the robot to the docking station",
"topic": "roomba.0.commands.dock",
"ack": "false",
"autoCreate": "false",
"stateName": "",
"role": "",
"stateUnit": "",
"stateMin": "",
"stateMax": "",
"x": 1110,
"y": 320,
"wires": []
},
{
"id": "f945f73b.23b38",
"type": "function",
"z": "4ec44aab.defa54",
"name": "Set Loading",
"func": "var value = msg.payload;\nif (value === \"charge\") {\n value = 1\n}\nelse if (value !== \"charge\") {\n value = 0\n}\nmsg.payload = {\"attribute\":{ \"id\":551, \"value\": value}};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 370,
"y": 40,
"wires": [
[
"1821f3f2.19f014"
]
]
},
{
"id": "308e5d6a.d62a8a",
"type": "function",
"z": "4ec44aab.defa54",
"name": "set Stuck",
"func": "var value = msg.payload;\nif (value === \"stuck\") {\n value = 1\n}\nelse if (value !== \"stuck\") {\n value = 0\n}\nmsg.payload = {\"attribute\":{ \"id\":564, \"value\": value}};\nreturn msg;",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"x": 360,
"y": 160,
"wires": [
[
"1821f3f2.19f014"
]
]
}
]
Grüße…