Error using Home Assistant with a serial gateway



  • Hi,

    I've been taking a look at Home Assistant lately, but encountered some problems setting it up.
    The first time I installed HA (0.10), I could connect my serial gateway and my temp sensor was recognized and added to the display on top of the web page.
    My install seems to have been corrupted though.
    When I wanted to test it out some more this week (with versions 0.10, 0.11.0 and 0.11.1) I can't get mysensors to work.

    HA can connect to the gateway, as seen here:

    INFO:mysensors.mysensors:/dev/ttyUSB2 is open...
    INFO:mysensors.mysensors:Connected to /dev/ttyUSB2
    

    But a little further on, I receive this error in the console:

    Exception in thread Thread-7:
    Traceback (most recent call last):
      File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
        self.run()
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 312, in run
        response = self.handle_queue()
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 222, in handle_queue
        reply = func(*args, **kwargs)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 105, in logic
        msg = Message(data)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 397, in __init__
        self.decode(data)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 417, in decode
        self.sub_type) = [int(f) for f in data]
    ValueError: need more than 0 values to unpack
    

    Has anyone else encountered this or have any idea how to solve this issue?

    Thanks in advance!


  • Plugin Developer

    @BastienVH

    Hi!

    Yes, I encounter it every now and then. I think it's some sort of out of sync comm creating a problem. Try restarting home assistant. If that doesn't solve it, disconnect/reconnect the USB for the serial gateway and restart home assistant. That always solves it for me.

    I'm looking into a software workaround to avoid the error.

    Edit:
    I only see this error at start of home assistant. Once it's solved after the restart I've never seen during operation.



  • Hi Martin,

    @martinhjelmare
    I've been trying the last couple of days to get it working, but to no avail...

    I stell get errors like

    ValueError: need more than 1 value to unpack
    

    The number can change though.
    I've tried your suggestions, updated and rebooted the pi but still no luck.
    Uninstalled and reinstalled home assistant but that also didn't help.

    Any other things I could try?



  • @BastienVH said:

    Hi Martin,

    @martinhjelmare
    I've been trying the last couple of days to get it working, but to no avail...

    I stell get errors like

    ValueError: need more than 1 value to unpack
    

    The number can change though.
    I've tried your suggestions, updated and rebooted the pi but still no luck.
    Uninstalled and reinstalled home assistant but that also didn't help.

    Any other things I could try?

    I have been getting the same thing... it worked on one occasion where it was able to load, but I didnt know the sensors had to "present" themselves at that time... so I made some research, restarted HA, rebooted the pi, disconnected the serial gw... I have been trying at least 25 times since and now I am always getting this:

    16-01-23 14:32:29 homeassistant.bootstrap: Error during setup of component mysensors
    Traceback (most recent call last):
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 98, in _setup_component
        if not component.setup(hass, config):
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 124, in setup
        port, persistence, persistence_file, version)
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 90, in setup_gateway
        protocol_version=version)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 261, in __init__
        persistence_file, protocol_version)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 33, in __init__
        self._load_sensors()
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 153, in _load_sensors
        self._perform_file_action(self.persistence_file, 'load')
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 167, in _perform_file_action
        fn(filename)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 136, in _load_json
        self.sensors = json.load(f, cls=MySensorsJSONDecoder)
      File "/usr/lib/python3.4/json/__init__.py", line 268, in load
        parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
      File "/usr/lib/python3.4/json/__init__.py", line 331, in loads
        return cls(**kw).decode(s)
      File "/usr/lib/python3.4/json/decoder.py", line 343, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/usr/lib/python3.4/json/decoder.py", line 361, in raw_decode
        raise ValueError(errmsg("Expecting value", s, err.value)) from None
    ValueError: Expecting value: line 1 column 1 (char 0)
    

    Any help appreciated 🙂

    Thanks,

    dels



  • @dels said:

    @BastienVH said:

    Hi Martin,

    @martinhjelmare
    I've been trying the last couple of days to get it working, but to no avail...

    I stell get errors like

    ValueError: need more than 1 value to unpack
    

    The number can change though.
    I've tried your suggestions, updated and rebooted the pi but still no luck.
    Uninstalled and reinstalled home assistant but that also didn't help.

    Any other things I could try?

    I have been getting the same thing... it worked on one occasion where it was able to load, but I didnt know the sensors had to "present" themselves at that time... so I made some research, restarted HA, rebooted the pi, disconnected the serial gw... I have been trying at least 25 times since and now I am always getting this:

    16-01-23 14:32:29 homeassistant.bootstrap: Error during setup of component mysensors
    Traceback (most recent call last):
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 98, in _setup_component
        if not component.setup(hass, config):
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 124, in setup
        port, persistence, persistence_file, version)
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 90, in setup_gateway
        protocol_version=version)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 261, in __init__
        persistence_file, protocol_version)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 33, in __init__
        self._load_sensors()
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 153, in _load_sensors
        self._perform_file_action(self.persistence_file, 'load')
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 167, in _perform_file_action
        fn(filename)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 136, in _load_json
        self.sensors = json.load(f, cls=MySensorsJSONDecoder)
      File "/usr/lib/python3.4/json/__init__.py", line 268, in load
        parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
      File "/usr/lib/python3.4/json/__init__.py", line 331, in loads
        return cls(**kw).decode(s)
      File "/usr/lib/python3.4/json/decoder.py", line 343, in decode
        obj, end = self.raw_decode(s, idx=_w(s, 0).end())
      File "/usr/lib/python3.4/json/decoder.py", line 361, in raw_decode
        raise ValueError(errmsg("Expecting value", s, err.value)) from None
    ValueError: Expecting value: line 1 column 1 (char 0)
    

    Any help appreciated 🙂

    Thanks,

    dels

    Well... I feel stupid. I had completely forgotten that I had a Domoticz installed back a few weeks back when I first started searching for the right controller and it restarted when I rebooted the server... when I saw it was loaded, I shut it down and disabled it... then restarted home-assistant, which loaded mysensors perfectly and discovered the PIR sensor as soon as I reconnected it (after the mysensors component was loaded in HA). My guess is it loaded before HA and had dibs on the serial port or something...

    I hope it helps someone else!


  • Plugin Developer

    @dels

    Nice catch! Yes, the serial port is exclusive. Only one device/user at a time per port per end, is allowed.


  • Plugin Developer

    @BastienVH

    What version of pyserial do you have installed?

    For me version 2.5 has been the least buggy. Version 2.7 has a bug which was solved in version 3, but other bugs have emerged. I'm hoping they will be fixed soon.

    pip3 install pyserial==2.5
    

    Repeat this if you upgrade home assistant.

    Do you also only see the error on startup, or have you every successfully started up home assistant and loaded mysensors without errors, and later while running had this error?

    I'd like to try and make a workaround in the pymysensors api, but as I haven't really nailed down the bottom cause, all information will help me.


  • Plugin Developer

    Btw, I'm also working on a mysensors ethernet gateway for home assistant, but there is still some work and testing to be done.

    If you already have an ethernet module and like mqtt and don't mind having to do some configuring for every sensor/switch, mqtt is supported by home assistant in general. @Mihai has written a couple of guides both here and in the home assistant forum, for that.

    Soon I'm hoping you will have the option of choosing between all three gateway types when using home assistant, but of course we should try and make the serial connection more reliable.



  • @martinhjelmare
    I was running pyserial 2.6, but have now installed version 2.5.
    I get the error, the moment I restart a sensor to have it included in HA.
    When I press the reset button on my sensor, the error shows up almost instantly in the terminal.
    So I guess that means that HA can connect to the serial gateway and receive messages, but just doesn't deal with it properly...

    Also: I had some trouble uninstalling the pyserial version and after some messing around, I now get this in my 'pip freeze'

    pyserial-py3k==2.5
    

    No mention of a 'normal' pyserial.

    Thanks for the help you've already provided!


  • Plugin Developer

    @BastienVH

    Regarding py3k, that was a bug solved in 2.7:
    "[Bug pyserial:130] setup.py should not append py3k to package name"
    in https://github.com/pyserial/pyserial/blob/master/CHANGES.rst
    But that shouldn't affect the performance of 2.5, I think.

    If I understand correct, you do:

    hass
    

    wait for and get:

    n:0 c:0 t:3 s:9 p:gateway started, id=0, parent=0, distance=0
    

    Then you reset your sensor node, and get the error?

    Edit:
    In my experience, I don't think I get the gateway started confirmation before I get the error. You should make sure that the gateway is ready before you do the restart of the sensor node. I think the problem might be that the gateway tries to talk to homeassistant before homeassistant is ready, and only part of the message gets "translated".



  • @martinhjelmare
    I never got the "n:0 c:0 ...." message, only "Connected to /dev/MSgw".
    I found out there was an instance of FHEM running and occuping the GW.
    I stopped that and now it does give the "gateway started" message.

    Now the error occurs indeed before the gateway started message.

    Now I get the following after trying to let a node with DHT send its data to the gateway:

    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 10-10-0 s=255,c=3,t=15,pt=2,l=2,sg=0:0
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 10-10-0 s=255,c=0,t=17,pt=0,l=5,sg=0:1.5.3
    INFO:homeassistant.components.mysensors:update sensor_update: node 10
    INFO:homeassistant.components.sensor.mysensors:Motion Sensor 10.1: value_type 16, value = 0
    Exception in thread Thread-15:
    Traceback (most recent call last):
      File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
        self.run()
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 312, in run
        response = self.handle_queue()
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 222, in handle_queue
        reply = func(*args, **kwargs)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 108, in logic
        self._handle_presentation(msg)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 51, in _handle_presentation
        self.alert(msg.node_id)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 175, in alert
        self.event_callback("sensor_update", nid)
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 226, in node_update
        callback(self, node_id)
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 149, in mysensors_callback
        entity.update_ha_state(True)
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity.py", line 108, in update_ha_state
        self.unit_of_measurement is not None:
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/sensor/mysensors.py", line 137, in unit_of_measurement
        self.value_type == self.gateway.const.SetReq.V_PERCENTAGE or \
      File "/usr/lib/python3.4/enum.py", line 255, in __getattr__
        raise AttributeError(name) from None
    AttributeError: V_PERCENTAGE
    

    Is there a list with which kinds of sensors are supported in HA?
    Is motion/pir supported?


  • Plugin Developer

    @BastienVH

    Basically all pure sensors are supported. Not all actuator types, though.

    You can look at the source code for specifics. I want to add more documentation, but it's not done currently.

    Your log seems to concern a motion sensor, but you said DHT?

    You need to post the sensor sketch and all of the log from gateway started confirmation, to give me more background.



  • @martinhjelmare
    Yeah, I was also trying to get my motion sketch working, so that log message may have been something left over from that.

    This is everything in my terminal

    INFO:mysensors.mysensors:/dev/MSgw is open...
    INFO:mysensors.mysensors:Connected to /dev/MSgw
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:gateway started, id=0, parent=0, distance=0
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.1
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.70
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.70
    INFO:homeassistant.components.discovery:Found new service: DLNA http://192.168.1.70:1972/DeviceDescription.xml
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 10-10-0 s=255,c=3,t=15,pt=2,l=2,sg=0:0
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 10-10-0 s=255,c=0,t=17,pt=0,l=5,sg=0:1.5.3
    INFO:homeassistant.components.mysensors:update sensor_update: node 10
    INFO:homeassistant.components.sensor.mysensors:Motion Sensor 10.1: value_type 16, value = 0
    Exception in thread Thread-6:
    Traceback (most recent call last):
      File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
        self.run()
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 312, in run
        response = self.handle_queue()
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 222, in handle_queue
        reply = func(*args, **kwargs)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 108, in logic
        self._handle_presentation(msg)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 51, in _handle_presentation
        self.alert(msg.node_id)
      File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 175, in alert
        self.event_callback("sensor_update", nid)
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 226, in node_update
        callback(self, node_id)
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 149, in mysensors_callback
        entity.update_ha_state(True)
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/helpers/entity.py", line 108, in update_ha_state
        self.unit_of_measurement is not None:
      File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/sensor/mysensors.py", line 137, in unit_of_measurement
        self.value_type == self.gateway.const.SetReq.V_PERCENTAGE or \
      File "/usr/lib/python3.4/enum.py", line 255, in __getattr__
        raise AttributeError(name) from None
    AttributeError: V_PERCENTAGE
    

    I hope you can find something there...


  • Plugin Developer

    This post is deleted!

  • Plugin Developer

    @BastienVH

    I don't see a line in the log for presentation of the child sensor, or sketch name, or sketch version, but there already seem to be info loaded, sketch name and version and value type, looking at the line before the stack trace.

    Is persistence disabled? Do you present the sensor in the sketch? Can you link to or post your sketch?

    I think the problem might be that you're reusing an old node id with a different sensor type that's already been loaded via persistence.

    I don't think I support these dynamics at the moment. I'll have to look more closely in the code, but if you can link your sketch, that will help me confirm this.

    Solution would be to clear the persistence file.



  • @martinhjelmare

    Sorry, I was away from the computer for a little while.
    I did reuse an old node id, that could have been the problem.
    Assigned a new node ID and this is where I stand now:

    Firts up: the node sketch:

    /**
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - Henrik EKblad
     *
     * DESCRIPTION
     * This sketch provides an example how to implement a humidity/temperature
     * sensor using DHT11/DHT-22
     * http://www.mysensors.org/build/humidity
     */
    
    #include <SPI.h>
    #include <MySensor.h>
    #include <DHT.h>
    
    #define DIGITAL_INPUT_MOTION 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
    #define INTERRUPT DIGITAL_INPUT_MOTION-2 // Usually the interrupt = pin -2 (on uno/nano anyway)
    #define CHILD_ID_HUM 0
    #define CHILD_ID_TEMP 1
    #define CHILD_ID_MOT 2
    #define HUMIDITY_SENSOR_DIGITAL_PIN 4
    unsigned long SLEEP_TIME = 15000; // Sleep time between reads (in milliseconds)
    
    MySensor gw;
    DHT dht;
    float lastTemp;
    float lastHum;
    boolean metric = true;
    MyMessage msgHum(CHILD_ID_HUM, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
    MyMessage msgMot(CHILD_ID_MOT, V_TRIPPED);
    int node_id = 20;
    boolean lastTripped = false ;
    
    void setup()
    {
      gw.begin(NULL, node_id);
      dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN);
    
      // Send the Sketch Version Information to the Gateway
      gw.sendSketchInfo("Humidity and motion", "1.0");
    
      pinMode(DIGITAL_INPUT_MOTION, INPUT);      // sets the motion sensor digital pin as input
    
      // Register all sensors to gw (they will be created as child devices)
      gw.present(CHILD_ID_HUM, S_HUM);
      gw.present(CHILD_ID_TEMP, S_TEMP);
      gw.present(CHILD_ID_MOT, S_MOTION);
      metric = gw.getConfig().isMetric;
    }
    
    void loop()
    {
      /* int wake;
      wake = gw.sleep(INTERRUPT, CHANGE, SLEEP_TIME);
    
       if (wake == 1) {
         Serial.println("wake by motion");
         Serial.println("reading motion");
         motion();
       }
    
       else {
         Serial.println("wake by timer");
         Serial.println("reading motion");
         motion();
         Serial.println("reading temp/hum");
         humTemp();
       }
      */
      motion();
      
      Serial.println("read temp / hum");
      humTemp();
    
      Serial.println("going to sleep now.");
      gw.sleep(INTERRUPT, CHANGE, SLEEP_TIME); //sleep a bit
    }
    
    void motion() {
      // Read digital motion value
      boolean tripped = digitalRead(DIGITAL_INPUT_MOTION);
      Serial.println(tripped);
      if (lastTripped != tripped) {
        gw.send(msgMot.set(tripped ? "1" : "0")); // Send tripped value to gw
        lastTripped = tripped;
      }
    }
    
    void humTemp() {
      gw.wait(dht.getMinimumSamplingPeriod());
    
      float temperature = dht.getTemperature();
      if (isnan(temperature)) {
        Serial.println("Failed reading temperature from DHT");
      } else if (temperature != lastTemp) {
        lastTemp = temperature;
        if (!metric) {
          temperature = dht.toFahrenheit(temperature);
        }
        gw.send(msgTemp.set(temperature, 1));
        Serial.print("T: ");
        Serial.println(temperature);
      }
    
      float humidity = dht.getHumidity();
      if (isnan(humidity)) {
        Serial.println("Failed reading humidity from DHT");
      } else if (humidity != lastHum) {
        lastHum = humidity;
        gw.send(msgHum.set(humidity, 1));
        Serial.print("H: ");
        Serial.println(humidity);
      }
    }
    

    Now, my HA config:

    homeassistant:
      # Name of the location where Home Assistant is running
      name: Home
      # Location required to calculate the time the sun rises and sets
      latitude: xxxxxxxx
      longitude: xxxxxxxxxxxxxx
      # C for Celcius, F for Fahrenheit
      temperature_unit: C
      # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
      time_zone: Europe/Brussels
    
    # View all events in a logbook
    logbook:
    
    # Checks for available updates
    updater:
    
    # Discover some devices automatically
    discovery:
    
    # Track the sun
    sun:
    
    # Allows you to issue voice commands from the frontend
    conversation:
    
    # Enables support for tracking state changes over time.
    history:
    
    # Enables the frontend
    frontend:
    
    # Show links to resources in log and frontend
    introduction:
    
    mysensors:
      gateways:
        - port: '/dev/MSgw'
      debug: true
      persistence: false
    

    and the output when starting hass:

    
    Config directory: /home/pi/.homeassistant
    WARNING:homeassistant.bootstrap:Colorlog package not found, console coloring disabled
    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.bootstrap:Home Assistant core initialized
    INFO:homeassistant.loader:Loaded logbook from homeassistant.components.logbook
    INFO:homeassistant.loader:Loaded recorder from homeassistant.components.recorder
    INFO:homeassistant.loader:Loaded http from homeassistant.components.http
    INFO:homeassistant.loader:Loaded history from homeassistant.components.history
    INFO:homeassistant.loader:Loaded introduction from homeassistant.components.introduction
    INFO:homeassistant.loader:Loaded updater from homeassistant.components.updater
    INFO:homeassistant.loader:Loaded conversation from homeassistant.components.conversation
    INFO:homeassistant.loader:Loaded discovery from homeassistant.components.discovery
    INFO:homeassistant.loader:Loaded mysensors from homeassistant.components.mysensors
    INFO:homeassistant.loader:Loaded frontend from homeassistant.components.frontend
    INFO:homeassistant.loader:Loaded api from homeassistant.components.api
    INFO:homeassistant.loader:Loaded sun from homeassistant.components.sun
    INFO:homeassistant.components.introduction:
    
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
            Hello, and welcome to Home Assistant!
    
            We'll hope that we can make all your dreams come true.
    
            Here are some resources to get started:
    
             - Configuring Home Assistant:
               https://home-assistant.io/getting-started/configuration/
    
             - Available components:
               https://home-assistant.io/components/
    
             - Troubleshooting your configuration:
               https://home-assistant.io/getting-started/troubleshooting-configuration/
    
             - Getting help:
               https://home-assistant.io/help/
    
            This message is generated by the introduction component. You can
            disable it in configuration.yaml.
    
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=introduction>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=recorder>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=http>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=logbook>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=history>
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): pypi.python.org
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=updater>
    /home/pi/.homeassistant/lib/fuzzywuzzy/fuzz.py:33: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
      warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=conversation, service=process>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=conversation>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=discovery>
    INFO:homeassistant.loader:Loaded sensor from homeassistant.components.sensor
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sensor>
    INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: discovered=, service=mysensors.sensors>
    INFO:homeassistant.loader:Loaded sensor.mysensors from homeassistant.components.sensor.mysensors
    INFO:homeassistant.loader:Loaded switch from homeassistant.components.switch
    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 component_loaded[L]: component=switch>
    INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: discovered=, service=mysensors.switches>
    INFO:homeassistant.loader:Loaded switch.mysensors from homeassistant.components.switch.mysensors
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=mysensors>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=api>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=frontend>
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): maps.googleapis.com
    INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state sun.sun=below_horizon; next_setting=16:19:22 25-01-2016, friendly_name=Sun, next_rising=07:29:47 25-01-2016, elevation=-33.1 @ 20:51:46 24-01-2016>, entity_id=sun.sun>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sun>
    INFO:homeassistant.core:Starting Home Assistant (16 threads)
    INFO:homeassistant.core:Bus:Handling <Event homeassistant_start[L]>
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=homeassistant, service=stop>
    INFO:homeassistant.components.http:Starting web interface at http://0.0.0.0:8123
    INFO:homeassistant.core:Timer:starting
    INFO:mysensors.mysensors:Trying to connect to /dev/MSgw
    INFO:homeassistant.components.http:"GET /api/stream?api_password=no_password_set&restrict=state_changed,component_loaded,service_registered HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /api/stream?api_password=no_password_set&restrict=state_changed,component_loaded,service_registered HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /api/bootstrap HTTP/1.1" 200 -
    INFO:netdisco.service:Scanning
    INFO:homeassistant.components.http:"GET /api/bootstrap HTTP/1.1" 200 -
    INFO:mysensors.mysensors:/dev/MSgw is open...
    INFO:mysensors.mysensors:Connected to /dev/MSgw
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:gateway started, id=0, parent=0, distance=0
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:54.0
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.70
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.70
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.1
    INFO:homeassistant.components.discovery:Found new service: DLNA http://192.168.1.70:1972/DeviceDescription.xml
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:53.0
    INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state sun.sun=below_horizon; next_setting=16:19:22 25-01-2016, friendly_name=Sun, next_rising=07:29:47 25-01-2016, elevation=-33.21 @ 20:51:46 24-01-2016>, entity_id=sun.sun, old_state=<state sun.sun=below_horizon; next_setting=16:19:22 25-01-2016, friendly_name=Sun, next_rising=07:29:47 25-01-2016, elevation=-33.1 @ 20:51:46 24-01-2016>>
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:54.0
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:53.0
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:54.0
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:53.0
    INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state sun.sun=below_horizon; next_setting=16:19:22 25-01-2016, friendly_name=Sun, next_rising=07:29:47 25-01-2016, elevation=-33.36 @ 20:51:46 24-01-2016>, entity_id=sun.sun, old_state=<state sun.sun=below_horizon; next_setting=16:19:22 25-01-2016, friendly_name=Sun, next_rising=07:29:47 25-01-2016, elevation=-33.21 @ 20:51:46 24-01-2016>>
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:54.0
    INFO:homeassistant.components.http:"GET /states HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /static/frontend-1003c31441ec44b3db84b49980f736a7.html HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /static/favicon-192x192.png HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /static/favicon.ico HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /api/bootstrap HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /api/stream?api_password=no_password_set&restrict=state_changed,component_loaded,service_registered HTTP/1.1" 200 -
    

    I don't get errors anymore, but nothing shows up in the web interface.
    I think the messages aren't being interpreted?



  • @BastienVH said:

    @martinhjelmare

    Sorry, I was away from the computer for a little while.
    I did reuse an old node id, that could have been the problem.
    Assigned a new node ID and this is where I stand now:

    Firts up: the node sketch:

    /**
     * The MySensors Arduino library handles the wireless radio link and protocol
     * between your home built sensors/actuators and HA controller of choice.
     * The sensors forms a self healing radio network with optional repeaters. Each
     * repeater and gateway builds a routing tables in EEPROM which keeps track of the
     * network topology allowing messages to be routed to nodes.
     *
     * Created by Henrik Ekblad <henrik.ekblad@mysensors.org>
     * Copyright (C) 2013-2015 Sensnology AB
     * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors
     *
     * Documentation: http://www.mysensors.org
     * Support Forum: http://forum.mysensors.org
     *
     * This program is free software; you can redistribute it and/or
     * modify it under the terms of the GNU General Public License
     * version 2 as published by the Free Software Foundation.
     *
     *******************************
     *
     * REVISION HISTORY
     * Version 1.0 - Henrik EKblad
     *
     * DESCRIPTION
     * This sketch provides an example how to implement a humidity/temperature
     * sensor using DHT11/DHT-22
     * http://www.mysensors.org/build/humidity
     */
    
    #include <SPI.h>
    #include <MySensor.h>
    #include <DHT.h>
    
    #define DIGITAL_INPUT_MOTION 3   // The digital input you attached your motion sensor.  (Only 2 and 3 generates interrupt!)
    #define INTERRUPT DIGITAL_INPUT_MOTION-2 // Usually the interrupt = pin -2 (on uno/nano anyway)
    #define CHILD_ID_HUM 0
    #define CHILD_ID_TEMP 1
    #define CHILD_ID_MOT 2
    #define HUMIDITY_SENSOR_DIGITAL_PIN 4
    unsigned long SLEEP_TIME = 15000; // Sleep time between reads (in milliseconds)
    
    MySensor gw;
    DHT dht;
    float lastTemp;
    float lastHum;
    boolean metric = true;
    MyMessage msgHum(CHILD_ID_HUM, V_HUM);
    MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
    MyMessage msgMot(CHILD_ID_MOT, V_TRIPPED);
    int node_id = 20;
    boolean lastTripped = false ;
    
    void setup()
    {
      gw.begin(NULL, node_id);
      dht.setup(HUMIDITY_SENSOR_DIGITAL_PIN);
    
      // Send the Sketch Version Information to the Gateway
      gw.sendSketchInfo("Humidity and motion", "1.0");
    
      pinMode(DIGITAL_INPUT_MOTION, INPUT);      // sets the motion sensor digital pin as input
    
      // Register all sensors to gw (they will be created as child devices)
      gw.present(CHILD_ID_HUM, S_HUM);
      gw.present(CHILD_ID_TEMP, S_TEMP);
      gw.present(CHILD_ID_MOT, S_MOTION);
      metric = gw.getConfig().isMetric;
    }
    
    void loop()
    {
      /* int wake;
      wake = gw.sleep(INTERRUPT, CHANGE, SLEEP_TIME);
    
       if (wake == 1) {
         Serial.println("wake by motion");
         Serial.println("reading motion");
         motion();
       }
    
       else {
         Serial.println("wake by timer");
         Serial.println("reading motion");
         motion();
         Serial.println("reading temp/hum");
         humTemp();
       }
      */
      motion();
      
      Serial.println("read temp / hum");
      humTemp();
    
      Serial.println("going to sleep now.");
      gw.sleep(INTERRUPT, CHANGE, SLEEP_TIME); //sleep a bit
    }
    
    void motion() {
      // Read digital motion value
      boolean tripped = digitalRead(DIGITAL_INPUT_MOTION);
      Serial.println(tripped);
      if (lastTripped != tripped) {
        gw.send(msgMot.set(tripped ? "1" : "0")); // Send tripped value to gw
        lastTripped = tripped;
      }
    }
    
    void humTemp() {
      gw.wait(dht.getMinimumSamplingPeriod());
    
      float temperature = dht.getTemperature();
      if (isnan(temperature)) {
        Serial.println("Failed reading temperature from DHT");
      } else if (temperature != lastTemp) {
        lastTemp = temperature;
        if (!metric) {
          temperature = dht.toFahrenheit(temperature);
        }
        gw.send(msgTemp.set(temperature, 1));
        Serial.print("T: ");
        Serial.println(temperature);
      }
    
      float humidity = dht.getHumidity();
      if (isnan(humidity)) {
        Serial.println("Failed reading humidity from DHT");
      } else if (humidity != lastHum) {
        lastHum = humidity;
        gw.send(msgHum.set(humidity, 1));
        Serial.print("H: ");
        Serial.println(humidity);
      }
    }
    

    Now, my HA config:

    homeassistant:
      # Name of the location where Home Assistant is running
      name: Home
      # Location required to calculate the time the sun rises and sets
      latitude: xxxxxxxx
      longitude: xxxxxxxxxxxxxx
      # C for Celcius, F for Fahrenheit
      temperature_unit: C
      # Pick yours from here: http://en.wikipedia.org/wiki/List_of_tz_database_time_zones
      time_zone: Europe/Brussels
    
    # View all events in a logbook
    logbook:
    
    # Checks for available updates
    updater:
    
    # Discover some devices automatically
    discovery:
    
    # Track the sun
    sun:
    
    # Allows you to issue voice commands from the frontend
    conversation:
    
    # Enables support for tracking state changes over time.
    history:
    
    # Enables the frontend
    frontend:
    
    # Show links to resources in log and frontend
    introduction:
    
    mysensors:
      gateways:
        - port: '/dev/MSgw'
      debug: true
      persistence: false
    

    and the output when starting hass:

    
    Config directory: /home/pi/.homeassistant
    WARNING:homeassistant.bootstrap:Colorlog package not found, console coloring disabled
    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.bootstrap:Home Assistant core initialized
    INFO:homeassistant.loader:Loaded logbook from homeassistant.components.logbook
    INFO:homeassistant.loader:Loaded recorder from homeassistant.components.recorder
    INFO:homeassistant.loader:Loaded http from homeassistant.components.http
    INFO:homeassistant.loader:Loaded history from homeassistant.components.history
    INFO:homeassistant.loader:Loaded introduction from homeassistant.components.introduction
    INFO:homeassistant.loader:Loaded updater from homeassistant.components.updater
    INFO:homeassistant.loader:Loaded conversation from homeassistant.components.conversation
    INFO:homeassistant.loader:Loaded discovery from homeassistant.components.discovery
    INFO:homeassistant.loader:Loaded mysensors from homeassistant.components.mysensors
    INFO:homeassistant.loader:Loaded frontend from homeassistant.components.frontend
    INFO:homeassistant.loader:Loaded api from homeassistant.components.api
    INFO:homeassistant.loader:Loaded sun from homeassistant.components.sun
    INFO:homeassistant.components.introduction:
    
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
            Hello, and welcome to Home Assistant!
    
            We'll hope that we can make all your dreams come true.
    
            Here are some resources to get started:
    
             - Configuring Home Assistant:
               https://home-assistant.io/getting-started/configuration/
    
             - Available components:
               https://home-assistant.io/components/
    
             - Troubleshooting your configuration:
               https://home-assistant.io/getting-started/troubleshooting-configuration/
    
             - Getting help:
               https://home-assistant.io/help/
    
            This message is generated by the introduction component. You can
            disable it in configuration.yaml.
    
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=introduction>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=recorder>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=http>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=logbook>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=history>
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): pypi.python.org
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=updater>
    /home/pi/.homeassistant/lib/fuzzywuzzy/fuzz.py:33: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
      warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=conversation, service=process>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=conversation>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=discovery>
    INFO:homeassistant.loader:Loaded sensor from homeassistant.components.sensor
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sensor>
    INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: discovered=, service=mysensors.sensors>
    INFO:homeassistant.loader:Loaded sensor.mysensors from homeassistant.components.sensor.mysensors
    INFO:homeassistant.loader:Loaded switch from homeassistant.components.switch
    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 component_loaded[L]: component=switch>
    INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: discovered=, service=mysensors.switches>
    INFO:homeassistant.loader:Loaded switch.mysensors from homeassistant.components.switch.mysensors
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=mysensors>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=api>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=frontend>
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): maps.googleapis.com
    INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state sun.sun=below_horizon; next_setting=16:19:22 25-01-2016, friendly_name=Sun, next_rising=07:29:47 25-01-2016, elevation=-33.1 @ 20:51:46 24-01-2016>, entity_id=sun.sun>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sun>
    INFO:homeassistant.core:Starting Home Assistant (16 threads)
    INFO:homeassistant.core:Bus:Handling <Event homeassistant_start[L]>
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=homeassistant, service=stop>
    INFO:homeassistant.components.http:Starting web interface at http://0.0.0.0:8123
    INFO:homeassistant.core:Timer:starting
    INFO:mysensors.mysensors:Trying to connect to /dev/MSgw
    INFO:homeassistant.components.http:"GET /api/stream?api_password=no_password_set&restrict=state_changed,component_loaded,service_registered HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /api/stream?api_password=no_password_set&restrict=state_changed,component_loaded,service_registered HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /api/bootstrap HTTP/1.1" 200 -
    INFO:netdisco.service:Scanning
    INFO:homeassistant.components.http:"GET /api/bootstrap HTTP/1.1" 200 -
    INFO:mysensors.mysensors:/dev/MSgw is open...
    INFO:mysensors.mysensors:Connected to /dev/MSgw
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:gateway started, id=0, parent=0, distance=0
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:54.0
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.70
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.70
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.1
    INFO:homeassistant.components.discovery:Found new service: DLNA http://192.168.1.70:1972/DeviceDescription.xml
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:53.0
    INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state sun.sun=below_horizon; next_setting=16:19:22 25-01-2016, friendly_name=Sun, next_rising=07:29:47 25-01-2016, elevation=-33.21 @ 20:51:46 24-01-2016>, entity_id=sun.sun, old_state=<state sun.sun=below_horizon; next_setting=16:19:22 25-01-2016, friendly_name=Sun, next_rising=07:29:47 25-01-2016, elevation=-33.1 @ 20:51:46 24-01-2016>>
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:54.0
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:53.0
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:54.0
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:53.0
    INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state sun.sun=below_horizon; next_setting=16:19:22 25-01-2016, friendly_name=Sun, next_rising=07:29:47 25-01-2016, elevation=-33.36 @ 20:51:46 24-01-2016>, entity_id=sun.sun, old_state=<state sun.sun=below_horizon; next_setting=16:19:22 25-01-2016, friendly_name=Sun, next_rising=07:29:47 25-01-2016, elevation=-33.21 @ 20:51:46 24-01-2016>>
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:54.0
    INFO:homeassistant.components.http:"GET /states HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /static/frontend-1003c31441ec44b3db84b49980f736a7.html HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /static/favicon-192x192.png HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /static/favicon.ico HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /api/bootstrap HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /api/stream?api_password=no_password_set&restrict=state_changed,component_loaded,service_registered HTTP/1.1" 200 -
    

    I don't get errors anymore, but nothing shows up in the web interface.
    I think the messages aren't being interpreted?

    You have to reboot your individual sensors so HA can see their Presentation message. Your output seems to be good for the gateway itself, but the gateway is not an actual "item" in HA, when it detects the sensors though, you should see their status.



  • @dels said:

    You have to reboot your individual sensors so HA can see their Presentation message. Your output seems to be good for the gateway itself, but the gateway is not an actual "item" in HA, when it detects the sensors though, you should see their status.

    It seems I did in fact forget to reboot my node when trying to include it in HA. (long day messing around with code...)
    Here is a console log from today in which I start up HA and reboot my node.
    HA receives the messages, but the node never shows up in the web interface:

    pi@raspberrypi ~ $ hass
    Config directory: /home/pi/.homeassistant
    WARNING:homeassistant.bootstrap:Colorlog package not found, console coloring disabled
    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.bootstrap:Home Assistant core initialized
    INFO:homeassistant.loader:Loaded discovery from homeassistant.components.discovery
    INFO:homeassistant.loader:Loaded introduction from homeassistant.components.introduction
    INFO:homeassistant.loader:Loaded logbook from homeassistant.components.logbook
    INFO:homeassistant.loader:Loaded recorder from homeassistant.components.recorder
    INFO:homeassistant.loader:Loaded http from homeassistant.components.http
    INFO:homeassistant.loader:Loaded conversation from homeassistant.components.conversation
    INFO:homeassistant.loader:Loaded sun from homeassistant.components.sun
    INFO:homeassistant.loader:Loaded mysensors from homeassistant.components.mysensors
    INFO:homeassistant.loader:Loaded history from homeassistant.components.history
    INFO:homeassistant.loader:Loaded frontend from homeassistant.components.frontend
    INFO:homeassistant.loader:Loaded api from homeassistant.components.api
    INFO:homeassistant.loader:Loaded updater from homeassistant.components.updater
    INFO:homeassistant.components.introduction:
    
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
            Hello, and welcome to Home Assistant!
    
            We'll hope that we can make all your dreams come true.
    
            Here are some resources to get started:
    
             - Configuring Home Assistant:
               https://home-assistant.io/getting-started/configuration/
    
             - Available components:
               https://home-assistant.io/components/
    
             - Troubleshooting your configuration:
               https://home-assistant.io/getting-started/troubleshooting-configuration/
    
             - Getting help:
               https://home-assistant.io/help/
    
            This message is generated by the introduction component. You can
            disable it in configuration.yaml.
    
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=introduction>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=recorder>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=discovery>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=http>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=logbook>
    /home/pi/.homeassistant/lib/fuzzywuzzy/fuzz.py:33: UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning
      warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning')
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=conversation, service=process>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=conversation>
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): maps.googleapis.com
    INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=sun.sun, new_state=<state sun.sun=above_horizon; next_rising=07:28:30 26-01-2016, friendly_name=Sun, next_setting=16:19:22 25-01-2016, elevation=1.59 @ 08:45:51 25-01-2016>>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sun>
    INFO:homeassistant.loader:Loaded sensor from homeassistant.components.sensor
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sensor>
    INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: service=mysensors.sensors, discovered=>
    INFO:homeassistant.loader:Loaded sensor.mysensors from homeassistant.components.sensor.mysensors
    INFO:homeassistant.loader:Loaded switch from homeassistant.components.switch
    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 component_loaded[L]: component=switch>
    INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: service=mysensors.switches, discovered=>
    INFO:homeassistant.loader:Loaded switch.mysensors from homeassistant.components.switch.mysensors
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=mysensors>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=history>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=api>
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=frontend>
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTPS connection (1): pypi.python.org
    INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=updater>
    INFO:homeassistant.core:Starting Home Assistant (16 threads)
    INFO:homeassistant.core:Bus:Handling <Event homeassistant_start[L]>
    INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: domain=homeassistant, service=stop>
    INFO:homeassistant.components.http:Starting web interface at http://0.0.0.0:8123
    INFO:mysensors.mysensors:Trying to connect to /dev/MSgw
    INFO:homeassistant.core:Timer:starting
    INFO:homeassistant.components.http:"GET /api/stream?api_password=no_password_set&restrict=state_changed,component_loaded,service_registered HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /api/stream?api_password=no_password_set&restrict=state_changed,component_loaded,service_registered HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /api/bootstrap HTTP/1.1" 200 -
    INFO:netdisco.service:Scanning
    INFO:homeassistant.components.http:"GET /api/bootstrap HTTP/1.1" 200 -
    INFO:mysensors.mysensors:/dev/MSgw is open...
    INFO:mysensors.mysensors:Connected to /dev/MSgw
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:gateway started, id=0, parent=0, distance=0
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.70
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.70
    INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.1
    INFO:homeassistant.components.discovery:Found new service: DLNA http://192.168.1.70:1972/DeviceDescription.xml
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=255,c=3,t=15,pt=2,l=2,sg=0:0
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=255,c=0,t=17,pt=0,l=5,sg=0:1.5.3
    INFO:homeassistant.components.mysensors:update sensor_update: node 20
    INFO:homeassistant.components.mysensors:No sketch_name: node 20
    INFO:homeassistant.components.mysensors:No sketch_name: node 20
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=255,c=3,t=6,pt=1,l=1,sg=0:0
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:send: 0-0-20-20 s=255,c=3,t=6,pt=0,l=1,sg=0,st=ok:M
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=255,c=3,t=11,pt=0,l=19,sg=0:Humidity and mo
    INFO:homeassistant.components.mysensors:update sensor_update: node 20
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.1
    INFO:homeassistant.components.mysensors:update sensor_update: node 20
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=0,t=7,pt=0,l=0,sg=0:
    INFO:homeassistant.components.mysensors:update sensor_update: node 20
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=1,c=0,t=6,pt=0,l=0,sg=0:
    INFO:homeassistant.components.mysensors:update sensor_update: node 20
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=2,c=0,t=1,pt=0,l=0,sg=0:
    INFO:homeassistant.components.mysensors:update sensor_update: node 20
    INFO:homeassistant.components.http:"GET /states HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /static/frontend-1003c31441ec44b3db84b49980f736a7.html HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /static/favicon-192x192.png HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /static/favicon.ico HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /api/bootstrap HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /api/stream?api_password=no_password_set&restrict=state_changed,component_loaded,service_registered HTTP/1.1" 200 -
    INFO:homeassistant.components.http:"GET /api/logbook/2016-1-25 HTTP/1.1" 200 -
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=1,c=1,t=0,pt=7,l=5,sg=0:22.0
    INFO:homeassistant.components.mysensors:update sensor_update: node 20
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=1,t=1,pt=7,l=5,sg=0:51.0
    INFO:homeassistant.components.mysensors:update sensor_update: node 20
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=2,c=1,t=16,pt=0,l=1,sg=0:1
    INFO:homeassistant.components.mysensors:update sensor_update: node 20
    INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: entity_id=sun.sun, new_state=<state sun.sun=above_horizon; next_rising=07:28:30 26-01-2016, friendly_name=Sun, next_setting=16:19:22 25-01-2016, elevation=1.67 @ 08:45:51 25-01-2016>, old_state=<state sun.sun=above_horizon; next_rising=07:28:30 26-01-2016, friendly_name=Sun, next_setting=16:19:22 25-01-2016, elevation=1.59 @ 08:45:51 25-01-2016>>
    ^CINFO:homeassistant.core:Stopping
    INFO:homeassistant.core:Bus:Handling <Event homeassistant_stop[L]>
    INFO:mysensors.mysensors:Disconnecting from /dev/MSgw
    INFO:mysensors.mysensors:Stopping thread
    INFO:homeassistant.components.recorder:Closing database
    

    This is the line when I start my node:
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=255,c=3,t=15,pt=2,l=2,sg=0:0

    Your thoughts?


  • Plugin Developer

    @BastienVH

    I can't see anything wrong in the log. You present properly and end by sending a value per sensor. The only thing is, there's no adding of the entity device in the log. Home assistant should report that in the log, when that happens: "adding new devices...".

    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=255,c=3,t=15,pt=2,l=2,sg=0:0
    

    This is an internal message of type 15: I_REQUEST_SIGNING.

    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=255,c=0,t=17,pt=0,l=5,sg=0:1.5.3
    

    This is a presentation message for node 20 of type 17: S_ARDUINO_NODE.

    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=255,c=3,t=6,pt=1,l=1,sg=0:0
    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:send: 0-0-20-20 s=255,c=3,t=6,pt=0,l=1,sg=0,st=ok:M
    

    First line is an internal message from node 20 to controller as request of type 6: I_CONFIG.
    The second line is an internal message from controller to node as response of type 6: I_CONFIG, payload:M for metric.

    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=255,c=3,t=11,pt=0,l=19,sg=0:Humidity and mo
    

    This is an internal message of type 11: I_SKETCH_NAME.

    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.1
    

    This is an internal message of type 12: I_SKETCH_VERSION.

    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=0,c=0,t=7,pt=0,l=0,sg=0:
    

    This is a presentation message for sensor 0 of type 7: S_HUM.

    Then you have presentation messages for sensor 1 of type 6 and for sensor 2 of type 1.
    See the API to figure those out:
    https://www.mysensors.org/download/serial_api_15

    The last three messages are reporting sensor values:

    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 20-20-0 s=1,c=1,t=0,pt=7,l=5,sg=0:22.0
    

    This is a set message for sensor 1 of type 0: V_TEMP, payload: 22.0.

    The other two are set messages for sensor 0 of type 1 and sensor 2 of type 16.

    Maybe you can try everything again. Did you disable persistence? I think it's good to have it disabled, until you know everything is working, then you can activate persistence and do the presentation a final time. Remember to delete the persistence file if you have an old one, first though.

    Edit:
    There's a bug in home assistant version 0.11.1, which makes it impossible to load devices on the fly. A workaround is to enable persistence, present the sensors and send a value per sensor and then restart home assistant. After the restart the sensors should show up in the gui.


  • Plugin Developer

    @BastienVH

    We've been troubleshooting this in the other thread, and there seems to be a problem in the code somewhere. See this post for a workaround:

    http://forum.mysensors.org/topic/2831/home-assistant-v-0-11-1-with-switch-support/45

    Edit:
    The bug is found, and there will be a fix.



  • @martinhjelmare
    Thanks for the heads up!
    After following the steps there, I get my node up and running.
    Thanks for the help!


Log in to reply
 

Suggested Topics

  • 1
  • 17
  • 1
  • 5
  • 3

1
Online

11.4k
Users

11.1k
Topics

112.7k
Posts