HA ready for MySensors 2.0.0?

Hello,
I’m wondering if someone has tested HA with the new release of MySensors 2.0.0
It theory the serial api has not changed since v1.5 but I’m wondering if someone already test it.

Thanks,
Alfredo.

i use development branch of mysensors with HA for some time now… I never used a 1.5 gateway or nodes…
i’m not seeing things that are not supposed to be happening (i think).
presentation and acking works different in HA than in Domoticz (what i used before) so i needed to update some sketches to work. But i think that is HA related and not 2.0.0. specific.

1 Like

Thank you. I successfully migrated to MySensors 2.0.0.
I’m using the ESP8266 Gateway with a couple of nodes and so far it is working fine. Low range but this is a known issue.

Thanks.

1 Like

Hi there!

Tried the dev-branch of pymysensors but HA refuses to detect any sensor.
The gateway and nodes are working fine and I can watch the nodes report their values to the gateway via telnet.
How did you get MySensors 2.0.0 with HA running?

Best regards

Hensing

How did you modify HA to use the dev branch of pymysensors?

Do you have a debug level log from HA after start?

Hi!

I’ve used your add_representation branch and copied the content into

~/.homeassistant/deps/mysensors

Log sais

16-08-12 11:54:10 mysensors.mysensors: Connected to ('192.168.178.29', 5003)
16-08-12 11:54:10 requests.packages.urllib3.connectionpool: Starting new HTTP connection (6): openelec.fritz.box
16-08-12 11:54:10 mysensors.mysensors: Received 0;255;3;0;14;Gateway startup complete.
0;255;3;0;11;AZ Gateway
0;255;3;0;12;1.0
0;0;0;0;7;AZ Luftfeuchtigkeit
0;1;0;0;6;
16-08-12 11:54:10 mysensors.mysensors: Received AZ Temperatur
0;255;0;0;18;2.0.0

16-08-12 11:54:10 homeassistant.components.mysensors: update sensor_update: node 0
16-08-12 11:54:10 homeassistant.components.mysensors: update sensor_update: node 0
16-08-12 11:54:10 mysensors.mysensors: child_id 0 already exists in children, cannot add child
16-08-12 11:54:10 homeassistant.components.mysensors: update sensor_update: node 0
16-08-12 11:54:10 mysensors.mysensors: child_id 1 already exists in children, cannot add child
16-08-12 11:54:10 homeassistant.components.mysensors: update sensor_update: node 0
16-08-12 11:54:10 homeassistant.components.mysensors: update sensor_update: node 0
16-08-12 11:54:36 mysensors.mysensors: Received 2;0;1;0;0;21.8

16-08-12 11:54:36 mysensors.mysensors: Child 0 is unknown
16-08-12 11:54:36 mysensors.mysensors: Requesting new presentation for node 2
16-08-12 11:54:36 mysensors.mysensors: Sending 2;255;3;0;19;

16-08-12 11:54:36 mysensors.mysensors: Received 2;1;1;0;1;87.0

16-08-12 11:54:36 mysensors.mysensors: Child 1 is unknown
16-08-12 11:54:36 mysensors.mysensors: Requesting new presentation for node 2
16-08-12 11:54:36 mysensors.mysensors: Sending 2;255;3;0;19;

but the sensors still won’t show up.

Best regards

UPDATE
The sensors of the gateway (node 0) magically showed up – the two other nodes are still missing
The respresentation of the childs were partially ignored: type is correct but the sketchname is the sketchname of the sensor and not of the child (AZ Gateway instead of AZ Temperatur, see log above)

You seem to be using that linked branch even though the mysensors component in HA is set to use a specific commit and version. I guess you can override that somehow. The better way would be to change the pip string in requirements in the mysensors component.

Looking at the log, it seems some presentation messages are missing. Do you have a parallel serial log from node 2, so we can see that all messages are received by the gateway OK?

Also some messages seem to be not parsed OK by the ethernet gateway implementation in pymysensors. That’s something I’d like to look into, but it would help to get the serial log from node 2, to verify message integrity coming in to the gateway.

The sketchname is always the sketchname. The description that can be sent as payload when presenting sensors is currently not handled by pymysensors. It’s on my todo.

To have sensors showing in HA, the node needs to be presented, a sketchname needs to be sent, the sensors need to be presented and initial values need to be sent.

Hi!

Thank you for you effort so far! :slight_smile:

gateway log:

55;3;0;9;Client 0: 
0;255;3;0;9;Client 0: 
0;255;3;0;9;Client 0: 
0;255;3;0;9;Client 0: 
0;255;3;0;9;Client 0: 
0;255;3;0;9;Client 1 connected
0;255;3;0;9;Client 1: 0;255;3;0;19;
0;255;3;0;9;Client 1: 0;255;3;0;19;
0;255;3;0;9;Client 1: 0;255;0;0;18;2.0.0
0;255;3;0;9;Client 1: 0;255;3;0;19;
0;255;3;0;9;Client 1: 0;255;3;0;19;
0;255;3;0;9;Client 1: 0;0;0;0;7;AZ Luftfeuchtigkeit
0;255;3;0;9;Client 1: 0;1;0;0;6;AZ Temperatur
0;255;3;0;9;TSP:SANCHK:OK
0;255;3;0;9;TSP:MSG:READ 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
0;255;3;0;9;TSP:MSG:BC
0;255;3;0;9;TSP:MSG:FPAR REQ (sender=1)
0;255;3;0;9;TSP:CHKUPL:OK
0;255;3;0;9;TSP:MSG:GWL OK
0;255;3;0;9;!TSP:MSG:SEND 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
0;255;3;0;9;TSP:MSG:READ 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
0;255;3;0;9;TSP:MSG:BC
0;255;3;0;9;TSP:MSG:FPAR REQ (sender=1)
0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
0;255;3;0;9;TSP:MSG:GWL OK
0;255;3;0;9;!TSP:MSG:SEND 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
0;255;3;0;9;TSP:MSG:READ 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
0;255;3;0;9;TSP:MSG:BC
0;255;3;0;9;TSP:MSG:FPAR REQ (sender=1)
0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
0;255;3;0;9;TSP:MSG:GWL OK
0;255;3;0;9;!TSP:MSG:SEND 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
0;255;3;0;9;TSP:MSG:READ 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
0;255;3;0;9;TSP:MSG:BC
0;255;3;0;9;TSP:MSG:FPAR REQ (sender=1)
0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
0;255;3;0;9;TSP:MSG:GWL OK
0;255;3;0;9;!TSP:MSG:SEND 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
0;255;3;0;9;TSP:MSG:READ 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
0;255;3;0;9;TSP:MSG:BC
0;255;3;0;9;TSP:MSG:FPAR REQ (sender=1)
0;255;3;0;9;TSP:CHKUPL:OK
0;255;3;0;9;TSP:MSG:GWL OK
0;255;3;0;9;!TSP:MSG:SEND 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
0;255;3;0;9;TSP:MSG:READ 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
0;255;3;0;9;TSP:MSG:BC
0;255;3;0;9;TSP:MSG:FPAR REQ (sender=1)
0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
0;255;3;0;9;TSP:MSG:GWL OK
0;255;3;0;9;!TSP:MSG:SEND 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
0;255;3;0;9;TSP:MSG:READ 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
0;255;3;0;9;TSP:MSG:BC
0;255;3;0;9;TSP:MSG:FPAR REQ (sender=1)
0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
0;255;3;0;9;TSP:MSG:GWL OK
0;255;3;0;9;!TSP:MSG:SEND 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
0;255;3;0;9;TSP:MSG:READ 1-1-255 s=255,c=3,t=7,pt=0,l=0,sg=0:
0;255;3;0;9;TSP:MSG:BC
0;255;3;0;9;TSP:MSG:FPAR REQ (sender=1)
0;255;3;0;9;TSP:CHKUPL:OK (FLDCTRL)
0;255;3;0;9;TSP:MSG:GWL OK
0;255;3;0;9;!TSP:MSG:SEND 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0
0;255;3;0;9;TSP:SANCHK:OK

seems like node 1 in this case can’t get any node ID from the controller

log of the node:
Connected.
TSM:INIT
TSM:RADIO:OK
TSP:ASSIGNID:OK (ID=1)
TSM:FPAR
TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSM:FPAR
TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSM:FPAR
TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSM:FPAR
TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
!TSM:FPAR:FAIL
!TSM:FAILURE
TSM:PDT

I’m not an expert and I’m just starting with HA + Mysensors. But in my opinion your node is not able to receive messages from the gateway.

0;255;3;0;9;!TSP:MSG:SEND 0-0-1-1 s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=fail:0

Since I started with these hobby, the radio problems on my side were always related to pin connections or unstable voltage on the radio module.

Can you try with another sensor node?

1 Like

Hi!

Yes I tried three different radios (w/ and w/o long range) with 47μC or 100 μC capacitor parallel to the ground/vcc and tried two different nodes.

Maybe I should try another one (other PCB) but 2 days ago I could connect the nodes to a MQTT gateway by assigning a fixed node ID without HASS as controller.

Till I used auto node id the same error occurred - maybe a coincidence :confused:

You were right: the radio of the gateway (not of the nodes) was broken. Now I’m using one without capacitor and it’s working :slight_smile:

HASS now works like a charm: had an typo in the presentation function name :blush:

Thank you for your help!!

1 Like

Im glad that you found the problem. Now It is time to start enjoying with the real home automation. :slight_smile:

I’m also having issues with 2.0.0

It’s working with domoticz but with HA i’m getting :

16-08-25 16:13:37 homeassistant.components.mysensors: No sketch_name: node 0
16-08-25 16:13:37 homeassistant.components.mysensors: No sketch_name: node 0
16-08-25 16:13:37 homeassistant.components.mysensors: No sketch_name: node 0
16-08-25 16:13:37 homeassistant.components.mysensors: No sketch_name: node 0
16-08-25 16:13:47 homeassistant.components.mysensors: update sensor_update: node 1
16-08-25 16:13:47 homeassistant.components.mysensors: update sensor_update: node 1
16-08-25 16:13:47 homeassistant.components.mysensors: update sensor_update: node 1
16-08-25 16:13:47 mysensors.mysensors: child_id 1 already exists in children, cannot add child
16-08-25 16:13:47 homeassistant.components.mysensors: update sensor_update: node 1

And my node :

Starting repeater (RNNRA-, 2.0.0)
TSM:INIT
TSM:RADIO:OK
TSP:ASSIGNID:OK (ID=1)
TSM:FPAR
TSP:MSG:SEND 1-1-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc:
TSP:MSG:READ 0-0-1 s=255,c=3,t=8,pt=1,l=1,sg=0:0
TSP:MSG:FPAR RES (ID=0, dist=0)
TSP:MSG:PAR OK (ID=0, dist=1)
TSM:FPAR:OK
TSM:ID
TSM:CHKID:OK (ID=1)
TSM:UPL
TSP:PING:SEND (dest=0)
TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=ok:1
TSP:MSG:READ 0-0-1 s=255,c=3,t=25,pt=1,l=1,sg=0:1
TSP:MSG:PONG RECV (hops=1)
TSP:CHKUPL:OK
TSM:UPL:OK
TSM:READY
TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100
!TSP:MSG:SEND 1-1-0-0 s=255,c=0,t=18,pt=0,l=5,sg=0,ft=0,st=fail:2.0.0
TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=ok:0
TSP:MSG:READ 0-0-1 s=255,c=3,t=6,pt=0,l=1,sg=0:M
TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=11,pt=0,l=5,sg=0,ft=0,st=ok:Relay
TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=ok:1.0
TSP:MSG:SEND 1-1-0-0 s=1,c=0,t=3,pt=0,l=0,sg=0,ft=0,st=ok:
Request registration...
TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2
TSP:MSG:READ 0-0-1 s=255,c=3,t=27,pt=1,l=1,sg=0:1
Node registration=1
Init complete, id=1, parent=0, distance=1, registration=1
TSP:SANCHK:OK

My config.yml

mysensors:
  gateways:
    - device: '/dev/ttyACM0'

So why is my node not recognized from HA ?

I have reseted the gateway and the node without any chances…
Thanks for the help :slight_smile:

I can see two problems.

First you have a message that failed to send. It was the presentation for the node. That is a required message. It seems it might have worked previously though, looking at the HA log. Try make sure you have stable radio comms. Check your power source etc.

Second, you didn’t send an initial value for the relay. In mysensors 2.0 you should do that in the loop, due to sensors can’t send values until after registration is complete. Registration happens in the end of begin method.