Problem with mysensors in 0.52.0

Firstly, thank you very much to all who have put in so much work to Home Assistant, Mysensors and everything else.

Since the update to 0.52, I’ve lost all my mysensors sensors. I’ve searched the forum and read a couple of other topics that seem very related but I haven’t been able to solve it. It looks to me to be something to do with the new message validation, but I haven’t been able to work it out. The protocol version isn’t null, and I have one value reported per child ID. To help testing, I’ve removed everything except the gateway (serial) that also has a temperature sensor attached, and this doesn’t get added either. I’ve removed mysensors.json to try to start again.

I’ve read through the serial api of mysensors, and as far as I can tell the mesages look correct.

This is the mysensors part of my configuration.yaml:

mysensors:
  gateways:
    device: '/dev/ttyACM0'
    persistence_file: '/var/lib/hass/mysensors.json'
    baud_rate: 115200
  optimistic: false
  persistence: true
  retain: true
  version: 2.0

This is the gateway sketch:

#define MY_DEBUG

// Define node ID
#define MY_NODE_ID 0

// Enable and select radio type attached
#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69

#define MY_SIGNING_SOFT
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
#define MY_SIGNING_REQUEST_SIGNATURES

// Enable serial gateway
#define MY_GATEWAY_SERIAL

// Define a lower baud rate for Arduino's running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
#if F_CPU == 8000000L
#define MY_BAUD_RATE 38400
#endif

// Flash leds on rx/tx/err
// Uncomment to override default HW configurations
#define MY_DEFAULT_ERR_LED_PIN 4  // Error led pin
#define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
#define MY_DEFAULT_TX_LED_PIN  5  // the PCB, on board LED

#include <MySensors.h>
#include <DallasTemperature.h>
#include <OneWire.h>

// Send temperature only if changed? 1 = Yes 0 = No
#define COMPARE_TEMP 1

// Pin where dallas sensor is connected 
#define ONE_WIRE_BUS 2 

// Sleep time between reads (in milliseconds)
unsigned long SLEEP_TIME = 60000; 

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS); 

// Pass the oneWire reference to Dallas Temperature. 
DallasTemperature sensors(&oneWire); 

// arrays to hold device address
DeviceAddress insideThermometer;

#define CHILD_ID_TEMP 0

float lastTemperature;

// Initialize temperature message
MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);


void setup()
{
  sensors.begin();
  if (!sensors.getAddress(insideThermometer, 0)) Serial.println("Unable to find address for Device 0"); 

  // set the resolution to 12 bit (Each Dallas/Maxim device is capable of several different resolutions)
  sensors.setResolution(insideThermometer, 12);
 
  Serial.print("Device 0 Resolution: ");
  Serial.print(sensors.getResolution(insideThermometer), DEC); 
  Serial.println();
}

void presentation()
{
   // Present locally attached sensors
   // Send the sketch version information to the gateway and Controller
  sendSketchInfo("Gateway Temp", "1.2");

  // Present all sensors to controller
  present(CHILD_ID_TEMP, S_TEMP);
}

void loop()
{
	// Send locally attached sensor data here
 // Fetch temperatures from Dallas sensors
  sensors.requestTemperatures();
  
  float temp = sensors.getTempC(insideThermometer); 

  // Only send data if temperature has changed and no error
  #if COMPARE_TEMP == 1
  if (lastTemperature != temp && temp != -127.00 && temp != 85.00) {
  #else
  if (temp != -127.00 && temp != 85.00) {
  #endif

    // Send in the new temperature
    Serial.print("Sending temp: "); Serial.println(temp);
    send(msgTemp.set(temp,1));
    // Save new temperatures for next compare
    lastTemperature=temp;
    }
  wait(SLEEP_TIME);
}

This what I see monitoring the serial output of the gateway:

0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGAS-,VER=2.1.1
0;255;3;0;9;TSM:INIT
0;255;3;0;9;TSF:WUR:MS=0
0;255;3;0;9;TSM:INIT:TSP OK
0;255;3;0;9;TSM:INIT:GW MODE
0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0
0;255;3;0;9;MCO:REG:NOT NEEDED
0;255;3;0;14;Gateway startup complete.
0;255;0;0;18;2.1.1
0;255;3;0;11;Gateway Temp
0;255;3;0;12;1.2
0;0;0;0;6;
0;255;3;0;9;MCO:BGN:STP
Device 0 Resolution: 12
0;255;3;0;9;MCO:BGN:INIT OK,TSP=1
Sending temp: 28.50
0;0;1;0;0;28.5
Sending temp: 28.37
0;0;1;0;0;28.4

mysensors.json:

{"0": {"sensor_id": 0, "children": {"0": {"id": 0, "type": 6, "description": "", "values": {"0": "28.5"}}}, "type": 18, "sketch_name": "Gateway Temp", "sketch_version": "1.2", "_battery_level": 0, "protocol_version": "2.1.1"}}[

and finally home-assistant.log:

2017-09-02 15:57:02 WARNING (SyncWorker_0) [homeassistant.components.mysensors] Invalid values: {0: '28.5'}: sensor platform: node 0 child 0: S_TEMP requires value_type V_TEMP @ data[0]
2017-09-02 15:57:02 INFO (Thread-3) [mysensors.gateway_serial] Trying to connect to /dev/ttyACM0
2017-09-02 15:57:02 INFO (Thread-3) [mysensors.gateway_serial] /dev/ttyACM0 is open...
2017-09-02 15:57:02 INFO (Thread-3) [mysensors.gateway_serial] Connected to /dev/ttyACM0
2017-09-02 15:57:04 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:INIT GW,CP=RNNGAS-,VER=2.1.1
2017-09-02 15:57:04 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT
2017-09-02 15:57:04 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:TSF:WUR:MS=0
2017-09-02 15:57:04 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT:TSP OK
2017-09-02 15:57:04 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT:GW MODE
2017-09-02 15:57:04 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:TSM:READY:ID=0,PAR=0,DIS=0
2017-09-02 15:57:04 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:MCO:REG:NOT NEEDED
2017-09-02 15:57:04 INFO (Thread-3) [mysensors] n:0 c:255 t:3 s:14 p:Gateway startup complete.
2017-09-02 15:57:04 DEBUG (Thread-3) [homeassistant.components.mysensors] Node update: node 0 child 255
2017-09-02 15:57:04 DEBUG (Thread-3) [homeassistant.components.mysensors] Not a child update for node 0
2017-09-02 15:57:04 DEBUG (Thread-3) [homeassistant.components.mysensors] Node update: node 0 child 255
2017-09-02 15:57:04 DEBUG (Thread-3) [homeassistant.components.mysensors] Not a child update for node 0
2017-09-02 15:57:04 WARNING (Thread-3) [mysensors] child_id 0 already exists in children of node 0, cannot add child
2017-09-02 15:57:04 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:STP
2017-09-02 15:57:04 WARNING (Thread-3) [mysensors] Error decoding message from gateway, bad data received: Device 0 Resolution: 12

2017-09-02 15:57:04 WARNING (Thread-3) [mysensors] Not a valid message: 
2017-09-02 15:57:04 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:INIT OK,TSP=1
2017-09-02 15:57:04 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
2017-09-02 15:57:05 WARNING (Thread-3) [mysensors] Error decoding message from gateway, bad data received: Sending temp: 28.25

2017-09-02 15:57:05 WARNING (Thread-3) [mysensors] Not a valid message: 
2017-09-02 15:57:05 DEBUG (Thread-3) [homeassistant.components.mysensors] Node update: node 0 child 0
2017-09-02 15:57:05 WARNING (Thread-3) [homeassistant.components.mysensors] Invalid values: {0: '28.3'}: sensor platform: node 0 child 0: S_TEMP requires value_type V_TEMP @ data[0]

I’m sure I’m doing something silly, but just can’t figure it out. Thanks very much in advance for any help.

P.S. This is my first post and while I’ve tried to use code blocks, apologies if I’ve got it wrong.

Not a guru. But why don’t you start with changing node_id? In the docs it says

Node id defaults to AUTO (tries to fetch id from controller). Specify a number (1-254) if you want to manually set your Node ID

0 is not on the list

Thanks, good thought I’ll try that. It was originally AUTO and got assigned 0 and so at some point I made it manually 0

EDIT: Well, I tried clearing EEPROM with the mysensors sketch and then assigning another number, but it remained as 0. From a bit more reading it seems that the gateway always has the ID 0 and can’t be changed, so no luck there.

Hi!

I’ve tested a modified dummy version of your sketch:

#define MY_DEBUG

// Define node ID
#define MY_NODE_ID 0

// Enable and select radio type attached
#define MY_RADIO_NRF24
//#define MY_RADIO_RFM69

#define MY_SIGNING_SOFT
#define MY_SIGNING_SOFT_RANDOMSEED_PIN 7
#define MY_SIGNING_REQUEST_SIGNATURES

// Enable serial gateway
#define MY_GATEWAY_SERIAL

// Define a lower baud rate for Arduino's running on 8 MHz (Arduino Pro Mini 3.3V & SenseBender)
#if F_CPU == 8000000L
#define MY_BAUD_RATE 38400
#endif

// Flash leds on rx/tx/err
// Uncomment to override default HW configurations
#define MY_DEFAULT_ERR_LED_PIN 4  // Error led pin
#define MY_DEFAULT_RX_LED_PIN  6  // Receive led pin
#define MY_DEFAULT_TX_LED_PIN  5  // the PCB, on board LED

#include <MySensors.h>
#include <DallasTemperature.h>
#include <OneWire.h>

// Send temperature only if changed? 1 = Yes 0 = No
#define COMPARE_TEMP 1

// Pin where dallas sensor is connected
#define ONE_WIRE_BUS 2

// Sleep time between reads (in milliseconds)
unsigned long SLEEP_TIME = 20000;

// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
//OneWire oneWire(ONE_WIRE_BUS);

// Pass the oneWire reference to Dallas Temperature.
//DallasTemperature sensors(&oneWire);

// arrays to hold device address
//DeviceAddress insideThermometer;

#define CHILD_ID_TEMP 0

float lastTemperature;

// Initialize temperature message
MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);
float temp = 20.0;


void setup()
{
  //sensors.begin();
  //if (!sensors.getAddress(insideThermometer, 0)) Serial.println("Unable to find address for Device 0");

  // set the resolution to 12 bit (Each Dallas/Maxim device is capable of several different resolutions)
  //sensors.setResolution(insideThermometer, 12);

  Serial.print("Device 0 Resolution: ");
  //Serial.print(sensors.getResolution(insideThermometer), DEC);
  Serial.println();
}

void presentation()
{
   // Present locally attached sensors
   // Send the sketch version information to the gateway and Controller
  sendSketchInfo("Gateway Temp", "1.2");

  // Present all sensors to controller
  present(CHILD_ID_TEMP, S_TEMP);
}

void loop()
{
	// Send locally attached sensor data here
 	// Fetch temperatures from Dallas sensors
  //sensors.requestTemperatures();

  //float temp = sensors.getTempC(insideThermometer);
	temp = temp + 0.1;

  // Only send data if temperature has changed and no error
  #if COMPARE_TEMP == 1
  if (lastTemperature != temp && temp != -127.00 && temp != 85.00) {
  #else
  if (temp != -127.00 && temp != 85.00) {
  #endif

    // Send in the new temperature
    Serial.print("Sending temp: "); Serial.println(temp);
    send(msgTemp.set(temp,1));
    // Save new temperatures for next compare
    lastTemperature=temp;
    }
  wait(SLEEP_TIME);
}

and this persistence file:

{
  "0": {
    "sensor_id": 0,
    "sketch_name": "Gateway Temp",
    "protocol_version": "2.1.1",
    "type": 18,
    "children": {
      "0": {
        "description": "",
        "id": 0,
        "type": 6,
        "values": {
          "0": "20.3"
        }
      }
    },
    "sketch_version": "1.2",
    "_battery_level": 0
  }
}

This works except for the serial print debug from the gateway getting dropped (as expected). I get the following home assistant log:

2017-09-02 20:37:29 INFO (Thread-13) [mysensors.gateway_serial] Trying to connect to /dev/ttyACM1
2017-09-02 20:37:29 INFO (Thread-13) [mysensors.gateway_serial] /dev/ttyACM1 is open...
2017-09-02 20:37:29 INFO (Thread-13) [mysensors.gateway_serial] Connected to /dev/ttyACM1
2017-09-02 20:37:29 INFO (MainThread) [homeassistant.loader] Loaded sensor from homeassistant.components.sensor
2017-09-02 20:37:29 INFO (MainThread) [homeassistant.setup] Setting up sensor
2017-09-02 20:37:29 INFO (MainThread) [homeassistant.setup] Setup of domain sensor took 0.0 seconds.
2017-09-02 20:37:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event component_loaded[L]: component=sensor>
2017-09-02 20:37:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: discovered=devices=[(140182505944120, 0, 0, 0)], name=mysensors, platform=mysensors, service=load_platform.sensor>
2017-09-02 20:37:29 INFO (MainThread) [homeassistant.loader] Loaded sensor.mysensors from homeassistant.components.sensor.mysensors
2017-09-02 20:37:29 INFO (MainThread) [homeassistant.components.sensor] Setting up sensor.mysensors
2017-09-02 20:37:29 INFO (Thread-10) [homeassistant.components.mysensors] Adding new devices: [<Entity Gateway Temp 0 0: None>]
2017-09-02 20:37:29 DEBUG (Thread-6) [homeassistant.components.mysensors] Entity update: Gateway Temp 0 0: value_type 0, value = 28.5
2017-09-02 20:37:29 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state sensor.gateway_temp_0_0=28.5; battery_level=0, description=, child_id=0, unit_of_measurement=°C, friendly_name=Gateway Temp 0 0, node_id=0, device=/dev/ttyACM1, V_TEMP=28.5 @ 2017-09-02T20:37:29.834685+02:00>, entity_id=sensor.gateway_temp_0_0, old_state=None>
2017-09-02 20:37:30 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:INIT GW,CP=RNNGAS-,VER=2.1.1
2017-09-02 20:37:30 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT
2017-09-02 20:37:30 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSF:WUR:MS=0
2017-09-02 20:37:30 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT:TSP OK
2017-09-02 20:37:30 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT:GW MODE
2017-09-02 20:37:30 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSM:READY:ID=0,PAR=0,DIS=0
2017-09-02 20:37:30 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:MCO:REG:NOT NEEDED
2017-09-02 20:37:30 INFO (Thread-13) [mysensors] n:0 c:255 t:3 s:14 p:Gateway startup complete.
2017-09-02 20:37:30 DEBUG (Thread-13) [homeassistant.components.mysensors] Node update: node 0 child 255
2017-09-02 20:37:30 DEBUG (Thread-13) [homeassistant.components.mysensors] Not a child update for node 0
2017-09-02 20:37:30 DEBUG (Thread-13) [homeassistant.components.mysensors] Node update: node 0 child 255
2017-09-02 20:37:30 DEBUG (Thread-13) [homeassistant.components.mysensors] Not a child update for node 0
2017-09-02 20:37:30 WARNING (Thread-13) [mysensors] child_id 0 already exists in children of node 0, cannot add child
2017-09-02 20:37:30 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:STP
2017-09-02 20:37:30 WARNING (Thread-13) [mysensors] Error decoding message from gateway, bad data received: Device 0 Resolution: 

2017-09-02 20:37:30 WARNING (Thread-13) [mysensors] Not a valid message: 
2017-09-02 20:37:30 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:INIT OK,TSP=1
2017-09-02 20:37:30 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
2017-09-02 20:37:30 WARNING (Thread-13) [mysensors] Error decoding message from gateway, bad data received: Sending temp: 20.10

2017-09-02 20:37:30 WARNING (Thread-13) [mysensors] Not a valid message: 
2017-09-02 20:37:30 DEBUG (Thread-13) [homeassistant.components.mysensors] Node update: node 0 child 0
2017-09-02 20:37:30 DEBUG (Thread-12) [homeassistant.components.mysensors] Entity update: Gateway Temp 0 0: value_type 0, value = 20.1
2017-09-02 20:37:30 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state sensor.gateway_temp_0_0=20.1; battery_level=0, description=, child_id=0, unit_of_measurement=°C, friendly_name=Gateway Temp 0 0, node_id=0, device=/dev/ttyACM1, V_TEMP=20.1 @ 2017-09-02T20:37:30.682564+02:00>, entity_id=sensor.gateway_temp_0_0, old_state=<state sensor.gateway_temp_0_0=28.5; battery_level=0, description=, child_id=0, unit_of_measurement=°C, friendly_name=Gateway Temp 0 0, node_id=0, device=/dev/ttyACM1, V_TEMP=28.5 @ 2017-09-02T20:37:29.834685+02:00>>
2017-09-02 20:37:36 INFO (MainThread) [homeassistant.components.http] Serving /api/websocket to 127.0.0.1 (auth: True)
2017-09-02 20:37:50 WARNING (Thread-13) [mysensors] Error decoding message from gateway, bad data received: Sending temp: 20.20

2017-09-02 20:37:50 WARNING (Thread-13) [mysensors] Not a valid message: 
2017-09-02 20:37:50 DEBUG (Thread-13) [homeassistant.components.mysensors] Node update: node 0 child 0
2017-09-02 20:37:50 DEBUG (Thread-9) [homeassistant.components.mysensors] Entity update: Gateway Temp 0 0: value_type 0, value = 20.2
2017-09-02 20:37:50 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state sensor.gateway_temp_0_0=20.2; battery_level=0, description=, child_id=0, unit_of_measurement=°C, friendly_name=Gateway Temp 0 0, node_id=0, device=/dev/ttyACM1, V_TEMP=20.2 @ 2017-09-02T20:37:50.674652+02:00>, entity_id=sensor.gateway_temp_0_0, old_state=<state sensor.gateway_temp_0_0=20.1; battery_level=0, description=, child_id=0, unit_of_measurement=°C, friendly_name=Gateway Temp 0 0, node_id=0, device=/dev/ttyACM1, V_TEMP=20.1 @ 2017-09-02T20:37:30.682564+02:00>>
2017-09-02 20:38:10 WARNING (Thread-13) [mysensors] Error decoding message from gateway, bad data received: Sending temp: 20.30

2017-09-02 20:38:10 WARNING (Thread-13) [mysensors] Not a valid message: 
2017-09-02 20:38:10 DEBUG (Thread-13) [homeassistant.components.mysensors] Node update: node 0 child 0
2017-09-02 20:38:10 DEBUG (Thread-5) [homeassistant.components.mysensors] Entity update: Gateway Temp 0 0: value_type 0, value = 20.3
2017-09-02 20:38:10 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: new_state=<state sensor.gateway_temp_0_0=20.3; battery_level=0, description=, child_id=0, unit_of_measurement=°C, friendly_name=Gateway Temp 0 0, node_id=0, device=/dev/ttyACM1, V_TEMP=20.3 @ 2017-09-02T20:38:10.669865+02:00>, entity_id=sensor.gateway_temp_0_0, old_state=<state sensor.gateway_temp_0_0=20.2; battery_level=0, description=, child_id=0, unit_of_measurement=°C, friendly_name=Gateway Temp 0 0, node_id=0, device=/dev/ttyACM1, V_TEMP=20.2 @ 2017-09-02T20:37:50.674652+02:00>>
^C2017-09-02 20:38:12 INFO (MainThread) [homeassistant.core] Bus:Handling <Event homeassistant_stop[L]>
2017-09-02 20:38:12 INFO (Thread-10) [mysensors.gateway_serial] Stopping thread
2017-09-02 20:38:12 INFO (Thread-13) [mysensors.gateway_serial] Disconnecting from /dev/ttyACM1
2017-09-02 20:38:12 INFO (Thread-13) [mysensors.gateway_serial] Disconnected from /dev/ttyACM1
2017-09-02 20:38:14 INFO (MainThread) [homeassistant.core] Bus:Handling <Event homeassistant_close[L]>

Thanks very much for the reply and your time. So I tested the modified versions you created to see if they worked for me. I deleted home-assistant_v2.db, replaced the persistence file with yours, and replaced the sketch on the gateway with your tweaked version. The following is the home assistant log:

2017-09-02 22:17:37 WARNING (SyncWorker_5) [homeassistant.components.mysensors] Invalid values: {0: '20.3'}: sensor platform: node 0 child 0: S_TEMP requires value_type V_TEMP @ data[0]
2017-09-02 22:17:37 INFO (Thread-3) [mysensors.gateway_serial] Trying to connect to /dev/ttyACM0
2017-09-02 22:17:37 INFO (Thread-3) [mysensors.gateway_serial] /dev/ttyACM0 is open...
2017-09-02 22:17:37 INFO (Thread-3) [mysensors.gateway_serial] Connected to /dev/ttyACM0
2017-09-02 22:17:39 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:INIT GW,CP=RNNGAS-,VER=2.1.1
2017-09-02 22:17:39 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT
2017-09-02 22:17:39 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:TSF:WUR:MS=0
2017-09-02 22:17:39 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT:TSP OK
2017-09-02 22:17:39 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT:GW MODE
2017-09-02 22:17:39 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:TSM:READY:ID=0,PAR=0,DIS=0
2017-09-02 22:17:39 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:MCO:REG:NOT NEEDED
2017-09-02 22:17:39 INFO (Thread-3) [mysensors] n:0 c:255 t:3 s:14 p:Gateway startup complete.
2017-09-02 22:17:39 DEBUG (Thread-3) [homeassistant.components.mysensors] Node update: node 0 child 255
2017-09-02 22:17:39 DEBUG (Thread-3) [homeassistant.components.mysensors] Not a child update for node 0
2017-09-02 22:17:39 DEBUG (Thread-3) [homeassistant.components.mysensors] Node update: node 0 child 255
2017-09-02 22:17:39 DEBUG (Thread-3) [homeassistant.components.mysensors] Not a child update for node 0
2017-09-02 22:17:39 WARNING (Thread-3) [mysensors] child_id 0 already exists in children of node 0, cannot add child
2017-09-02 22:17:39 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:STP
2017-09-02 22:17:39 WARNING (Thread-3) [mysensors] Error decoding message from gateway, bad data received: Device 0 Resolution: 

2017-09-02 22:17:39 WARNING (Thread-3) [mysensors] Not a valid message: 
2017-09-02 22:17:39 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:INIT OK,TSP=1
2017-09-02 22:17:39 WARNING (Thread-3) [mysensors] Error decoding message from gateway, bad data received: Sending temp: 20.10

2017-09-02 22:17:39 WARNING (Thread-3) [mysensors] Not a valid message: 
2017-09-02 22:17:39 DEBUG (Thread-3) [homeassistant.components.mysensors] Node update: node 0 child 0
2017-09-02 22:17:39 WARNING (Thread-3) [homeassistant.components.mysensors] Invalid values: {0: '20.1'}: sensor platform: node 0 child 0: S_TEMP requires value_type V_TEMP @ data[0]
2017-09-02 22:17:39 DEBUG (Thread-3) [mysensors] n:0 c:255 t:3 s:9 p:TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK:
2017-09-02 22:17:59 WARNING (Thread-3) [mysensors] Error decoding message from gateway, bad data received: Sending temp: 20.20

2017-09-02 22:17:59 WARNING (Thread-3) [mysensors] Not a valid message: 
2017-09-02 22:17:59 DEBUG (Thread-3) [homeassistant.components.mysensors] Node update: node 0 child 0
2017-09-02 22:17:59 WARNING (Thread-3) [homeassistant.components.mysensors] Invalid values: {0: '20.2'}: sensor platform: node 0 child 0: S_TEMP requires value_type V_TEMP @ data[0]
2017-09-02 22:18:19 WARNING (Thread-3) [mysensors] Error decoding message from gateway, bad data received: Sending temp: 20.30

2017-09-02 22:18:19 WARNING (Thread-3) [mysensors] Not a valid message: 
2017-09-02 22:18:19 DEBUG (Thread-3) [homeassistant.components.mysensors] Node update: node 0 child 0
2017-09-02 22:18:19 WARNING (Thread-3) [homeassistant.components.mysensors] Invalid values: {0: '20.3'}: sensor platform: node 0 child 0: S_TEMP requires value_type V_TEMP @ data[0]
2017-09-02 22:18:39 WARNING (Thread-3) [mysensors] Error decoding message from gateway, bad data received: Sending temp: 20.40

2017-09-02 22:18:39 WARNING (Thread-3) [mysensors] Not a valid message: 
2017-09-02 22:18:39 DEBUG (Thread-3) [homeassistant.components.mysensors] Node update: node 0 child 0
2017-09-02 22:18:39 WARNING (Thread-3) [homeassistant.components.mysensors] Invalid values: {0: '20.4'}: sensor platform: node 0 child 0: S_TEMP requires value_type V_TEMP @ data[0]
2017-09-02 22:18:59 WARNING (Thread-3) [mysensors] Error decoding message from gateway, bad data received: Sending temp: 20.50

2017-09-02 22:18:59 WARNING (Thread-3) [mysensors] Not a valid message: 
2017-09-02 22:18:59 DEBUG (Thread-3) [homeassistant.components.mysensors] Node update: node 0 child 0
2017-09-02 22:18:59 WARNING (Thread-3) [homeassistant.components.mysensors] Invalid values: {0: '20.5'}: sensor platform: node 0 child 0: S_TEMP requires value_type V_TEMP @ data[0]

I’m really confused. Is there additional logging or anything that I could enable to help?

Edit: I noticed I was on 0.52 so I updated to 0.52.1 just in case, but there was no difference.

Can you check installed versions of pymysensors and voluptuous?

pip3 show pymysensors

OK, so this gets even more odd:

[nuc /var/lib/hass]$ pip3 show pymysensors
[nuc /var/lib/hass]$ pip3 show voluptuous
Name: voluptuous
Version: 0.9.3
Summary: # Voluptuous is a Python data validation library
Home-page: https://github.com/alecthomas/voluptuous
Author: Alec Thomas
Author-email: [email protected]
License: BSD
Location: /usr/lib/python3.6/site-packages
Requires: setuptools

No output for pymysensors. I could try installing it:

[nuc /var/lib/hass]$ pip3 search pymysensors
pymysensors (0.11.1)  - Python API for talking to a MySensors gateway

But presumably it must be there somewhere to get the output we are? This is all on Arch Linux by the way, Home Assistant installed from the AUR. Thanks for your help!

Both home assistant and pymysensors requires voluptuous version 0.10.5. I think there was a bug in the version you have installed. Try to install the correct version.

Also, I would investigate why incorrect requirements are installed for home assistant.

1 Like

Thank you! I updated voluptuous and all looks good. I’ll go and reinstate my original sketch and other sensors to be sure, but I’m confident it will be. It looks like the PKGBUILD has the wrong dependency for voluptuous, and the voluptuous package itself (also on AUR and not in the main repos) is out of date. Given Home Assistant requires >= 0.10.5 I must have got lucky that everyhting worked so far.

1 Like

For any other Arch users, the following is an updated PKGBUILD for python-voluptuous 0.10.5:

pkgbase=python-voluptuous
pkgname=('python-voluptuous' 'python2-voluptuous')
pkgver=0.10.5
pkgrel=1
pkgdesc="Voluptuous is a Python data validation library"
arch=('any')
url='https://pypi.python.org/pypi/voluptuous'
license=('BSD')
source=(https://pypi.python.org/packages/c3/81/c84f8a3e723b760fdd1c41fc80201cb80cd29c1bce5159d8918c58df7d2a/voluptuous-0.10.5.tar.gz)
md5sums=('e3fc99b75618d384cad63bc71b6507bc')
makedepends=('python2' 'python' 'python-setuptools' 'python2-setuptools')

package_python-voluptuous() {
  depends=('python')

  cd $srcdir/voluptuous-$pkgver
  install -D -m644 COPYING ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
  python setup.py install --root=$pkgdir
  chmod a+r -R $pkgdir/usr/lib/python3.6/site-packages/voluptuous-$pkgver-py3.6.egg-info
}

package_python2-voluptuous() {
  depends=('python2')

  cd $srcdir/voluptuous-$pkgver
  install -D -m644 COPYING ${pkgdir}/usr/share/licenses/${pkgname}/LICENSE
  python2 setup.py install --root=$pkgdir
  chmod a+r -R $pkgdir/usr/lib/python2.7/site-packages/voluptuous-$pkgver-py2.7.egg-info
}

My recommendation is to install home assistant within a virtual environment and rely solely on pip to install the requirements.

Thanks, I’ll look into that - it would indeed seem cleaner. Thanks for all your help.

1 Like