"Sketch Config" (I_CONFIG) Handler
-
This flow takes care of the challenge/response for when a sensor asks what config to use (Metric or imperial).
By default, the code returns M for metric. I don't believe Imperial is used anywhere, but it can be changed to I... if you support it in your code. (Honestly, no clue, but some sketches do make use of the call getConfig() .)
[{"id":"8e3e8f02.7fd0c","type":"mqtt-broker","z":"63842e72.893f78","broker":"localhost","port":"8883","clientid":"","usetls":false,"verifyservercert":true,"compatmode":true,"keepalive":"15","cleansession":true,"willTopic":"","willQos":"0","willRetain":null,"willPayload":"","birthTopic":"","birthQos":"0","birthRetain":null,"birthPayload":""},{"id":"57ad0c01.895c9c","type":"mqtt in","z":"63842e72.893f78","name":"Sensor Requests Config","topic":"MySensors/+/255/3/0/6","broker":"8e3e8f02.7fd0c","x":105,"y":993,"wires":[["cd60b38.ef7405"]]},{"id":"86a8016b.bd47a","type":"mqtt out","z":"63842e72.893f78","name":"","topic":"","qos":"","retain":"","broker":"8e3e8f02.7fd0c","x":672,"y":993,"wires":[]},{"id":"65a6cc53.392ccc","type":"function","z":"63842e72.893f78","name":"Metric/Imperial definition","func":"var config = \"M\" ; //M for metric, and I for imperial\n\nmsg.payload = config + \"\\n\";\nreturn msg;","outputs":1,"noerr":0,"x":488,"y":993,"wires":[["86a8016b.bd47a","165c11cd.40adbe"]]},{"id":"165c11cd.40adbe","type":"debug","z":"63842e72.893f78","name":"","active":true,"console":"false","complete":"false","x":692,"y":952,"wires":[]},{"id":"cd60b38.ef7405","type":"delay","z":"63842e72.893f78","name":"","pauseType":"rate","timeout":"5","timeoutUnits":"seconds","rate":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":true,"x":295,"y":993,"wires":[["65a6cc53.392ccc"]]},{"id":"9687065f.28c08","type":"comment","z":"63842e72.893f78","name":"I_CONFIG handler ([0-255];255;3;0;6;[M or I])","info":"Whenever a sensor announces itself to the network as [any];255;3;0;6;(null),\n\nThe cntroller returns a M for metric or I for imperial. \nTo my understanding, imperial measurement reportings aren't used.\n\n\nA rate limiter was required as to keep NR and the sensor from a spam-loop","x":298,"y":1030,"wires":[]}]```
-
@cranky ,
do you have a git repository where we can download all the stuff?
-
Not yet, but that was my goal tomorrow.
My GH account is https://github.com/jwcrawley
It'll be obvious when I add in the repo
I'll also mention it here.
Sincerely,
Cranky
3 out of 3
Suggested Topics
-
Join the Project Contest 2014 - ENDED
Announcements • 8 Apr 2014, 08:03 • hek 13 May 2014, 21:48 -
Howto use myscontroller from node-red-contrib-mysensors?
Node-RED • 9 Mar 2019, 21:26 • pansen 17 Mar 2019, 22:37 -
Dollhouse project : need Node-Red Controller flow
Node-RED • 20 Oct 2020, 07:35 • SuperNinja 20 Oct 2020, 10:33 -
[Solved] Beginner receive() question
Node-RED • 14 Mar 2021, 15:10 • Alberto77 14 Mar 2021, 20:48 -
multiple gateways on lan
Node-RED • 8 Jun 2019, 07:57 • sotiriszegiannis 10 Jun 2019, 20:20 -
Thanks for node-red-contrib-mysensors and a question regarding collections or arrays
Node-RED • 25 Oct 2020, 07:44 • Joost 25 Oct 2020, 08:36