node-red-contrib-mysensors release thread


  • Admin

    An almost complete rewrite of the node-red-contrib-mysensors has been released.

    What have been done this time is:

    • Rewritten in typescript
    • a controller node is added, allowing node-red to hand out node id's to a mysensors network.

    The move to typescript should enable more test of the software, as I now have a compile time check, and also implemented the first unit tests of the code.

    Please note that the mysencdec node has now been removed.. If you still use it, then you should remove it before upgrading the package, or node-red might stop the flows, as it is missing nodes.

    Please use the issue tracker on github, if you find some undocumented "features" 🙂


  • Admin

    Btw. the only really breaking change from the 1.x series from a user perspective, is that the mysdecenc is gone.

    All other nodes should perform as the old version.


  • Admin

    Bugger.. I found an issue myself that sneaked past my typescript compile checks..

    So expect an update later today..


  • Admin

    Release 2.0.1 is out, fixing the bugs that I discovered earlier.. Thought that I had everything covered, and even did some regression testing in a dummy node-red install.. But missed some important details, that unfortunately can't be covered by the testframework at the moment (perhaps because my lack of understanding of mocha / chai)


  • Admin

    Released 2.1.0 today,

    Improved debug node, where I ported the parser from https://mysensors.org/build/parser.

    The controller node now also logs the last repeater a given node has used, to reach the gateway.

    Some minor details here and ther in the ui have been updated as well.

    Linting of the typescript files have been added using tslint.


  • Admin

    Released 2.2.0 today

    the mysdecode node now also decodes messageType and sensorType to string values, in the node message it emits.

    The emitted message now contains the following propperties:

    topicRoot: string; // Only used if it is decoding from a mqtt topic
    nodeId: number;
    childSensorId: number;
    messageType: mysensor_command;
    messageTypeStr: string;
    ack: 0|1;
    subType: mysensor_data| mysensor_internal| mysensor_sensor| mysensor_stream;
    subTypeStr: string;
    origin: MsgOrigin; // This is an indicator for where the message was received from (mqtt, serial or "undefined")
    

    Also did a lot of cleanup, set stricter rules in the typescript compiler etc. to avoid common mistakes.


  • Admin

    Released 3.0.0

    Breaking change is in the controller node, which now use a migration feature in the sqlite lilbrary that I use. It makes it easier to update database schema later on, as I can now create "patches" for the schema, that is included in the library. The database needs to be re-created from scratch, as the migration part has some extra tables to keep track of the schema version.

    Also documentation has been received an overhaul, correcting a few spelling errors, and a lot of formatting.



  • Awesome work! I was trying to create a bridge between a MQTT gateway and a Serial gateway (over TCP) so I could use firmware upload function of the MySController. However for some reason it seems to only work one way. I can send commands from the MySController to MQTTGateway but nothing is being received on the MySController side when data is sent from MQTT

    This is my flow, would be awesome if someone would spot the issue...

    [{"id":"e6a66581.c16ec8","type":"mysdecode","z":"229ed636.c3ff2a","name":"","mqtt":false,"x":450,"y":460,"wires":[["58ac0291.04974c","a3ba801.a63be8"]]},{"id":"eb5b52a1.29566","type":"tcp in","z":"229ed636.c3ff2a","name":"","server":"server","host":"","port":"5003","datamode":"stream","datatype":"utf8","newline":"\\n","topic":"","base64":false,"x":270,"y":460,"wires":[["e6a66581.c16ec8","ab0f8982.8a9588","78954899.688c28"]]},{"id":"58ac0291.04974c","type":"debug","z":"229ed636.c3ff2a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":510,"y":560,"wires":[]},{"id":"a3ba801.a63be8","type":"mysencode","z":"229ed636.c3ff2a","name":"","mqtt":true,"mqtttopic":"myGreenhouse-in","x":1040,"y":200,"wires":[["8d64662e.fbada8","595543a3.f537cc"]]},{"id":"ab0f8982.8a9588","type":"globalGetSet","z":"229ed636.c3ff2a","name":"Save Session","topic":"","context":"msg","variable":"_session","outContext":"global","outVar":"_session","x":440,"y":420,"wires":[[]]},{"id":"78954899.688c28","type":"debug","z":"229ed636.c3ff2a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":500,"y":720,"wires":[]},{"id":"cdf94190.9fb8e","type":"myscontroler","z":"229ed636.c3ff2a","database":"5fdbb924.88fb48","name":"","handleid":true,"x":770,"y":200,"wires":[["a3ba801.a63be8"]]},{"id":"8d64662e.fbada8","type":"mqtt out","z":"229ed636.c3ff2a","name":"","topic":"","qos":"","retain":"","broker":"1920bc44.5c3304","x":1270,"y":200,"wires":[]},{"id":"595543a3.f537cc","type":"debug","z":"229ed636.c3ff2a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1270,"y":260,"wires":[]},{"id":"c800320f.2a2b","type":"mysdecode","z":"229ed636.c3ff2a","name":"","mqtt":true,"x":560,"y":200,"wires":[["cdf94190.9fb8e","aa22f275.cc8ec"]]},{"id":"2222f84e.56c4e8","type":"mqtt in","z":"229ed636.c3ff2a","name":"","topic":"myGreenhouse-out/#","qos":"2","broker":"1920bc44.5c3304","x":320,"y":200,"wires":[["41588b7e.b61114","c800320f.2a2b"]]},{"id":"aa22f275.cc8ec","type":"switch","z":"229ed636.c3ff2a","name":"","property":"nodeId","propertyType":"msg","rules":[{"t":"eq","v":"203","vt":"num"},{"t":"else"}],"checkall":"true","repair":false,"outputs":2,"x":570,"y":360,"wires":[[],["ea8a0d53.8140b"]]},{"id":"41588b7e.b61114","type":"debug","z":"229ed636.c3ff2a","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":530,"y":260,"wires":[]},{"id":"ea8a0d53.8140b","type":"mysencode","z":"229ed636.c3ff2a","name":"","mqtt":false,"mqtttopic":"","x":870,"y":420,"wires":[["2036eda1.dd8bf2","ad5ca8e4.1c4f68"]]},{"id":"2036eda1.dd8bf2","type":"debug","z":"229ed636.c3ff2a","name":"","active":false,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1030,"y":460,"wires":[]},{"id":"ad5ca8e4.1c4f68","type":"globalGetSet","z":"229ed636.c3ff2a","name":"Load Session","topic":"","context":"global","variable":"_session","outContext":"msg","outVar":"_session","x":1060,"y":420,"wires":[["cb6d084b.432238","f99fd97d.5f73c8"]]},{"id":"cb6d084b.432238","type":"tcp out","z":"229ed636.c3ff2a","host":"localhost","port":"5003","beserver":"reply","base64":true,"end":false,"name":"","x":1250,"y":420,"wires":[]},{"id":"f99fd97d.5f73c8","type":"debug","z":"229ed636.c3ff2a","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"true","x":1240,"y":480,"wires":[]},{"id":"5fdbb924.88fb48","type":"mysensorsdb","z":"","name":"Device DB","file":"sqlite"},{"id":"1920bc44.5c3304","type":"mqtt-broker","z":"","name":"LocalNew","broker":"localhost","port":"8883","tls":"","clientid":"Node-RedHome","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"willTopic":"","willQos":"0","willRetain":"false","willPayload":"","birthTopic":"","birthQos":"0","birthRetain":"false","birthPayload":""}]```

  • Admin

    @Thucar

    The MysController node doesn't pass any messages through it, it only emits messages if it receives a node ID request.

    Also, (depending on your version) then it is not needed to pass messages through mysdecode / mysencode before / after the myscontroller node. It understands mqtt / serial protocol directly. (this has been a feature since 2.2.0)

    / Thomas


  • Admin

    New release : 3.1.0

    Added features:

    Controller now supports the following messages:

    • I_TIME is replied with a unix timestamp corrected with local timezone offset
    • I_CONFIG, responds with Metric / Imperial setting

    Minor documentation updates to other nodes as well.


 

Suggested Topics

302
Online

7.4k
Users

8.3k
Topics

89.6k
Posts