Hey guys
I currently have domoticz and all devices are espeasy
I am running the standard integration of switches where it issues commands via the button within the interface like http://192.168.x.x/gpio?cmd,12,1
I would like to transfer it all over to nodejs and mqtt. I have mosquitto running and working. domoticz has a mqtt gateway, node red is installed, all my esp easy firmware can support the mqtt. I have everything ready to go. My trouble is I cannot find many examples of flows for node red. Does anybody have any that they would be willing to share?
I found this website but no examples of domoticz https://flows.nodered.org/ and not many for swiches
I want to move over from it because I am experincing lag as I have rules in place via blocky which is nice but slow even on my rpi 3. This rpi is running on an external hdd so its not a limit of an SD card. It can take from the press of a button 1-2 seconds to turn on the light which it never used to do that ( I have a ton of devices on it)
another reason I want 1 switch to go from 1 to many not 1 to 1. I can again set that up in blocky rules but its limited and slow. I have my room lights that take about 15 seconds to turn on via blocky as its lit my led strips each on a defferent H801 around my room
any flows /examples of switches would be great
anybody have node js flows
Moderators: grovkillen, Stuntteam, TD-er
-
- Normal user
- Posts: 119
- Joined: 26 Feb 2017, 17:30
Re: anybody have node js flows
anybody? sorry just following up on this now as i have been so busy for the past 2 months. more like running around like a chicken with no head
Re: anybody have node js flows
Just an example:
Via MQTT a message with two different values is sent in the payload. The flow splits it in two in order to process it correctly in Domoticz.
Via MQTT a message with two different values is sent in the payload. The flow splits it in two in order to process it correctly in Domoticz.
Code: Select all
[
{
"id": "ff0dd54d.e3d958",
"type": "mqtt in",
"z": "11648062.13843",
"name": "",
"topic": "domoticz/in",
"qos": "2",
"broker": "8ffa53d7.2be8e",
"x": 111.5,
"y": 227,
"wires": [
[
"51f7844.b1c9d7c",
"3132e5d7.a3d19a"
]
]
},
{
"id": "51f7844.b1c9d7c",
"type": "json",
"z": "11648062.13843",
"name": "",
"x": 259.5,
"y": 227,
"wires": [
[
"ed8d4908.eadd58"
]
]
},
{
"id": "ed8d4908.eadd58",
"type": "function",
"z": "11648062.13843",
"name": "",
"func": "var newmsg = [];\n\nif (msg.payload.idx == 1390) {\n var split = msg.payload.svalue.split(\";\")\n newmsg.push({\n svalue:split[1]\n });\n\n return newmsg;\n}\n",
"outputs": "1",
"noerr": 0,
"x": 386,
"y": 227,
"wires": [
[
"12c5784b.ac0608"
]
]
},
{
"id": "8881c7d7.3a54f8",
"type": "mqtt out",
"z": "11648062.13843",
"name": "",
"topic": "domoticz/in",
"qos": "",
"retain": "",
"broker": "8ffa53d7.2be8e",
"x": 746.5,
"y": 208,
"wires": []
},
{
"id": "12c5784b.ac0608",
"type": "change",
"z": "11648062.13843",
"name": "",
"rules": [
{
"t": "set",
"p": "payload.idx",
"pt": "msg",
"to": "1389",
"tot": "num"
},
{
"t": "set",
"p": "payload.nvalue",
"pt": "msg",
"to": "0",
"tot": "num"
},
{
"t": "move",
"p": "svalue",
"pt": "msg",
"to": "payload.svalue",
"tot": "msg"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 537.5,
"y": 227,
"wires": [
[
"658808f4.2b4dc8",
"8881c7d7.3a54f8"
]
]
},
{
"id": "8ffa53d7.2be8e",
"type": "mqtt-broker",
"z": "",
"broker": "localhost",
"port": "1883",
"clientid": "",
"usetls": false,
"compatmode": true,
"keepalive": "60",
"cleansession": true,
"willTopic": "",
"willQos": "0",
"willPayload": "",
"birthTopic": "",
"birthQos": "0",
"birthPayload": ""
}
]
-
- Normal user
- Posts: 119
- Joined: 26 Feb 2017, 17:30
Re: anybody have node js flows
thank you very much I shall give that a try
Who is online
Users browsing this forum: Ahrefs [Bot] and 36 guests