OpenHAB binding is crashing



  • So after switching from Home Assistant to MyController to OpenHAB it seems that OpenHAB doesn't like the way my sensors are reporting their values. I'm seeing this stacktrace in the log all the time (something is wrong with it's output, Konsole isn't letting me copy it properly, image of it: image of stacktrace) :

    01:47:24.343 [DEBUG] [ors.internal.gateway.MySensorsGateway] - Node 3 found in gateway
    01:47:24.350 [DEBUG] [ors.internal.gateway.MySensorsGateway] - Child 4 found in node 3
    01:47:24.357 [ERROR] [internal.event.MySensorsEventRegister] - Event broadcasting throw an exception
    java.lang.NumberFormatException: null                                                                                          
    
    
    
    
    24) ~[?:?]                                                                                                                     
    ?]                                                                                                                             
    [?:?]                                                                                                                          
    
    
    
    a:122) ~[?:?]                                                                                                                  
    ]                                                                                                                              
    :?]                                                                                                                            
    
    
    
    a:79) [211:org.openhab.binding.mysensors:2.3.0.201803141156]                                                                   
    nection.java:358) [211:org.openhab.binding.mysensors:2.3.0.201803141156]                                                       
    
    
    
    
    
    01:47:24.462 [DEBUG] [orsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;2225831 TSF:MSG:READ,3-3-0,s=4,c=1,t=37,pt=3,l=2,sg=0:0
    01:47:24.469 [DEBUG] [orsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;2225838 TSF:MSG:ACK REQ
    01:47:24.475 [DEBUG] [orsAbstractConnection$MySensorsReader] - Message from gateway received: 0;255;3;0;9;2225842 TSF:MSG:SEND,0-0-3-3,s=4,c=1,t=37,pt=3,l=2,sg=0,ft=0,st=OK:0
    01:47:24.483 [DEBUG] [orsAbstractConnection$MySensorsReader] - Message from gateway received: 3;4;1;0;37;0                                                   
    

    Sensor 3 sending code:

    void presentation() {
      // Send the sketch version information to the gateway and Controller
      sendSketchInfo("Gassensor", "0.0");
      Serial.begin(115200);
    
      // Register all sensors to gateway (they will be created as child devices)
      for (uint8_t sensor_id = 0; sensor_id < 11; sensor_id++) {
        pinMode(sensor_pins[sensor_id], INPUT);
        present(sensor_id, V_UNIT_PREFIX);  // Custom unit message.
      }
    }
    
    
    void loop() {
      for (uint8_t sensor_id = 0; sensor_id < 10; sensor_id++) {
        uint16_t reading = analogRead(sensor_pins[sensor_id]);
        Serial.print(F("Sensor: "));
        Serial.print(sensor_id);
        Serial.print(F(", reading: "));
        Serial.println(reading);
        send(msgPrefix.setSensor(sensor_id).set("ppm"), true);
        send(msg.setSensor(sensor_id).set(reading), true);
        sleep(100);
      }
    
      send(msgPrefix.setSensor(10).set("ppm"), true);
      send(msg.setSensor(10).set(analogRead(DUST)), true);
      sleep(SLEEP_TIME);
    }
    


  • Not sure if this has anything to do with it, but you should not use V_UNIT_PREFIX as a parameter in the present function call. The function expects a sensor-type and not a value-type. I suppose you could use S_CUSTOM instead.



  • @freynder I'll comment that out, it was only needed for Home Assistant, I added it to get the right type of chart. But still, the crash itself happens after presentation?



  • It turns out that V_UNIT_PREFIX is not supported by OpenHAB's MySensors binding.


Log in to reply
 

Suggested Topics

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts