Title - Manage your DLNA Speakers
Summary - node-red-contrib-dlna , This node allows you to send the sound level and a url to play on your DLNA speakers among other abilities like pause, stop, and get volume. I use it to send a notifications when the front or yard door is left open, for notifying when that alarm is set and a few other announcements. Below is an example setup to get you started. By the way this works great with the Hubitat file manage if you are storing mp3 on it.
To locate your device you will need an app like UPnP Browser if you are on Android or UPnP Mate on IOS.
{
"id": "1d3e7a3e7ef62ecc",
"type": "dlna-action",
"z": "3e92963d10841075",
"name": "DLNA Speaker",
"device": "http://192.168.109.239:49152/description.xml",
"x": 1520,
"y": 580,
"wires": [
[]
]
},
{
"id": "1967dbe9a5d672b4",
"type": "inject",
"z": "3e92963d10841075",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "disarmed",
"payloadType": "str",
"x": 1140,
"y": 540,
"wires": [
[
"e76870e61e027627"
]
]
},
{
"id": "e76870e61e027627",
"type": "function",
"z": "3e92963d10841075",
"name": "DLNA",
"func": "\nif (msg.payload === \"disarmed\") {\nvar msg1 = {payload: {\"action\": \"setvolume\", \"volume\": \"25\"}}\nvar msg2 = {payload: {\"action\": \"load\", \"url\": \"http://192.168.109.178/local/La_alarma_ha_sido_desactivada.mp3\"}}\nnode.status({fill:\"red\",shape:\"dot\",text:\"desarmado\"})\nnode.send(msg1); node.send(msg2);\n}\n\n\nif (msg.payload === \"armed\") {\nvar msg3 = {payload: {\"action\": \"setvolume\", \"volume\": \"50\"}}\nvar msg4 = {payload: {\"action\": \"load\", \"url\": \"http://192.168.109.178/local/Alarma_de_modo_casa.mp3\"}}\nnode.status({fill:\"red\",shape:\"dot\",text:\"modo casa\"})\nnode.send(msg3); node.send(msg4);\n \n}\n",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 1310,
"y": 580,
"wires": [
[
"1d3e7a3e7ef62ecc"
]
]
},
{
"id": "2951e644a88c1429",
"type": "inject",
"z": "3e92963d10841075",
"name": "",
"props": [
{
"p": "payload"
},
{
"p": "topic",
"vt": "str"
}
],
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"topic": "",
"payload": "armed",
"payloadType": "str",
"x": 1150,
"y": 580,
"wires": [
[
"e76870e61e027627"
]
]
}
]