Hi,
just upgraded to 0.52.1 and now mysensors is broken.
I noticed the sensors were simply gone and removed the persistance file and restarted. Now I get this when a new sensor presents itself on the mysensors network:
2017-08-31 20:48:33 DEBUG (Thread-7) [mysensors.gateway_mqtt] Receiving 252;100;1;0;38;2.62319851
2017-08-31 20:48:33 DEBUG (Thread-13) [homeassistant.components.mysensors] Node update: node 252 child 100
2017-08-31 20:48:33 ERROR (Thread-13) [mysensors] 'ChildSensor' object has no attribute 'get_schema'
Traceback (most recent call last):
File "/export/home/hacker/.homeassistant/deps/lib/python3.5/site-packages/mysensors/__init__.py", line 282, in alert
self.event_callback(msg)
File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/mysensors.py", line 474, in mysensors_callback
validated = validate_child(msg.gateway, msg.node_id, child)
File "/usr/local/lib/python3.5/dist-packages/homeassistant/components/mysensors.py", line 409, in validate_child
_child_schema = child.get_schema(gateway.protocol_version)
AttributeError: 'ChildSensor' object has no attribute 'get_schema'
Hmm, could be that pymysensors did not update for some reason. I used pip3 to upgrade it to 0.11, put back my persistence file and now the sensors show up again. However, they do not display any values. I get these warnings in my log file:
If you edit your persistence file and replace null values for protocol_version with the correct mysensors version of your sensors, that should avoid the bug.
The fix has been merged with dev branch and is tagged to go out in 0.52.2. But I don’t know when that will be released. The fix will not be able to determine the correct protocol_version on its own though. It will just fall back to version 1.4 if a non valid protocol_version is detected. To get the correct version, automatically, you have to present the affected sensors again after deleting the persistence file or removing those sensors from the file.
It worked when I fixed my persistence file to have the correct version. However, I now have another problem which seems to be related to validation. I send a message from my power meter (sensor type S_POWER) with value type V_KWH (type 17). This doesn’t seem to pass validation, even though it should, according to the mysensors documentation (e.g value type 17 is expected from a S_POWER sensor):
Value type 17 is V_WATT, and seems to be reported fine for your sensor. You can see that the entity updates with that value. You can ignore the debug log for the failed validations if you don’t experience a problem.
The bug with IndexError has been fixed in the dev branch. It suggests you are reporting multiple measurements per child which is not really supported by home assistant.
No, I’m planning to disallow this in the future. It has been allowed previously but has not been without problems. Eg you will have a conflict between entity_ids which will lead them to being updated with an index before the entity is added. Since the order of entity addition is not fixed you can face problems with entities changing entity_id between restarts.