Well, turns out it was defective hardware... I replaced both the arduino and the comm module and all works well!
Posts made by dels
-
RE: Repeater node not picking up?
-
Repeater node not picking up?
Hello all,
I recently moved my outside temp/humidity sensor from the front of the house to the back and noticed that the radio is not strong enough to go through the whole house from the new location so I created a repeater node which I placed inside the house literally just in front of the outside sensor, just with the wall in between.
When I boot the repeater node, I can see it present itself to the gw, but the only way for me to see the sensor node is to boot it from within the gw range.
I have forced the ID on both the repeater node (252) and the sensor node (21, the ID it gets from the gw when booted with auto id mode), and I still cannot get the sensor data.
Any idea?
Thanks!
** EDIT ** I tried forcing the parent ID and literally put the two boxes on top of each other and no luck, seems like the repeater is not doing anything but presenting itself...
Also, using MS1.5
-
RE: Error using Home Assistant with a serial gateway
@BastienVH said:
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.
-
RE: Error using Home Assistant with a serial gateway
@dels said:
@BastienVH said:
Hi Martin,
@martinhjelmare
I've been trying the last couple of days to get it working, but to no avail...I stell get errors like
ValueError: need more than 1 value to unpack
The number can change though.
I've tried your suggestions, updated and rebooted the pi but still no luck.
Uninstalled and reinstalled home assistant but that also didn't help.Any other things I could try?
I have been getting the same thing... it worked on one occasion where it was able to load, but I didnt know the sensors had to "present" themselves at that time... so I made some research, restarted HA, rebooted the pi, disconnected the serial gw... I have been trying at least 25 times since and now I am always getting this:
16-01-23 14:32:29 homeassistant.bootstrap: Error during setup of component mysensors Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 98, in _setup_component if not component.setup(hass, config): File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 124, in setup port, persistence, persistence_file, version) File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 90, in setup_gateway protocol_version=version) File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 261, in __init__ persistence_file, protocol_version) File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 33, in __init__ self._load_sensors() File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 153, in _load_sensors self._perform_file_action(self.persistence_file, 'load') File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 167, in _perform_file_action fn(filename) File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 136, in _load_json self.sensors = json.load(f, cls=MySensorsJSONDecoder) File "/usr/lib/python3.4/json/__init__.py", line 268, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/usr/lib/python3.4/json/__init__.py", line 331, in loads return cls(**kw).decode(s) File "/usr/lib/python3.4/json/decoder.py", line 343, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.4/json/decoder.py", line 361, in raw_decode raise ValueError(errmsg("Expecting value", s, err.value)) from None ValueError: Expecting value: line 1 column 1 (char 0)
Any help appreciated
Thanks,
dels
Well... I feel stupid. I had completely forgotten that I had a Domoticz installed back a few weeks back when I first started searching for the right controller and it restarted when I rebooted the server... when I saw it was loaded, I shut it down and disabled it... then restarted home-assistant, which loaded mysensors perfectly and discovered the PIR sensor as soon as I reconnected it (after the mysensors component was loaded in HA). My guess is it loaded before HA and had dibs on the serial port or something...
I hope it helps someone else!
-
RE: Error using Home Assistant with a serial gateway
@BastienVH said:
Hi Martin,
@martinhjelmare
I've been trying the last couple of days to get it working, but to no avail...I stell get errors like
ValueError: need more than 1 value to unpack
The number can change though.
I've tried your suggestions, updated and rebooted the pi but still no luck.
Uninstalled and reinstalled home assistant but that also didn't help.Any other things I could try?
I have been getting the same thing... it worked on one occasion where it was able to load, but I didnt know the sensors had to "present" themselves at that time... so I made some research, restarted HA, rebooted the pi, disconnected the serial gw... I have been trying at least 25 times since and now I am always getting this:
16-01-23 14:32:29 homeassistant.bootstrap: Error during setup of component mysensors Traceback (most recent call last): File "/usr/local/lib/python3.4/dist-packages/homeassistant/bootstrap.py", line 98, in _setup_component if not component.setup(hass, config): File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 124, in setup port, persistence, persistence_file, version) File "/usr/local/lib/python3.4/dist-packages/homeassistant/components/mysensors.py", line 90, in setup_gateway protocol_version=version) File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 261, in __init__ persistence_file, protocol_version) File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 33, in __init__ self._load_sensors() File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 153, in _load_sensors self._perform_file_action(self.persistence_file, 'load') File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 167, in _perform_file_action fn(filename) File "/home/pi/.homeassistant/lib/mysensors/mysensors.py", line 136, in _load_json self.sensors = json.load(f, cls=MySensorsJSONDecoder) File "/usr/lib/python3.4/json/__init__.py", line 268, in load parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw) File "/usr/lib/python3.4/json/__init__.py", line 331, in loads return cls(**kw).decode(s) File "/usr/lib/python3.4/json/decoder.py", line 343, in decode obj, end = self.raw_decode(s, idx=_w(s, 0).end()) File "/usr/lib/python3.4/json/decoder.py", line 361, in raw_decode raise ValueError(errmsg("Expecting value", s, err.value)) from None ValueError: Expecting value: line 1 column 1 (char 0)
Any help appreciated
Thanks,
dels