Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Node-RED
  4. Howto use myscontroller from node-red-contrib-mysensors?

Howto use myscontroller from node-red-contrib-mysensors?

Scheduled Pinned Locked Moved Node-RED
3 Posts 2 Posters 1.2k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    pansen
    wrote on last edited by
    #1

    Hi,

    @tbowmo maybe you can help with this:

    I would like to use the myscontroller node from node-red-contrib-mysensors to assign and track my node IDs, but I am struggling with the details.

    myscontroller seems to read the incoming msg, but when double clicking on it, id is "undefined".

    Here are the relevant nodes:

    [{"id":"8aa619bf.bcddb8","type":"myscontroller","z":"a8b8ec2f.f6e17","database":"839402cc.e6ba6","name":"node_controller","handleid":true,"timeresponse":true,"timezone":"UTC","measurementsystem":"M","mqttroot":"mysensors-in","x":740,"y":660,"wires":[["ca58e694.77646","da1a60bf.fddd1"]]},{"id":"d1caae4a.7e6d08","type":"mqtt in","z":"a8b8ec2f.f6e17","name":"","topic":"mysensors-out/#","qos":"2","broker":"708db7ae.68d95","x":300,"y":660,"wires":[["4abb49a2.3b382"]]},{"id":"4abb49a2.3b382","type":"mysdecode","z":"a8b8ec2f.f6e17","database":"","name":"","mqtt":true,"enrich":false,"x":530,"y":660,"wires":[["8aa619bf.bcddb8"]]},{"id":"da1a60bf.fddd1","type":"mqtt out","z":"a8b8ec2f.f6e17","name":"","topic":"","qos":"","retain":"","broker":"708db7ae.68d95","x":1020,"y":660,"wires":[]},{"id":"839402cc.e6ba6","type":"mysensorsdb","z":"","name":"test_db_1","file":"/home/blub/test_db_1.sqlite"},{"id":"708db7ae.68d95","type":"mqtt-broker","z":"","name":"mosquitto-betty","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
    

    And the relevant sketch code:

    #define MY_DEBUG
    #define MY_RADIO_NRF24
    #include <MySensors.h>
    #define CHILD_ID 1
    //#define MY_PARENT_NODE_ID 0
    //#define MY_PARENT_NODE_IS_STATIC
    #define SN "Worktable RGBW"
    #define SV "1.6"
    
    
    void presentation(){
    	sendSketchInfo(SN, SV);
    	present(CHILD_ID, S_RGBW_LIGHT );
    }
    
    

    When I restart the node, it actually gets node id 1, no matter what I do with myscontroller.

    My configure is:

    /configure --spi-spidev-device=/dev/spidev0.0 --my-transport=rf24 --my-rf24-ce-pin=2 --my-rf24-cs-pin=13 --my-rf24-irq-pin=21 --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mysensors --my-mqtt-password=blub --my-port=1883 --my-mqtt-user=mysensors
    

    I think I am just using the wrong topics, setting and combination of nodes.

    When I set the topic in myscontroller to the publish topic, the following message spams my broker:

    mysensors-out/1/255/3/0/6 : msg : Object
    object
    topic: "mysensors-out/1/255/3/0/6"
    payload: "M"
    qos: 0
    retain: false
    _topic: "mysensors-out/1/255/3/0/6"
    _msgid: "f5d62d35.d8df2"
    topicRoot: "mysensors-out"
    nodeId: 1
    childSensorId: 255
    messageType: 3
    ack: 0
    subType: 6
    origin: 2
    messageTypeStr: "C_INTERNAL"
    subTypeStr: "I_CONFIG"
    

    Orange Pi Plus 2e connected to nrf24 PA via SPI running git-development MySensors gateway, OpenHAB2, mosquitto and MySQL persistence.

    T 1 Reply Last reply
    0
    • P pansen

      Hi,

      @tbowmo maybe you can help with this:

      I would like to use the myscontroller node from node-red-contrib-mysensors to assign and track my node IDs, but I am struggling with the details.

      myscontroller seems to read the incoming msg, but when double clicking on it, id is "undefined".

      Here are the relevant nodes:

      [{"id":"8aa619bf.bcddb8","type":"myscontroller","z":"a8b8ec2f.f6e17","database":"839402cc.e6ba6","name":"node_controller","handleid":true,"timeresponse":true,"timezone":"UTC","measurementsystem":"M","mqttroot":"mysensors-in","x":740,"y":660,"wires":[["ca58e694.77646","da1a60bf.fddd1"]]},{"id":"d1caae4a.7e6d08","type":"mqtt in","z":"a8b8ec2f.f6e17","name":"","topic":"mysensors-out/#","qos":"2","broker":"708db7ae.68d95","x":300,"y":660,"wires":[["4abb49a2.3b382"]]},{"id":"4abb49a2.3b382","type":"mysdecode","z":"a8b8ec2f.f6e17","database":"","name":"","mqtt":true,"enrich":false,"x":530,"y":660,"wires":[["8aa619bf.bcddb8"]]},{"id":"da1a60bf.fddd1","type":"mqtt out","z":"a8b8ec2f.f6e17","name":"","topic":"","qos":"","retain":"","broker":"708db7ae.68d95","x":1020,"y":660,"wires":[]},{"id":"839402cc.e6ba6","type":"mysensorsdb","z":"","name":"test_db_1","file":"/home/blub/test_db_1.sqlite"},{"id":"708db7ae.68d95","type":"mqtt-broker","z":"","name":"mosquitto-betty","broker":"localhost","port":"1883","clientid":"","usetls":false,"compatmode":true,"keepalive":"60","cleansession":true,"birthTopic":"","birthQos":"0","birthPayload":"","closeTopic":"","closeQos":"0","closePayload":"","willTopic":"","willQos":"0","willPayload":""}]
      

      And the relevant sketch code:

      #define MY_DEBUG
      #define MY_RADIO_NRF24
      #include <MySensors.h>
      #define CHILD_ID 1
      //#define MY_PARENT_NODE_ID 0
      //#define MY_PARENT_NODE_IS_STATIC
      #define SN "Worktable RGBW"
      #define SV "1.6"
      
      
      void presentation(){
      	sendSketchInfo(SN, SV);
      	present(CHILD_ID, S_RGBW_LIGHT );
      }
      
      

      When I restart the node, it actually gets node id 1, no matter what I do with myscontroller.

      My configure is:

      /configure --spi-spidev-device=/dev/spidev0.0 --my-transport=rf24 --my-rf24-ce-pin=2 --my-rf24-cs-pin=13 --my-rf24-irq-pin=21 --my-gateway=mqtt --my-controller-ip-address=127.0.0.1 --my-mqtt-publish-topic-prefix=mysensors-out --my-mqtt-subscribe-topic-prefix=mysensors-in --my-mqtt-client-id=mysensors --my-mqtt-password=blub --my-port=1883 --my-mqtt-user=mysensors
      

      I think I am just using the wrong topics, setting and combination of nodes.

      When I set the topic in myscontroller to the publish topic, the following message spams my broker:

      mysensors-out/1/255/3/0/6 : msg : Object
      object
      topic: "mysensors-out/1/255/3/0/6"
      payload: "M"
      qos: 0
      retain: false
      _topic: "mysensors-out/1/255/3/0/6"
      _msgid: "f5d62d35.d8df2"
      topicRoot: "mysensors-out"
      nodeId: 1
      childSensorId: 255
      messageType: 3
      ack: 0
      subType: 6
      origin: 2
      messageTypeStr: "C_INTERNAL"
      subTypeStr: "I_CONFIG"
      
      T Offline
      T Offline
      tbowmo
      Admin
      wrote on last edited by
      #2

      @pansen said in Howto use myscontroller from node-red-contrib-mysensors?:

      Hi,

      @tbowmo maybe you can help with this:

      I would like to use the myscontroller node from node-red-contrib-mysensors to assign and track my node IDs, but I am struggling with the details.

      myscontroller seems to read the incoming msg, but when double clicking on it, id is "undefined".

      Just double checked my install.. And it too is showing nodes as undefined ID.. It seems that a bug appeared, and I have to dig into it..

      When I set the topic in myscontroller to the publish topic, the following message spams my broker:

      mysensors-out/1/255/3/0/6 : msg : Object
      object
      topic: "mysensors-out/1/255/3/0/6"
      payload: "M"
      qos: 0
      retain: false
      _topic: "mysensors-out/1/255/3/0/6"
      _msgid: "f5d62d35.d8df2"
      topicRoot: "mysensors-out"
      nodeId: 1
      childSensorId: 255
      messageType: 3
      ack: 0
      subType: 6
      origin: 2
      messageTypeStr: "C_INTERNAL"
      subTypeStr: "I_CONFIG"
      

      This is the controller nodered node responding to an I_CONFIG request from your mysensors node. It sends an "M" to the node (for "M"etric). Does the node receive the data?

      It should only send one for each request from your mysensor nodes..

      I haven't looked that much at my system the last 6 months or so, other than doing a restart now and then, because it drops either my ikea lamps, or my chromecast integration. Been to busy with the paid work thingy :)

      1 Reply Last reply
      1
      • T Offline
        T Offline
        tbowmo
        Admin
        wrote on last edited by
        #3

        @pansen

        FYI, I just released a small bug fix for the mysensors node-red module.. So now it should show the correct node ID's in the controller view.

        1 Reply Last reply
        0

        Hello! It looks like you're interested in this conversation, but you don't have an account yet.

        Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

        With your input, this post could be even better 💗

        Register Login
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        18

        Online

        12.0k

        Users

        11.2k

        Topics

        113.4k

        Posts


        Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • MySensors
        • OpenHardware.io
        • Categories
        • Recent
        • Tags
        • Popular