Home Assistant - How to recognize MySensors nodes
-
@drock1985 said:
Would it be possible to get a Home-Assistant dedicated sub-forum please?
You got it.
http://forum.mysensors.org/category/28/home-assistant -
Thanks @hek very appreciated.
EDIT: Sort of ran into an issue with the Dev MQTTW5100Gateway sketch.... Thought the output I was getting above was good, but in reality the Arduino IDE wasn't giving an error. I decided to run the gateway in my RPI and view the data through SSH via screen. It initializes and shows the same data as the Arduino IDE, but then seconds later it dies and gives an error about screen terminating. Happens every time.
Going to try the ESP8266MQTTGateway: I'm got a hunch.
-
I've been trying to get MQTT working using the Dev branch here (http://forum.mysensors.org/topic/2352/guide-setting-up-and-testing-mqtt-client-gateway/) and have my configuration.yaml file looking like this for my W5100MQTT broker:
#MySensors MQTT Test mqtt 1: broker: 192.168.86.198 port: 1883 # client_id: home-assistant-1 keepalive: 60 # username: USERNAME # password: PASSWORDThe Serial output from Arduino shows that I connected successfully
0;0;3;0;9;Starting gateway (RNNGA-, 1.6.0-beta) 0;0;3;0;9;Radio init successful. IP: 192.168.86.112 0;0;3;0;9;Attempting MQTT connection... 0;0;3;0;9;MQTT connected 0;0;3;0;9;Init complete, id=0, parent=0, distance=0But, Home-Assistant isn't registering the broker, and I have this error in the Dev section:
15-12-15 15:32:17 homeassistant.components.mqtt: Missing required configuration items in mqtt: broker 15-12-15 15:32:17 homeassistant.bootstrap: component mqtt failed to initializeDoes anyone have any ideas? @humblehacker @martinhjelmare @hek ?
@drock1985 said:
I've been trying to get MQTT working using the Dev branch here (http://forum.mysensors.org/topic/2352/guide-setting-up-and-testing-mqtt-client-gateway/) and have my configuration.yaml file looking like this for my W5100MQTT broker:
#MySensors MQTT Test mqtt 1: broker: 192.168.86.198 port: 1883 # client_id: home-assistant-1 keepalive: 60 # username: USERNAME # password: PASSWORDDoes anyone have any ideas? @humblehacker @martinhjelmare @hek ?
Does the IP address you defined in the config.yaml point to your Mosquitto Broker or the Arduino-Ethernet Shield? If it points to the Arduino afaik the point of the MQTTCLIENT Gateway is that it can be run as a client if you've already got a Mosquitto broker. Otherwise you would either need to remove mosquitto or forward it to a different port than the default 1883. If this was the case then HASS would be looking for a broker where none exists which is why it is missing configuration items...
-
For the time being, I'm thinking of taking a different approach with my toggle switch... I'm thinking of simply defining the button output as a binary sensor which can then toggle between two predefined scenes. At least in my case, input only needs to go in one direction so there's no need to receive any data from the controller....
-
For the time being, I'm thinking of taking a different approach with my toggle switch... I'm thinking of simply defining the button output as a binary sensor which can then toggle between two predefined scenes. At least in my case, input only needs to go in one direction so there's no need to receive any data from the controller....
FYI, my fifo_queue pull request has been merged with dev branch at pymysensors, so I'm hoping to be able to implement switch support for the mysensors component in homeassistant very soon.
-
FYI, my fifo_queue pull request has been merged with dev branch at pymysensors, so I'm hoping to be able to implement switch support for the mysensors component in homeassistant very soon.
@martinhjelmare said:
FYI, my fifo_queue pull request has been merged with dev branch at pymysensors, so I'm hoping to be able to implement switch support for the mysensors component in homeassistant very soon.
Thats great news! That should be a huge help with my plans for building an RGB Lighting controller based on the rotary_led_dimmer sketch! If I can ever figure out how to implement a simple toggle switch first...
-
@drock1985 said:
I've been trying to get MQTT working using the Dev branch here (http://forum.mysensors.org/topic/2352/guide-setting-up-and-testing-mqtt-client-gateway/) and have my configuration.yaml file looking like this for my W5100MQTT broker:
#MySensors MQTT Test mqtt 1: broker: 192.168.86.198 port: 1883 # client_id: home-assistant-1 keepalive: 60 # username: USERNAME # password: PASSWORDDoes anyone have any ideas? @humblehacker @martinhjelmare @hek ?
Does the IP address you defined in the config.yaml point to your Mosquitto Broker or the Arduino-Ethernet Shield? If it points to the Arduino afaik the point of the MQTTCLIENT Gateway is that it can be run as a client if you've already got a Mosquitto broker. Otherwise you would either need to remove mosquitto or forward it to a different port than the default 1883. If this was the case then HASS would be looking for a broker where none exists which is why it is missing configuration items...
@humblehacker said:
k
@humblehacker said:
@drock1985 said:
I've been trying to get MQTT working using the Dev branch here (http://forum.mysensors.org/topic/2352/guide-setting-up-and-testing-mqtt-client-gateway/) and have my configuration.yaml file looking like this for my W5100MQTT broker:
#MySensors MQTT Test mqtt 1: broker: 192.168.86.198 port: 1883 # client_id: home-assistant-1 keepalive: 60 # username: USERNAME # password: PASSWORDDoes anyone have any ideas? @humblehacker @martinhjelmare @hek ?
Does the IP address you defined in the config.yaml point to your Mosquitto Broker or the Arduino-Ethernet Shield? If it points to the Arduino afaik the point of the MQTTCLIENT Gateway is that it can be run as a client if you've already got a Mosquitto broker. Otherwise you would either need to remove mosquitto or forward it to a different port than the default 1883. If this was the case then HASS would be looking for a broker where none exists which is why it is missing configuration items...
The configuration.yaml file I have pointed back to the local IP address, since Mosquitto and Home-Assistant are running on the same Pi.
So, you are saying that it should really be pointed back to the MQTT Gateway then? Still confusing to me.
-
Never mind then... As long as your using Mosquitto as your broker and the MQTT CLIENT Gateway (from the development branch) rather than the default MQTT Gateway sketch from- http://www.mysensors.org/build/mqtt_gateway then none of my earlier comments should apply... Basically I was saying that the default MYSensors MQTT Gateway is set up to function as a broker and would therefore conflict with any Mosquitto server running on the same port. The MQTT CLIENT Gateway (emphasis on CLIENT) from the development branch isnt set up as a broker so it shouldnt conflict with a Mosquitto installation.
-
It's still important to be wary about which ip address you assign where, so I think it was a good point.
-
Hey @martinhjelmare , I see HA was updated today; did your commits get added?
-
Hey @martinhjelmare , I see HA was updated today; did your commits get added?
Hi!
No, I've submitted a pull request, but I need to fix some things, and maybe change some of it. But hopefully it wont take too long.
-
I have been trying to set up a switch in home assistant but I have had no luck in getting it to show up in the dashboard. I am using @martinhjelmare mysensors-component-switch branch of home assistant and the following sketch. Does anyone have any idea why this is happening? ```
/** * 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 * Example sketch showing how to control physical relays. * This example will remember relay state after power failure. * http://www.mysensors.org/build/relay */ #include <MySigningNone.h> #include <MyTransportNRF24.h> #include <MyTransportRFM69.h> #include <MyHwATMega328.h> #include <MySensor.h> #include <SPI.h> #define RELAY_1 3 // Arduino Digital I/O pin number for first relay (second on pin+1 etc) #define NUMBER_OF_RELAYS 1 // Total number of attached relays #define RELAY_ON 1 // GPIO value to write to turn on attached relay #define RELAY_OFF 0 // GPIO value to write to turn off attached relay // NRFRF24L01 radio driver (set low transmit power by default) MyTransportNRF24 radio(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW); //MyTransportRFM69 radio; // Message signing driver (none default) //MySigningNone signer; // Select AtMega328 hardware profile MyHwATMega328 hw; // Construct MySensors library MySensor gw(radio, hw); MyMessage lightMsg(RELAY_1, S_LIGHT); void setup() { // Initialize library and add callback for incoming messages gw.begin(incomingMessage, AUTO, true); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("Relay", "1.0"); // Fetch relay status for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) { // Register all sensors to gw (they will be created as child devices) gw.present(sensor, S_LIGHT); // Then set relay pins in output mode pinMode(pin, OUTPUT); // Set relay to last known state (using eeprom storage) digitalWrite(pin, gw.loadState(sensor)?RELAY_ON:RELAY_OFF); } gw.send(lightMsg.set("0")); } void loop() { // Alway process incoming messages whenever possible gw.process(); } void incomingMessage(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.type==V_LIGHT) { // Change relay state digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF); // Store state in eeprom gw.saveState(message.sensor, message.getBool()); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); } } -
I have been trying to set up a switch in home assistant but I have had no luck in getting it to show up in the dashboard. I am using @martinhjelmare mysensors-component-switch branch of home assistant and the following sketch. Does anyone have any idea why this is happening? ```
/** * 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 * Example sketch showing how to control physical relays. * This example will remember relay state after power failure. * http://www.mysensors.org/build/relay */ #include <MySigningNone.h> #include <MyTransportNRF24.h> #include <MyTransportRFM69.h> #include <MyHwATMega328.h> #include <MySensor.h> #include <SPI.h> #define RELAY_1 3 // Arduino Digital I/O pin number for first relay (second on pin+1 etc) #define NUMBER_OF_RELAYS 1 // Total number of attached relays #define RELAY_ON 1 // GPIO value to write to turn on attached relay #define RELAY_OFF 0 // GPIO value to write to turn off attached relay // NRFRF24L01 radio driver (set low transmit power by default) MyTransportNRF24 radio(RF24_CE_PIN, RF24_CS_PIN, RF24_PA_LEVEL_GW); //MyTransportRFM69 radio; // Message signing driver (none default) //MySigningNone signer; // Select AtMega328 hardware profile MyHwATMega328 hw; // Construct MySensors library MySensor gw(radio, hw); MyMessage lightMsg(RELAY_1, S_LIGHT); void setup() { // Initialize library and add callback for incoming messages gw.begin(incomingMessage, AUTO, true); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("Relay", "1.0"); // Fetch relay status for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) { // Register all sensors to gw (they will be created as child devices) gw.present(sensor, S_LIGHT); // Then set relay pins in output mode pinMode(pin, OUTPUT); // Set relay to last known state (using eeprom storage) digitalWrite(pin, gw.loadState(sensor)?RELAY_ON:RELAY_OFF); } gw.send(lightMsg.set("0")); } void loop() { // Alway process incoming messages whenever possible gw.process(); } void incomingMessage(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.type==V_LIGHT) { // Change relay state digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF); // Store state in eeprom gw.saveState(message.sensor, message.getBool()); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); } }Hi!
First of all my branch is still under development, and right now I think there is a bug, which could make it unable to install. I'll have more time to fix things next week.
How does your home assistant config for mysensors look like?
Have you looked at the logs of home assistant after start?
-
Hey Martin, this is my config for the mysensors component
mysensors: gateways: port: '/dev/ttyUSB0' persistance_file: '/home/pi/.homeassistant/mysensors.json' debug: true persistance: true version: '1.5' sensor: platform: mysensors switch: platform: mysensorsHere is the log after start
(hass-test)pi@raspberrypi:~/.homeassistant $ 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]: service=turn_off, domain=homea ssistant> INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=turn_on, domain=homeas sistant> INFO:homeassistant.bootstrap:Home Assistant core initialized INFO:homeassistant.loader:Loaded switch from homeassistant.components.switch INFO:homeassistant.loader:Loaded discovery from homeassistant.components.discovery INFO:homeassistant.loader:Loaded conversation from homeassistant.components.conversation INFO:homeassistant.loader:Loaded sensor from homeassistant.components.sensor INFO:homeassistant.loader:Loaded history from homeassistant.components.history INFO:homeassistant.loader:Loaded recorder from homeassistant.components.recorder INFO:homeassistant.loader:Loaded http from homeassistant.components.http INFO:homeassistant.loader:Loaded logbook from homeassistant.components.logbook INFO:homeassistant.loader:Loaded sun from homeassistant.components.sun 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 updater from homeassistant.components.updater INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=recorder> INFO:homeassistant.loader:Loaded switch.mysensors from homeassistant.components.switch.mysensors INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=turn_off, domain=switc h> INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=turn_on, domain=switch > INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=switch> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=discovery> /home/pi/.homeassistant/lib/fuzzywuzzy/fuzz.py:33: UserWarning: Using slow pure-python SequenceMa tcher. Install python-Levenshtein to remove this warning warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove thi s warning') INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=process, domain=conver sation> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=conversation> INFO:homeassistant.loader:Loaded sensor.mysensors from homeassistant.components.sensor.mysensors INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sensor> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=http> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=history> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=logbook> INFO:urllib3.connectionpool:Starting new HTTP connection (1): maps.googleapis.com INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state sun.sun=above_hori zon; friendly_name=Sun, next_rising=03:32:34 08-01-2016, next_setting=15:36:03 07-01-2016, elevat ion=47.84 @ 14:58:04 07-01-2016>, entity_id=sun.sun> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sun> INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: service=mysensors.sensors, di scovered=> INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: service=mysensors.switches, d iscovered=> 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:urllib3.connectionpool:Starting new HTTPS connection (1): pypi.python.org INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state updater.updater=0. 10.1; friendly_name=Update Available @ 14:58:06 07-01-2016>, entity_id=updater.updater> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=updater> INFO:homeassistant.core:Starting Home Assistant (15 threads) INFO:homeassistant.core:Bus:Handling <Event homeassistant_start[L]> INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=stop, domain=homeassis tant> INFO:mysensors.mysensors:Trying to connect to /dev/ttyUSB0 INFO:homeassistant.core:Timer:starting INFO:homeassistant.components.mysensors:update persistence: node 1 INFO:homeassistant.components.http:Starting web interface at http://0.0.0.0:8123 INFO:netdisco.service:Scanning INFO:mysensors.mysensors:/dev/ttyUSB0 is open... INFO:mysensors.mysensors:Connected to /dev/ttyUSB0 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: 1-1-0 s=255,c=0,t=18,pt=0,l=5,sg=0:1.5.1 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-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-1-1 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: 1-1-0 s=255,c=3,t=11,pt=0,l=5,sg=0:Relay INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.0 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=1,c=0,t=3,pt=0,l=0,sg=0: INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=3,c=1,t=3,pt=0,l=1,sg=0:0 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.1 INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state sun.sun=above_hori zon; friendly_name=Sun, next_rising=03:32:34 08-01-2016, next_setting=15:36:03 07-01-2016, elevat ion=47.76 @ 14:58:04 07-01-2016>, old_state=<state sun.sun=above_horizon; friendly_name=Sun, next _rising=03:32:34 08-01-2016, next_setting=15:36:03 07-01-2016, elevation=47.84 @ 14:58:04 07-01-2 016>, entity_id=sun.sun> -
Hey Martin, this is my config for the mysensors component
mysensors: gateways: port: '/dev/ttyUSB0' persistance_file: '/home/pi/.homeassistant/mysensors.json' debug: true persistance: true version: '1.5' sensor: platform: mysensors switch: platform: mysensorsHere is the log after start
(hass-test)pi@raspberrypi:~/.homeassistant $ 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]: service=turn_off, domain=homea ssistant> INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=turn_on, domain=homeas sistant> INFO:homeassistant.bootstrap:Home Assistant core initialized INFO:homeassistant.loader:Loaded switch from homeassistant.components.switch INFO:homeassistant.loader:Loaded discovery from homeassistant.components.discovery INFO:homeassistant.loader:Loaded conversation from homeassistant.components.conversation INFO:homeassistant.loader:Loaded sensor from homeassistant.components.sensor INFO:homeassistant.loader:Loaded history from homeassistant.components.history INFO:homeassistant.loader:Loaded recorder from homeassistant.components.recorder INFO:homeassistant.loader:Loaded http from homeassistant.components.http INFO:homeassistant.loader:Loaded logbook from homeassistant.components.logbook INFO:homeassistant.loader:Loaded sun from homeassistant.components.sun 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 updater from homeassistant.components.updater INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=recorder> INFO:homeassistant.loader:Loaded switch.mysensors from homeassistant.components.switch.mysensors INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=turn_off, domain=switc h> INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=turn_on, domain=switch > INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=switch> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=discovery> /home/pi/.homeassistant/lib/fuzzywuzzy/fuzz.py:33: UserWarning: Using slow pure-python SequenceMa tcher. Install python-Levenshtein to remove this warning warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove thi s warning') INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=process, domain=conver sation> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=conversation> INFO:homeassistant.loader:Loaded sensor.mysensors from homeassistant.components.sensor.mysensors INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sensor> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=http> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=history> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=logbook> INFO:urllib3.connectionpool:Starting new HTTP connection (1): maps.googleapis.com INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state sun.sun=above_hori zon; friendly_name=Sun, next_rising=03:32:34 08-01-2016, next_setting=15:36:03 07-01-2016, elevat ion=47.84 @ 14:58:04 07-01-2016>, entity_id=sun.sun> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sun> INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: service=mysensors.sensors, di scovered=> INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: service=mysensors.switches, d iscovered=> 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:urllib3.connectionpool:Starting new HTTPS connection (1): pypi.python.org INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state updater.updater=0. 10.1; friendly_name=Update Available @ 14:58:06 07-01-2016>, entity_id=updater.updater> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=updater> INFO:homeassistant.core:Starting Home Assistant (15 threads) INFO:homeassistant.core:Bus:Handling <Event homeassistant_start[L]> INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=stop, domain=homeassis tant> INFO:mysensors.mysensors:Trying to connect to /dev/ttyUSB0 INFO:homeassistant.core:Timer:starting INFO:homeassistant.components.mysensors:update persistence: node 1 INFO:homeassistant.components.http:Starting web interface at http://0.0.0.0:8123 INFO:netdisco.service:Scanning INFO:mysensors.mysensors:/dev/ttyUSB0 is open... INFO:mysensors.mysensors:Connected to /dev/ttyUSB0 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: 1-1-0 s=255,c=0,t=18,pt=0,l=5,sg=0:1.5.1 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-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-1-1 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: 1-1-0 s=255,c=3,t=11,pt=0,l=5,sg=0:Relay INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.0 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=1,c=0,t=3,pt=0,l=0,sg=0: INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=3,c=1,t=3,pt=0,l=1,sg=0:0 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.1 INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state sun.sun=above_hori zon; friendly_name=Sun, next_rising=03:32:34 08-01-2016, next_setting=15:36:03 07-01-2016, elevat ion=47.76 @ 14:58:04 07-01-2016>, old_state=<state sun.sun=above_horizon; friendly_name=Sun, next _rising=03:32:34 08-01-2016, next_setting=15:36:03 07-01-2016, elevation=47.84 @ 14:58:04 07-01-2 016>, entity_id=sun.sun>The error is in your sketch. When you declare your message you should use child sensor id as first argument. Now you're using the pin number. So then you're sending the value from a child which hasn't been presented to home assistant.
MyMessage msg(child-sensor-id, variable-type); -
Hey Martin, this is my config for the mysensors component
mysensors: gateways: port: '/dev/ttyUSB0' persistance_file: '/home/pi/.homeassistant/mysensors.json' debug: true persistance: true version: '1.5' sensor: platform: mysensors switch: platform: mysensorsHere is the log after start
(hass-test)pi@raspberrypi:~/.homeassistant $ 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]: service=turn_off, domain=homea ssistant> INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=turn_on, domain=homeas sistant> INFO:homeassistant.bootstrap:Home Assistant core initialized INFO:homeassistant.loader:Loaded switch from homeassistant.components.switch INFO:homeassistant.loader:Loaded discovery from homeassistant.components.discovery INFO:homeassistant.loader:Loaded conversation from homeassistant.components.conversation INFO:homeassistant.loader:Loaded sensor from homeassistant.components.sensor INFO:homeassistant.loader:Loaded history from homeassistant.components.history INFO:homeassistant.loader:Loaded recorder from homeassistant.components.recorder INFO:homeassistant.loader:Loaded http from homeassistant.components.http INFO:homeassistant.loader:Loaded logbook from homeassistant.components.logbook INFO:homeassistant.loader:Loaded sun from homeassistant.components.sun 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 updater from homeassistant.components.updater INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=recorder> INFO:homeassistant.loader:Loaded switch.mysensors from homeassistant.components.switch.mysensors INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=turn_off, domain=switc h> INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=turn_on, domain=switch > INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=switch> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=discovery> /home/pi/.homeassistant/lib/fuzzywuzzy/fuzz.py:33: UserWarning: Using slow pure-python SequenceMa tcher. Install python-Levenshtein to remove this warning warnings.warn('Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove thi s warning') INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=process, domain=conver sation> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=conversation> INFO:homeassistant.loader:Loaded sensor.mysensors from homeassistant.components.sensor.mysensors INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sensor> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=http> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=history> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=logbook> INFO:urllib3.connectionpool:Starting new HTTP connection (1): maps.googleapis.com INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state sun.sun=above_hori zon; friendly_name=Sun, next_rising=03:32:34 08-01-2016, next_setting=15:36:03 07-01-2016, elevat ion=47.84 @ 14:58:04 07-01-2016>, entity_id=sun.sun> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=sun> INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: service=mysensors.sensors, di scovered=> INFO:homeassistant.core:Bus:Handling <Event platform_discovered[L]: service=mysensors.switches, d iscovered=> 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:urllib3.connectionpool:Starting new HTTPS connection (1): pypi.python.org INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state updater.updater=0. 10.1; friendly_name=Update Available @ 14:58:06 07-01-2016>, entity_id=updater.updater> INFO:homeassistant.core:Bus:Handling <Event component_loaded[L]: component=updater> INFO:homeassistant.core:Starting Home Assistant (15 threads) INFO:homeassistant.core:Bus:Handling <Event homeassistant_start[L]> INFO:homeassistant.core:Bus:Handling <Event service_registered[L]: service=stop, domain=homeassis tant> INFO:mysensors.mysensors:Trying to connect to /dev/ttyUSB0 INFO:homeassistant.core:Timer:starting INFO:homeassistant.components.mysensors:update persistence: node 1 INFO:homeassistant.components.http:Starting web interface at http://0.0.0.0:8123 INFO:netdisco.service:Scanning INFO:mysensors.mysensors:/dev/ttyUSB0 is open... INFO:mysensors.mysensors:Connected to /dev/ttyUSB0 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: 1-1-0 s=255,c=0,t=18,pt=0,l=5,sg=0:1.5.1 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-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-1-1 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: 1-1-0 s=255,c=3,t=11,pt=0,l=5,sg=0:Relay INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.0 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=1,c=0,t=3,pt=0,l=0,sg=0: INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=3,c=1,t=3,pt=0,l=1,sg=0:0 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.1 INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state sun.sun=above_hori zon; friendly_name=Sun, next_rising=03:32:34 08-01-2016, next_setting=15:36:03 07-01-2016, elevat ion=47.76 @ 14:58:04 07-01-2016>, old_state=<state sun.sun=above_horizon; friendly_name=Sun, next _rising=03:32:34 08-01-2016, next_setting=15:36:03 07-01-2016, elevation=47.84 @ 14:58:04 07-01-2 016>, entity_id=sun.sun>Btw, you can remove sensor/switch platform mysensors in your config, if using the latest version of my branch.
Everything else looks good in the config and the log, what I can tell.
-
OK I have tried this but I'm am still having no luck, thank you for the quick replies.
void setup() { // Initialize library and add callback for incoming messages gw.begin(incomingMessage, 1, true); // Send the sketch version information to the gateway and Controller gw.sendSketchInfo("Relay", "1.0"); // Fetch relay status for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS;sensor++, pin++) { // Register all sensors to gw (they will be created as child devices) gw.present(sensor, S_LIGHT); MyMessage lightMsg(sensor, S_LIGHT); // Then set relay pins in output mode pinMode(pin, OUTPUT); // Set relay to last known state (using eeprom storage) digitalWrite(pin, gw.loadState(sensor)?RELAY_ON:RELAY_OFF); gw.send(lightMsg.set("0")); } } -
Here is the part of the log
INFO:mysensors.mysensors:/dev/ttyUSB0 is open... INFO:mysensors.mysensors:Connected to /dev/ttyUSB0 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:gateway started, id=0, parent=0, distance=0 INFO:urllib3.connectionpool:Starting new HTTP connection (1): 192.168.1.1 INFO:urllib3.connectionpool:Starting new HTTPS connection (1): 192.168.1.29 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=0,t=18,pt=0,l=5,sg=0:1.5.1 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:homeassistant.components.mysensors:No sketch_name: node 1 INFO:homeassistant.components.mysensors:No sketch_name: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-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-1-1 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: 1-1-0 s=255,c=3,t=11,pt=0,l=5,sg=0:Relay INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=255,c=3,t=12,pt=0,l=3,sg=0:1.0 INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=1,c=0,t=3,pt=0,l=0,sg=0: INFO:homeassistant.components.mysensors:update sensor_update: node 1 INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=1,c=1,t=2,pt=0,l=1,sg=0:0 INFO:homeassistant.components.mysensors:update sensor_update: node 1