Navigation

    • Register
    • Login
    • OpenHardware.io
    • Categories
    • Recent
    • Tags
    • Popular
    1. Home
    2. Malte Deiseroth
    • Profile
    • Following
    • Followers
    • Topics
    • Posts
    • Best
    • Groups

    Malte Deiseroth

    @Malte Deiseroth

    0
    Reputation
    3
    Posts
    245
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    Malte Deiseroth Follow

    Best posts made by Malte Deiseroth

    This user hasn't posted anything yet.

    Latest posts made by Malte Deiseroth

    • RE: NodeManager Relay in Homeassistant

      @gohan hmmmm. Well problem with this is, that I will need to redo this everytime I purge the config of my MySensor network within homeassistant, and I know that will happen almost each time I add a Node, so on the long run this will be annoying.

      I found another suuuper hacky solution.

      Within the NodeManager.cpp I edited the onLoop function of the underlying SensorDigitalOutput. This is the method the SensorRelay inherits from.

      void SensorDigitalOutput::onLoop() {
        // set the value to -1 so to avoid reporting to the gateway during loop
        //_value_int = -1;
        //_last_value_int = -1;
        // if a safeguard is set, check if it is time for it
        if (_safeguard_timer->isRunning()) {
          // update the timer
          _safeguard_timer->update();
          // if the time is over, turn the output off
          if (_safeguard_timer->isOver()) setStatus(OFF);
        }
      }
      
      

      I commented out the _value_int = -1; and the _last_value_int = -1;. Now it reporst the reading once upon a node start. I guess setTrackLastValue is set to true somewhere.

      Maybe it possible to add another method to the SnesorDigitalOutput, that allows to toggle these -1 settings in the loop.

      posted in Home Assistant
      Malte Deiseroth
      Malte Deiseroth
    • NodeManager Relay in Homeassistant

      I'm trying to use NodeManager for a node that switches a realy. The problem is, that the HA MySensor component clashes with the way NodeManager handels actuators.

      NodeManager presents the relay to the GW, but never send any message with a value to the GW. However HA needs at least one initial value before the relay is recognized.
      Any idea how to deal with this? Either by forcing NodeManager to send an initial value, or by allowing HA to register the Node and its childs upon presentation and not on first value transmission?

      Here is some code of what I'm trying:

      // before
      void before() {
        // setup the serial port baud rate
        Serial.begin(MY_BAUD_RATE);  
        nodeManager.setReportIntervalSeconds(10);
      
        /*
         * Register below your sensors
        */
        id = nodeManager.registerSensor(SENSOR_RELAY, 3);
        SensorRelay* relay = (SensorRelay*)nodeManager.get(id);
        // A Method to send an intial value for the relay to the GW
       // realy->Send(false);
        /*
         * Register above your sensors
        */
        nodeManager.before();
      }
      

      Or maybe this must be done during the loop with:

      void loop() {
        // call NodeManager loop routine
        nodeManager.loop();
        SensorRelay* relay = (SensorRelay*)nodeManager.get(1);
        //relay->SendValueOnce(false);
      }
      
      posted in Home Assistant
      Malte Deiseroth
      Malte Deiseroth
    • Newline of debug output

      Hey when one tries to read the serial output of a gateway/node directly, it doesn't seem to send a correct newline char at the end of a line.

      I tried reading the output of a gateway /dev/ttyUSB0 with:

      picocom -b 115200 /dev/ttyUSB0
      

      But the output looks like:

      0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.1
                                                      0;255;3;0;9;TSM:INIT
                                                                          0;255;3;0;9;TSF:WUR:MS=0
                  0;255;3;0;9;TSM:INIT:TSP OK
                                             0;255;3;0;9;TSM:INIT:GW MODE
                                                                         0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
                               0;255;3;0;9;MCO:REG:NOT NEEDED
                                                             0;255;3;0;14;Gateway startup complete.
                   0;255;0;0;18;2.1.1
                                     0;255;3;0;9;MCO:BGN:STP
                                                            0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
      
      

      I have also tried Using minicom and screen. All show the same

      EDIT:
      I found out, that I can use cat if I first set the baudrate correctly:

      stty -F /dev/ttyUSB0 115200
      cat /dev/ttyUSB0
      

      This works, but I wonder what is going on in the case if picocom

      EDIT:
      Okay, I found the solution. I guess its the same for minicom as well.

      picocom -b 115200 /dev/ttyUSB1 --imap lfcrlf
      

      the --imap lfcrlf maps line feed to line feed and carriage return. This then gives the desired formatting.

      posted in Troubleshooting
      Malte Deiseroth
      Malte Deiseroth