Community

Node Red - Hilfe-/Frage-/Ideen-/Austausch - Thread


#262

So, fertig. Alle vier Speaker sind eingebunden:

image

:slight_smile:


#263

Hab noch ne kleine Verbesserung eingebaut:

var nodeid = 56;  // node ID in homee vom Wemo
var attributid = 330; // attribut ID in homee vom Wemo
const attributes = global.get('homee.attributes');
var status = attributes.filter(attribute => attribute.id === attributid).map(a => a.current_value).reduce((a,c) => a+c);

if ((msg.state === "stopped" && status === 1) || (msg.state === "paused" && status === 1))
{return {payload: "PUT:/nodes/"+nodeid+"/attributes/"+attributid+"?target_value=0"}}
if (msg.state === "playing" && status === 0)
{return {payload: "PUT:/nodes/"+nodeid+"/attributes/"+attributid+"?target_value=1"}}

Also Zeile:

if (msg.state === "stopped" && status === 1)

wurde durch

if ((msg.state === "stopped" && status === 1) || (msg.state === "paused" && status === 1))

ersetzt.

Ohne die Anpassung wird bei pausierten Spotify-Songs (STOP nicht möglich in der SONOS-App) der Status in homee falsch angegegeben. In homee steht der Status der Box sonst immer noch auf “Ein”.


#264

Na das ist doch super, dieses State wurde bei mir garnicht ausgegeben.
:thinking::grinning:

VG Micha


#265

Inzwischen bekomm ich diese Meldung:

image

image

image

Fritzbox 7590, FRITZ!OS: 7.01

Bekomm den Gastzugang einfach nicht hin. Vielleicht hat dazu ja jmd. nen Lösungsansatz.


#266

Hat bei mir auch nie geklappt. Liegt vermutlich an der Fritz!OS7. Hab da glaub mal was in nem anderen Forum gelesen, da sind vor uns schon andere verzweifelt…


#267

Ich hab auch schon von dem Problem gelesen.

@Sofasportler hat es aber scheinbar auch mit ner 7590 und 7.01 hinbekommen:

Das hat mich motiviert es noch mal zu versuchen, aber es klappt nicht.


#268

JA, hat er :wink: … und läuft problemlos.

Ihr habt nicht zufällig unter “Sicherheit” in der FritzBox “keine neuen Geräte zulassen” aktiviert?
Ansonsten habe ich alles so gemacht wie beschrieben und es läuft.

Achja, ich habe festgestellt, daß die Fritz Oberfläche nicht geöffnet sein darf, damit es funktioniert.

Hier ist noch mal mein aktueller Flow:

[
{
“id”: “60538452.27d854”,
“type”: “wemo-emulator”,
“z”: “d447cfd2.53329”,
“name”: “Guest Wifi”,
“friendlyName”: “Gäste WLAN”,
“serial”: “2938562”,
“port”: “41257”,
“onTopic”: “guest/wifi”,
“onPayload”: “on”,
“offTopic”: “guest/wifi”,
“offPayload”: “off”,
“x”: 207,
“y”: 1452.3333740234375,
“wires”: [
[
“51268029.83b2”,
“a2f5edc7.12217”
]
]
},
{
“id”: “36c5a4fb.2f5114”,
“type”: “debug”,
“z”: “d447cfd2.53329”,
“name”: “”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “payload”,
“x”: 957.0000534057617,
“y”: 1452.3333740234375,
“wires”: []
},
{
“id”: “226f8806.d3935”,
“type”: “comment”,
“z”: “d447cfd2.53329”,
“name”: “Zugang”,
“info”: “NAME\nPASSWORT”,
“x”: 629.1666564941406,
“y”: 1411.6667556762695,
“wires”: []
},
{
“id”: “b4762ae5.9e8b18”,
“type”: “fritzbox-callmonitor”,
“z”: “d447cfd2.53329”,
“device”: “e31bb4cd.15d4c8”,
“name”: “”,
“topic”: “”,
“x”: 246.5000228881836,
“y”: 1352.000039100647,
“wires”: [
[]
]
},
{
“id”: “ae31b039.668c98”,
“type”: “pushbullet”,
“z”: “d447cfd2.53329”,
“config”: “84810521.d941f”,
“pushtype”: “note”,
“title”: “Gäste Wlan”,
“chan”: “”,
“name”: “”,
“x”: 955.3333435058594,
“y”: 1594.666748046875,
“wires”: []
},
{
“id”: “2bd62491.5531dc”,
“type”: “debug”,
“z”: “d447cfd2.53329”,
“name”: “Gäste Wlan”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “payload”,
“x”: 955.3333435058594,
“y”: 1554.666748046875,
“wires”: []
},
{
“id”: “a2f5edc7.12217”,
“type”: “switch”,
“z”: “d447cfd2.53329”,
“name”: “”,
“property”: “payload”,
“propertyType”: “msg”,
“rules”: [
{
“t”: “eq”,
“v”: “on”,
“vt”: “str”
},
{
“t”: “eq”,
“v”: “off”,
“vt”: “str”
}
],
“checkall”: “true”,
“repair”: false,
“outputs”: 2,
“x”: 451.3333435058594,
“y”: 1572.666748046875,
“wires”: [
[
“7f3c8c04.ccd31c”
],
[
“2fa184a2.2ea6ec”,
“6ffc93e1.b568a4”
]
]
},
{
“id”: “3f4d1e35.5b83d2”,
“type”: “debug”,
“z”: “d447cfd2.53329”,
“name”: “uptime Gäste Wlan”,
“active”: true,
“tosidebar”: true,
“console”: false,
“tostatus”: false,
“complete”: “payload”,
“x”: 985.3333435058594,
“y”: 1634.666748046875,
“wires”: []
},
{
“id”: “7f3c8c04.ccd31c”,
“type”: “function”,
“z”: “d447cfd2.53329”,
“name”: “Zeitpunkt aktiv”,
“func”: "var event = new Date();\nglobal.set(‘start_gw’, new Date());\nvar hour = event.getHours();\nvar minute = event.getMinutes();\nmsg.payload = "Gäste Wlan eingeschaltet um “+ hour+’:’+minute+’ Uhr. ';\nreturn msg;\n\n”,
“outputs”: 1,
“noerr”: 0,
“x”: 725.3333435058594,
“y”: 1554.666748046875,
“wires”: [
[
“2bd62491.5531dc”,
“ae31b039.668c98”
]
]
},
{
“id”: “2fa184a2.2ea6ec”,
“type”: “function”,
“z”: “d447cfd2.53329”,
“name”: “Zeitpunkt inaktiv”,
“func”: "var event = new Date();\nglobal.set(‘stop_gw’, new Date());\nvar hour = event.getHours();\nvar minute = event.getMinutes();\nmsg.payload = "Gäste Wlan ausgeschaltet um “+ hour+’:’+minute+’ Uhr. ';\nreturn msg;\n\n”,
“outputs”: 1,
“noerr”: 0,
“x”: 735.3333435058594,
“y”: 1594.666748046875,
“wires”: [
[
“2bd62491.5531dc”,
“ae31b039.668c98”
]
]
},
{
“id”: “2814b8fe.905e28”,
“type”: “function”,
“z”: “d447cfd2.53329”,
“name”: “Uptime”,
“func”: "var start = global.get(“start_gw”);\nvar stop = global.get(“stop_gw”);\n\nsekunden = (global.get(“stop_pc”) - global.get(“start_pc”))/1000;\nminuten = Math.trunc(sekunden/60);\nsekunden2= Math.trunc(((sekunden/60)-minuten)*60);\nstunden = Math.trunc(minuten/60);\nminuten2= Math.trunc(((minuten/60)-stunden)*60);\n\nif(stunden <1)\n {stunden1 = " "}\n else\n stunden1=stunden + " Stunden, “;\n\nreturn {payload: “Gäste Wlan aktiv für “+stunden1 +minuten2 +” Minuten.”};\n \n”,
“outputs”: 1,
“noerr”: 0,
“x”: 765.3333435058594,
“y”: 1634.666748046875,
“wires”: [
[
“3f4d1e35.5b83d2”,
“ae31b039.668c98”
]
]
},
{
“id”: “6ffc93e1.b568a4”,
“type”: “delay”,
“z”: “d447cfd2.53329”,
“name”: “”,
“pauseType”: “delay”,
“timeout”: “1”,
“timeoutUnits”: “seconds”,
“rate”: “1”,
“nbRateUnits”: “1”,
“rateUnits”: “second”,
“randomFirst”: “1”,
“randomLast”: “5”,
“randomUnits”: “seconds”,
“drop”: false,
“x”: 625.3333435058594,
“y”: 1634.666748046875,
“wires”: [
[
“2814b8fe.905e28”
]
]
},
{
“id”: “9eccb213.4253f8”,
“type”: “inject”,
“z”: “d447cfd2.53329”,
“name”: “Stop”,
“topic”: “”,
“payload”: “”,
“payloadType”: “date”,
“repeat”: “”,
“crontab”: “”,
“once”: false,
“onceDelay”: 0.1,
“x”: 435.3333435058594,
“y”: 1634.666748046875,
“wires”: [
[
“2fa184a2.2ea6ec”,
“6ffc93e1.b568a4”
]
]
},
{
“id”: “5f9ef0b3.ac51f8”,
“type”: “inject”,
“z”: “d447cfd2.53329”,
“name”: “Start”,
“topic”: “”,
“payload”: “”,
“payloadType”: “date”,
“repeat”: “”,
“crontab”: “”,
“once”: false,
“onceDelay”: 0.1,
“x”: 435.3333435058594,
“y”: 1514.666748046875,
“wires”: [
[
“7f3c8c04.ccd31c”
]
]
},
{
“id”: “c88493f2.a4cc3”,
“type”: “fritzbox-in”,
“z”: “d447cfd2.53329”,
“device”: “e31bb4cd.15d4c8”,
“name”: “”,
“service”: “urn:dslforum-org:service:WLANConfiguration:3”,
“action”: “SetEnable”,
“arguments”: “{“NewEnable”:“value”}”,
“x”: 632.1666870117188,
“y”: 1452.3334045410156,
“wires”: [
[
“36c5a4fb.2f5114”
]
]
},
{
“id”: “51268029.83b2”,
“type”: “function”,
“z”: “d447cfd2.53329”,
“name”: “an_aus”,
“func”: “return {\n payload: {\n NewEnable: msg.payload === ‘on’ ? 1 : 0\n }\n};”,
“outputs”: 1,
“noerr”: 0,
“x”: 464,
“y”: 1452.3334350585938,
“wires”: [
[
“c88493f2.a4cc3”
]
]
},
{
“id”: “77bf388f.3862f”,
“type”: “inject”,
“z”: “d447cfd2.53329”,
“name”: “”,
“topic”: “”,
“payload”: “off”,
“payloadType”: “str”,
“repeat”: “”,
“crontab”: “”,
“once”: false,
“onceDelay”: 0.1,
“x”: 266.5000228881836,
“y”: 1406.333420753479,
“wires”: [
[
“51268029.83b2”
]
]
},
{
“id”: “e31bb4cd.15d4c8”,
“type”: “fritzbox-config”,
“z”: “”,
“name”: “”,
“host”: “hier IP FRITZBOX eintragen”,
“port”: “49000”,
“ssl”: false
},
{
“id”: “84810521.d941f”,
“type”: “pushbullet-config”,
“z”: “”,
“name”: “Handy”
}
]


#269

Danke fürs teilen. Ich hab das inzwischen mit dem iobroker gelöst und direkt mit Apfel home verknüpft. Funktioniert auch einwandfrei.