Skip to content
  • 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. Error using Home Assistant with a serial gateway
  • Getting Started
  • Controller
  • Build
  • Hardware
  • Download/API
  • Forum
  • Store

Error using Home Assistant with a serial gateway

Scheduled Pinned Locked Moved Home Assistant
21 Posts 3 Posters 9.0k Views 2 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.
  • B BastienVH

    @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?

    martinhjelmareM Offline
    martinhjelmareM Offline
    martinhjelmare
    Plugin Developer
    wrote on last edited by martinhjelmare
    #12

    @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.

    B 1 Reply Last reply
    0
    • martinhjelmareM martinhjelmare

      @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.

      B Offline
      B Offline
      BastienVH
      wrote on last edited by
      #13

      @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...

      martinhjelmareM 1 Reply Last reply
      0
      • B BastienVH

        @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...

        martinhjelmareM Offline
        martinhjelmareM Offline
        martinhjelmare
        Plugin Developer
        wrote on last edited by
        #14
        This post is deleted!
        martinhjelmareM 1 Reply Last reply
        0
        • martinhjelmareM martinhjelmare

          This post is deleted!

          martinhjelmareM Offline
          martinhjelmareM Offline
          martinhjelmare
          Plugin Developer
          wrote on last edited by
          #15

          @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.

          B 1 Reply Last reply
          0
          • martinhjelmareM martinhjelmare

            @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.

            B Offline
            B Offline
            BastienVH
            wrote on last edited by
            #16

            @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?

            delsD 1 Reply Last reply
            0
            • B BastienVH

              @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?

              delsD Offline
              delsD Offline
              dels
              wrote on last edited by
              #17

              @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.

              B 1 Reply Last reply
              1
              • delsD dels

                @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.

                B Offline
                B Offline
                BastienVH
                wrote on last edited by
                #18

                @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?

                martinhjelmareM 2 Replies Last reply
                0
                • B BastienVH

                  @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?

                  martinhjelmareM Offline
                  martinhjelmareM Offline
                  martinhjelmare
                  Plugin Developer
                  wrote on last edited by martinhjelmare
                  #19

                  @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.

                  1 Reply Last reply
                  0
                  • B BastienVH

                    @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?

                    martinhjelmareM Offline
                    martinhjelmareM Offline
                    martinhjelmare
                    Plugin Developer
                    wrote on last edited by martinhjelmare
                    #20

                    @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.

                    B 1 Reply Last reply
                    0
                    • martinhjelmareM martinhjelmare

                      @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.

                      B Offline
                      B Offline
                      BastienVH
                      wrote on last edited by
                      #21

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

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


                      17

                      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
                      • OpenHardware.io
                      • Categories
                      • Recent
                      • Tags
                      • Popular