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:
) :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;0Sensor 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.
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