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. Home Assistant
  4. Can't add nodes to HA

Can't add nodes to HA

Scheduled Pinned Locked Moved Home Assistant
9 Posts 3 Posters 4.1k Views 4 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.
  • sSpeakerS Offline
    sSpeakerS Offline
    sSpeaker
    wrote on last edited by
    #1

    I have about 15 nodes and they works well with openhab. But I can't add them to HA.

    configuration.yaml

    homeassistant:
      name: Home
      elevation: 185
      unit_system: metric
      time_zone: Europe/Kiev
    
    frontend:
    
    http:
    
    mysensors:
      gateways:
        - device: '/dev/ttyUSB0'
          persistence_file: '/home/homeassistant/mysensors.json'
          baud_rate: 115200
      debug: true
      optimistic: true
      persistence: true
      version: 1.5
    
    logger:
      default: debug
    

    example of sketch:

    #include <SPI.h>
    #include <MySensor.h>
    #include <MySigningAtsha204Soft.h>  
    #include <BH1750.h>
    #include <Wire.h>
    #include <dht.h>
    
    #define NodeID 1
    
    #define DHT22_VCC 7
    #define DHT22_PIN 6
    #define LIGHT_VCC 8
    #define MOTION_PIN 3
    #define LED_PIN 4
    
    // Declare interrupt pin
    #define INTERRUPT MOTION_PIN-2
    
    #define CHILD_ID_LIGHT 0
    #define CHILD_ID_HUM 1
    #define CHILD_ID_TEMP 2
    #define CHILD_ID_MOTION 3 
    
    unsigned long SLEEP_TIME = 60000; // Sleep time between reads (in milliseconds)
    
    BH1750 lightSensor;
    dht DHT;
    
    MyTransportNRF24 radio;
    MyHwATMega328 hw;
    
    //uint8_t soft_serial[SHA204_SERIAL_SZ] = {0x027,0x03,0xa1,0xaa,0x06,0x11,0x25,0xa3,0xa1};
    
    MySigningAtsha204Soft signer; //(true, 0, NULL, soft_serial);
    
    MySensor gw(radio, hw, signer);
    
    MyMessage msgLight(CHILD_ID_LIGHT, V_LIGHT_LEVEL);
    MyMessage msgHum(CHILD_ID_HUM, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
    MyMessage msgMot(CHILD_ID_MOTION, V_TRIPPED);
    
    // MyMessage msg(CHILD_ID_LIGHT, V_LEVEL);  
    
    boolean interrupt = false;
    
    void blink()
    {
      digitalWrite(LED_PIN, HIGH);
      gw.wait(1000);
      digitalWrite(LED_PIN, LOW);
    }
    
    long readVcc() {
      // Read 1.1V reference against AVcc
      // set the reference to Vcc and the measurement to the internal 1.1V reference
      #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__)
        ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
      #elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__)
        ADMUX = _BV(MUX5) | _BV(MUX0);
      #elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__)
        ADMUX = _BV(MUX3) | _BV(MUX2);
      #else
        ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1);
      #endif  
     
      delay(2); // Wait for Vref to settle
      ADCSRA |= _BV(ADSC); // Start conversion
      while (bit_is_set(ADCSRA,ADSC)); // measuring
     
      uint8_t low  = ADCL; // must read ADCL first - it then locks ADCH  
      uint8_t high = ADCH; // unlocks both
     
      long result = (high<<8) | low; 
      
      result = 1125300L / result; // Calculate Vcc (in mV); 1125300 = 1.1*1023*1000
      return result; // Vcc in millivolts
    }
    
    
    void setup()  
    { 
      pinMode(DHT22_VCC, OUTPUT);
      pinMode(MOTION_PIN, INPUT);
      pinMode(LED_PIN, OUTPUT);
      digitalWrite(LED_PIN, LOW);
    
      analogReference(INTERNAL);
    
      gw.begin(NULL, NodeID, false);
      gw.sendSketchInfo("Light Lux Sensor", "2.1");
      
      // Register all sensors to gateway (they will be created as child devices)
      gw.present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
      gw.present(CHILD_ID_HUM, S_HUM);
      gw.present(CHILD_ID_TEMP, S_TEMP);
      gw.present(CHILD_ID_MOTION, S_MOTION);
    
      lightSensor.begin(BH1750_ONE_TIME_LOW_RES_MODE);
    }
    
    void loop()
    { 
      digitalWrite(DHT22_VCC, HIGH); // Turn on DHT22 here to save time.
      unsigned long dht_time = millis();
      
      float batteryV  = readVcc();
      int batteryPcnt = ( ( batteryV - 3000 ) / 1200 ) * 100;
      Serial.print("Battery Voltage: ");
      Serial.print(batteryV);
      Serial.print(" mV; ");
      Serial.print("percentage: ");
      Serial.print(batteryPcnt);
      Serial.println(" %");
      gw.sendBatteryLevel(batteryPcnt);
    
      // Motion
      int tripped;
      if (interrupt) {
        //blink();
        tripped = 1;
      } else {
        if (digitalRead(MOTION_PIN) == HIGH) {
          //blink();
          tripped = 1; 
        } else {
          tripped = 0;
        }
      }
      Serial.print("Motion detected: ");
      Serial.println(tripped);
      
      gw.send(msgMot.set(tripped));  // Send tripped value to gw 
    
      //Light
      lightSensor.configure(BH1750_ONE_TIME_LOW_RES_MODE);
      uint16_t lux = lightSensor.readLightLevel();// Get Lux value
      
      Serial.print("Light: ");
      Serial.print(lux);
      Serial.println(" lx");
    
      gw.send(msgLight.set(lux));
      
      // Temp & Hum
      if ((millis() - dht_time) < 1000 ) {
        Serial.print("Wait fro DHT22: ");
        Serial.println(1000 - (millis() - dht_time));
        gw.wait(1000 - (millis() - dht_time));
      }
      Serial.print("DHT22, \t");
      int chk = DHT.read22(DHT22_PIN);
    
      digitalWrite(DHT22_VCC, LOW);
      switch (chk)
      {
        case DHTLIB_OK:
        Serial.print("OK,\t"); 
        break;
        case DHTLIB_ERROR_CHECKSUM: 
        Serial.println("Checksum error,\t"); 
        break;
        case DHTLIB_ERROR_TIMEOUT: 
        Serial.println("Time out error,\t"); 
        break;
        default: 
        Serial.println("Unknown error,\t"); 
        break;
      }
      // DISPLAY DATA
      if (chk == DHTLIB_OK ) {
        float temperature = DHT.temperature;
        float humidity = DHT.humidity;
        
        Serial.print(DHT.humidity, 1);
        Serial.print(",\t");
        Serial.println(DHT.temperature, 1);
    
        gw.send(msgTemp.set(temperature, 1)); 
        gw.send(msgHum.set(humidity, 1));
      }
      //We don't need to send motion trigger every minute.
      if (interrupt) {
        interrupt = false;
        gw.sleep(SLEEP_TIME);
      } else {
        interrupt = gw.sleep(INTERRUPT,RISING, SLEEP_TIME);
      }
    }
    

    I'm getting next output in the HA log after restarting the node :

    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=homeassistant, service=turn_off>
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=homeassistant, service=turn_on>
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=homeassistant, service=toggle>
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=homeassistant, service=reload_core_config>
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=persistent_notification, service=create>
    INFO:homeassistant.bootstrap:Home Assistant core initialized
    INFO:homeassistant.loader:Loaded mysensors from homeassistant.components.mysensors
    INFO:homeassistant.loader:Loaded logger from homeassistant.components.logger
    INFO:homeassistant.loader:Loaded http from homeassistant.components.http
    INFO:homeassistant.loader:Loaded frontend from homeassistant.components.frontend
    INFO:homeassistant.loader:Loaded api from homeassistant.components.api
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=logger>
    WARNING:mysensors.mysensors:File does not exist or is not readable: /home/homeassistant/mysensors.json
    WARNING:mysensors.mysensors:Trying backup file: /home/homeassistant/mysensors.json.bak
    WARNING:mysensors.mysensors:File does not exist or is not readable: /home/homeassistant/mysensors.json.bak
    WARNING:mysensors.mysensors:Failed to load sensors from file: /home/homeassistant/mysensors.json
    INFO:homeassistant.loader:Loaded sensor from homeassistant.components.sensor
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=mysensors>
    INFO:homeassistant.loader:Loaded switch from homeassistant.components.switch
    INFO:homeassistant.loader:Loaded light from homeassistant.components.light
    INFO:homeassistant.loader:Loaded binary_sensor from homeassistant.components.binary_sensor
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=http>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=api>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=frontend>
    INFO:homeassistant.core:Starting Home Assistant (7 threads)
    INFO:homeassistant.core:Bus:Handling <Event homeassistant_start[L]>
    INFO:homeassistant.core:Timer:starting
    INFO:mysensors.mysensors:Trying to connect to /dev/ttyUSB0
    INFO:mysensors.mysensors:/dev/ttyUSB0 is open...
    INFO:mysensors.mysensors:Connected to /dev/ttyUSB0
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=light, service=turn_on>
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=light, service=turn_off>
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=light, service=toggle>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=light>
    INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: discovered=, service=load_platform.light, platform=mysensors>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=binary_sensor>
    INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: discovered=, service=load_platform.binary_sensor, platform=mysensors>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sensor>
    INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: discovered=, service=load_platform.sensor, platform=mysensors>
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=switch, service=turn_off>
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=switch, service=turn_on>
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=switch, service=toggle>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=switch>
    INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: discovered=, service=load_platform.switch, platform=mysensors>
    INFO:homeassistant.loader:Loaded switch.mysensors from homeassistant.components.switch.mysensors
    INFO:homeassistant.loader:Loaded binary_sensor.mysensors from homeassistant.components.binary_sensor.mysensors
    INFO:homeassistant.loader:Loaded light.mysensors from homeassistant.components.light.mysensors
    INFO:homeassistant.loader:Loaded sensor.mysensors from homeassistant.components.sensor.mysensors
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=switch, service=mysensors_send_ir_code>
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=homeassistant, service=stop>
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=homeassistant, service=restart>
    INFO:homeassistant.components.http:Serving /api/stream to 192.168.0.14 (auth: True)
    DEBUG:homeassistant.components.api:STREAM 1991040496 ATTACHED
    DEBUG:homeassistant.components.api:STREAM 1991040496 WRITING data: ping
    INFO:homeassistant.components.http:Serving /api/bootstrap to 192.168.0.14 (auth: True)
    WARNING:mysensors.mysensors:Node 1 is unknown
    WARNING:mysensors.mysensors:Node 1 is unknown
    WARNING:mysensors.mysensors:Node 1 is unknown
    ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 0.
    WARNING:mysensors.mysensors:Node 1 is unknown
    ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 1.
    WARNING:mysensors.mysensors:Node 1 is unknown
    ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 2.
    WARNING:mysensors.mysensors:Node 1 is unknown
    WARNING:mysensors.mysensors:Node 1 is unknown
    WARNING:mysensors.mysensors:Node 1 is unknown
    WARNING:mysensors.mysensors:Node 1 is unknown
    WARNING:mysensors.mysensors:Node 1 is unknown
    

    GW and nodes are on 1.5.

    Do I need to fix something in the presentation procedure? Is it possible to add nodes manually?

    1 Reply Last reply
    0
    • martinhjelmareM Offline
      martinhjelmareM Offline
      martinhjelmare
      Plugin Developer
      wrote on last edited by
      #2

      Have you checked the serial output from your node? My guess is you don't have perfect communication between node and gateway and are dropping some messages. You can also try adding a short wait between presentation messages. The missing message from your log is the presentation message of the node, which is sent in the begin method in your sketch.

      It's possible to add sensors manually by editing the JSON persistence file, but it's not the recommended approach. If you have comm issues, I would try to fix those first, cause they would impact the performance of your sensors even if you would have them added in home assistant.

      Please post a parallel serial log from your node and the home assistant log after start. Also make sure you set log level to debug for mysensors.mysensors and include all lines from mysensors. You should have more lines in your log than posted above.

      1 Reply Last reply
      0
      • sSpeakerS Offline
        sSpeakerS Offline
        sSpeaker
        wrote on last edited by
        #3

        @martinhjelmare said:

        Fixed code with gw.wait(50). There was an error on sending third child before that:

        ...
        send: 1-1-0-0 s=3,c=0,t=1,pt=0,l=0,sg=0,st=fail:
        ...
        

        Now sketch looks like that:

        ...
        
          gw.begin(NULL, NodeID, false);
          gw.wait(50);
          gw.sendSketchInfo("Light Lux Sensor", "2.1");
          gw.wait(50);
          gw.present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
          gw.wait(50);
          gw.present(CHILD_ID_HUM, S_HUM);
          gw.wait(50);
          gw.present(CHILD_ID_TEMP, S_TEMP);
          gw.wait(50);
          gw.present(CHILD_ID_MOTION, S_MOTION);
        ...
        

        Sensor log:

        send: 1-1-0-0 s=255,c=3,t=15,pt=2,l=2,sg=0,st=ok:1
        read: 0-0-1 s=255,c=3,t=15,pt=2,l=2,sg=0:1
        send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
        read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:01C5B0DC963CB71F2DCD27C8B0F6D158F42093428EB9CC8D57
        send: 1-1-0-0 s=255,c=0,t=17,pt=0,l=5,sg=1,st=ok:1.5.4
        send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
        read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:017372F9A88F43BC6507E63AF0E71A395A1D40BA4DE874C687
        send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=1,st=ok:0
        sensor started, id=1, parent=0, distance=1
        send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
        read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:019A79B90F8BC63410C3F580DA25F2F468EFA1419E3B4E5FFE
        send: 1-1-0-0 s=255,c=3,t=11,pt=0,l=16,sg=1,st=ok:Light Lux Sensor
        send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
        read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:019A79B90F8BC63410C3F580DA25F2F468EFA1419E3B4E5FFE
        send: 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=1,st=ok:2.1
        send: 1-1-0-0 s=0,c=0,t=16,pt=0,l=0,sg=0,st=ok:
        send: 1-1-0-0 s=1,c=0,t=7,pt=0,l=0,sg=0,st=ok:
        send: 1-1-0-0 s=2,c=0,t=6,pt=0,l=0,sg=0,st=ok:
        send: 1-1-0-0 s=3,c=0,t=1,pt=0,l=0,sg=0,st=ok:
        Battery Voltage: 4077.00 mV; percentage: 89 %
        send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
        read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:01857D3E43A059F8EBDBA3F632014EB2B1CE62B3F58C017BE0
        send: 1-1-0-0 s=255,c=3,t=0,pt=1,l=1,sg=1,st=ok:89
        Motion detected: 1
        send: 1-1-0-0 s=3,c=3,t=16,pt=0,l=0,sg=0,st=ok:
        read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:017372F9A88F43BC6507E63AF0E71A395A1D40BA4DE874C687
        send: 1-1-0-0 s=3,c=1,t=16,pt=2,l=2,sg=1,st=ok:1
        Light: 3 lx
        send: 1-1-0-0 s=0,c=3,t=16,pt=0,l=0,sg=0,st=ok:
        read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:01857D3E43A059F8EBDBA3F632014EB2B1CE62B3F58C017BE0
        send: 1-1-0-0 s=0,c=1,t=23,pt=3,l=2,sg=1,st=ok:3
        Wait fro DHT22: 288
        DHT22, 	OK,	50.3,	24.6
        send: 1-1-0-0 s=2,c=3,t=16,pt=0,l=0,sg=0,st=ok:
        read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:011D852C06DD95F9234FD0E592B9A2DDA3429BCA9F77526474
        send: 1-1-0-0 s=2,c=1,t=0,pt=7,l=5,sg=1,st=ok:24.6
        send: 1-1-0-0 s=1,c=3,t=16,pt=0,l=0,sg=0,st=ok:
        read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:013CD41180660904233472CD7B7B8A48DC6CAB595096EC18FC
        send: 1-1-0-0 s=1,c=1,t=1,pt=7,l=5,sg=1,st=ok:50.3
        

        Gateway:

        1;255;3;0;6;0
        1;255;3;0;11;Light Lux Sensor
        1;255;3;0;12;2.1
        1;0;0;0;16;
        1;1;0;0;7;
        1;2;0;0;6;
        1;3;0;0;1;
        1;255;3;0;0;89
        1;3;1;0;16;1
        1;0;1;0;23;3
        1;2;1;0;0;24.6
        1;1;1;0;1;50.3
        

        Log of HA is the same:

        WARNING:mysensors.mysensors:Node 1 is unknown
        WARNING:mysensors.mysensors:Node 1 is unknown
        WARNING:mysensors.mysensors:Node 1 is unknown
        ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 0.
        WARNING:mysensors.mysensors:Node 1 is unknown
        ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 1.
        WARNING:mysensors.mysensors:Node 1 is unknown
        ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 2.
        WARNING:mysensors.mysensors:Node 1 is unknown
        ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 3.
        WARNING:mysensors.mysensors:Node 1 is unknown
        WARNING:mysensors.mysensors:Node 1 is unknown
        WARNING:mysensors.mysensors:Node 1 is unknown
        

        I added logger with debug. Also "debug: true" in mysensors section. Also --debug to hass command line. But there are no debug messages.
        Config:

        homeassistant:
          name: Home
          elevation: 185
          unit_system: metric
          time_zone: Europe/Kiev
        
        logger:
          default: debug
          logs:
            mysensors.mysensors: debug
        
        frontend:
        
        http:
        
        history:
        
        logbook:
        
        mysensors:
          gateways:
            - device: '/dev/ttyUSB0'
              persistence_file: '/home/homeassistant/.homeassistant/mysensors.json'
              baud_rate: 115200
          debug: true
          optimistic: true
          persistence: true
          version: 1.5
        
        martinhjelmareM 1 Reply Last reply
        0
        • sSpeakerS sSpeaker

          @martinhjelmare said:

          Fixed code with gw.wait(50). There was an error on sending third child before that:

          ...
          send: 1-1-0-0 s=3,c=0,t=1,pt=0,l=0,sg=0,st=fail:
          ...
          

          Now sketch looks like that:

          ...
          
            gw.begin(NULL, NodeID, false);
            gw.wait(50);
            gw.sendSketchInfo("Light Lux Sensor", "2.1");
            gw.wait(50);
            gw.present(CHILD_ID_LIGHT, S_LIGHT_LEVEL);
            gw.wait(50);
            gw.present(CHILD_ID_HUM, S_HUM);
            gw.wait(50);
            gw.present(CHILD_ID_TEMP, S_TEMP);
            gw.wait(50);
            gw.present(CHILD_ID_MOTION, S_MOTION);
          ...
          

          Sensor log:

          send: 1-1-0-0 s=255,c=3,t=15,pt=2,l=2,sg=0,st=ok:1
          read: 0-0-1 s=255,c=3,t=15,pt=2,l=2,sg=0:1
          send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
          read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:01C5B0DC963CB71F2DCD27C8B0F6D158F42093428EB9CC8D57
          send: 1-1-0-0 s=255,c=0,t=17,pt=0,l=5,sg=1,st=ok:1.5.4
          send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
          read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:017372F9A88F43BC6507E63AF0E71A395A1D40BA4DE874C687
          send: 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=1,st=ok:0
          sensor started, id=1, parent=0, distance=1
          send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
          read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:019A79B90F8BC63410C3F580DA25F2F468EFA1419E3B4E5FFE
          send: 1-1-0-0 s=255,c=3,t=11,pt=0,l=16,sg=1,st=ok:Light Lux Sensor
          send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
          read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:019A79B90F8BC63410C3F580DA25F2F468EFA1419E3B4E5FFE
          send: 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=1,st=ok:2.1
          send: 1-1-0-0 s=0,c=0,t=16,pt=0,l=0,sg=0,st=ok:
          send: 1-1-0-0 s=1,c=0,t=7,pt=0,l=0,sg=0,st=ok:
          send: 1-1-0-0 s=2,c=0,t=6,pt=0,l=0,sg=0,st=ok:
          send: 1-1-0-0 s=3,c=0,t=1,pt=0,l=0,sg=0,st=ok:
          Battery Voltage: 4077.00 mV; percentage: 89 %
          send: 1-1-0-0 s=255,c=3,t=16,pt=0,l=0,sg=0,st=ok:
          read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:01857D3E43A059F8EBDBA3F632014EB2B1CE62B3F58C017BE0
          send: 1-1-0-0 s=255,c=3,t=0,pt=1,l=1,sg=1,st=ok:89
          Motion detected: 1
          send: 1-1-0-0 s=3,c=3,t=16,pt=0,l=0,sg=0,st=ok:
          read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:017372F9A88F43BC6507E63AF0E71A395A1D40BA4DE874C687
          send: 1-1-0-0 s=3,c=1,t=16,pt=2,l=2,sg=1,st=ok:1
          Light: 3 lx
          send: 1-1-0-0 s=0,c=3,t=16,pt=0,l=0,sg=0,st=ok:
          read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:01857D3E43A059F8EBDBA3F632014EB2B1CE62B3F58C017BE0
          send: 1-1-0-0 s=0,c=1,t=23,pt=3,l=2,sg=1,st=ok:3
          Wait fro DHT22: 288
          DHT22, 	OK,	50.3,	24.6
          send: 1-1-0-0 s=2,c=3,t=16,pt=0,l=0,sg=0,st=ok:
          read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:011D852C06DD95F9234FD0E592B9A2DDA3429BCA9F77526474
          send: 1-1-0-0 s=2,c=1,t=0,pt=7,l=5,sg=1,st=ok:24.6
          send: 1-1-0-0 s=1,c=3,t=16,pt=0,l=0,sg=0,st=ok:
          read: 0-0-1 s=255,c=3,t=17,pt=6,l=25,sg=0:013CD41180660904233472CD7B7B8A48DC6CAB595096EC18FC
          send: 1-1-0-0 s=1,c=1,t=1,pt=7,l=5,sg=1,st=ok:50.3
          

          Gateway:

          1;255;3;0;6;0
          1;255;3;0;11;Light Lux Sensor
          1;255;3;0;12;2.1
          1;0;0;0;16;
          1;1;0;0;7;
          1;2;0;0;6;
          1;3;0;0;1;
          1;255;3;0;0;89
          1;3;1;0;16;1
          1;0;1;0;23;3
          1;2;1;0;0;24.6
          1;1;1;0;1;50.3
          

          Log of HA is the same:

          WARNING:mysensors.mysensors:Node 1 is unknown
          WARNING:mysensors.mysensors:Node 1 is unknown
          WARNING:mysensors.mysensors:Node 1 is unknown
          ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 0.
          WARNING:mysensors.mysensors:Node 1 is unknown
          ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 1.
          WARNING:mysensors.mysensors:Node 1 is unknown
          ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 2.
          WARNING:mysensors.mysensors:Node 1 is unknown
          ERROR:mysensors.mysensors:Node 1 is unknown, will not add child 3.
          WARNING:mysensors.mysensors:Node 1 is unknown
          WARNING:mysensors.mysensors:Node 1 is unknown
          WARNING:mysensors.mysensors:Node 1 is unknown
          

          I added logger with debug. Also "debug: true" in mysensors section. Also --debug to hass command line. But there are no debug messages.
          Config:

          homeassistant:
            name: Home
            elevation: 185
            unit_system: metric
            time_zone: Europe/Kiev
          
          logger:
            default: debug
            logs:
              mysensors.mysensors: debug
          
          frontend:
          
          http:
          
          history:
          
          logbook:
          
          mysensors:
            gateways:
              - device: '/dev/ttyUSB0'
                persistence_file: '/home/homeassistant/.homeassistant/mysensors.json'
                baud_rate: 115200
            debug: true
            optimistic: true
            persistence: true
            version: 1.5
          
          martinhjelmareM Offline
          martinhjelmareM Offline
          martinhjelmare
          Plugin Developer
          wrote on last edited by martinhjelmare
          #4

          @sSpeaker

          The node presentation message is missing from the gateway log. It should be in the beginning.

          What version of home assistant are you running?

          1 Reply Last reply
          0
          • sSpeakerS Offline
            sSpeakerS Offline
            sSpeaker
            wrote on last edited by
            #5

            @martinhjelmare said:

            What version of home assistant are you running?

            $ hass --version
            0.28.2
            

            Not really sure why there are no presentation messages on GW side. According to the log it was sent successfully.

            It's possible to add sensors manually by editing the JSON persistence file.

            Can you share an example of this file.

            1 Reply Last reply
            0
            • martinhjelmareM Offline
              martinhjelmareM Offline
              martinhjelmare
              Plugin Developer
              wrote on last edited by
              #6

              Here's an example of a JSON persistence file:

              {
                "0": {
                  "type": 18,
                  "sensor_id": 0,
                  "battery_level": 0,
                  "children": {},
                  "sketch_version": null,
                  "protocol_version": "2.0.1-beta",
                  "sketch_name": null
                },
                "1": {
                  "type": 17,
                  "sensor_id": 1,
                  "battery_level": 0,
                  "children": {
                    "1": {
                      "type": 0,
                      "description": "",
                      "values": {
                        "16": "0"
                      },
                      "id": 1
                    },
                    "2": {
                      "type": 3,
                      "description": "",
                      "values": {
                        "2": "0"
                      },
                      "id": 2
                    }
                  },
                  "sketch_version": "1.0",
                  "protocol_version": "2.0.1-beta",
                  "sketch_name": "Binary Sensor"
                }
              }
              
              1 Reply Last reply
              0
              • krz2348K Offline
                krz2348K Offline
                krz2348
                wrote on last edited by
                #7

                i have "the same" problem at Home Assistant
                I have got only Serial Gateway with 2 temperature sensors (only for test). MySensors V2.0 in the Arduino IDE. I do the presentation:

                0;255;3;0;9;Starting gateway (R-NGA-, 2.0.0)
                0;255;3;0;14;Gateway startup complete.
                0;255;3;0;11;Szafa
                0;255;3;0;12;0.1
                0;0;0;0;6;
                0;1;0;0;6;
                0;255;3;0;9;No registration required
                0;255;3;0;9;Init complete, id=0, parent=0, distance=0, registration=1
                0;0;1;0;0;0
                0;0;2;0;2;
                0;1;1;0;0;0
                0;1;2;0;2;
                

                HA response:

                "Node 0 is unknown."
                "Requesting new presentation for node 0"
                "Node 0 is unknown , will not add child 0."
                "Requesting new presentation for node 0"
                "Node 0 is unknown , will not add child 1."
                "Requesting new presentation for node 0"
                

                I even try send this strings by arduino Serial and SoftwareSerial ..
                When HA says about Requesting serial gets "0;255;3;0;19;"

                0;255;3;0;9;Starting gateway (R-NGA-, 2.0.0)  //no effect on HA log
                0;255;3;0;14;Gateway startup complete. //no effect on HA log
                0;255;3;0;11;Szafa  // HA: 0;255;3;0;19;
                0;255;3;0;12;0.1  //HA: 0;255;3;0;19;
                0;0;0;0;6;  //HA: 0;255;3;0;19;
                0;1;0;0;6;  //HA:  0;255;3;0;19;
                

                I don't know, what to do... i need to connect 2 or 3 Serial Gateways with 5 sensors each GW.

                1 Reply Last reply
                0
                • martinhjelmareM Offline
                  martinhjelmareM Offline
                  martinhjelmare
                  Plugin Developer
                  wrote on last edited by
                  #8

                  There's a bug in mysensors 2.0 where the gateway doesn't present itself in all cases. See here: https://github.com/theolind/pymysensors/issues/51

                  Either use the workaround mentioned in the github issue, or upgrade to dev branch of mysensors, where this bug is fixed.

                  1 Reply Last reply
                  0
                  • krz2348K Offline
                    krz2348K Offline
                    krz2348
                    wrote on last edited by
                    #9

                    Thanks man ... now it's working.... :beer:

                    1 Reply Last reply
                    1
                    Reply
                    • Reply as topic
                    Log in to reply
                    • Oldest to Newest
                    • Newest to Oldest
                    • Most Votes


                    14

                    Online

                    11.7k

                    Users

                    11.2k

                    Topics

                    113.0k

                    Posts


                    Copyright 2019 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