Home Assistant v 0.11.1 with switch support


  • Plugin Developer

    Hi!

    Version 0.11 of home assisstant is now released with included mysensors switch support for serial gateway. Right now switches will change state optimistically, without waiting for reply from actuator. I'll add support for feedback state soon. Let me know of any problems.

    I've also refactored the component so it will be easy to add new platforms, light, binary sensor, lock etc. I'm hoping to have time to do so soon. Another new feature is multiple serial gateways connected at the same time.

    Edit:

    You have to update your config if already using mysensors in home assistant. It should now look like this, for two gateways:

    mysensors:
      gateways:
        - port: '/dev/ttyUSB0'
          persistence_file: 'path/mysensors.json'
        - port: '/dev/ttyACM1'
          persistence_file: 'path/mysensors2.json'
      debug: true
      persistence: true
      version: '1.5'
    

    You can see that it's not a sensor platform config anymore. The available platforms will be setup automatically from the component.

    Update: Bugfix release 0.11.1 is now released. Version 0.11 was missing the binary sensors. That has now been fixed in 0.11.1.



  • Thank you! Please let me know if this new release is development or not, because I am looking every day on HA site for update (mostly for solving the delay for group switches) and there are no news about 0.11.


  • Plugin Developer

    @Mihai

    I don't think they've had the time to do a blog post yet. But it will probably happen very soon. The release is available both on pypi and github though. You should be able to do:

    pip3 install --upgrade homeassistant
    

    Then restart homeassistant.



  • Thank you, it works fine now. My main problem was related to the mqtt version: it must be 3.1.1, while linux default is an old version capable only 3.1.



  • Hi,
    I installed Home-assistant and Setup a MySensor SerialGateWay + MySensor Switch.
    Yet when I start HA It shows this Error:

    16-01-18 17:27:38 homeassistant.components.mysensors: Missing required configuration items in mysensors: gateways
    16-01-18 17:27:38 homeassistant.bootstrap: component mysensors failed to initialize```
    

    Config:

    mysensors 1:
      gateways:
        - port: '/dev/ttyUSB0'
          persistence_file: 'hass_log/mysensors.json'
      debug: true
      persistence: true
      version: '1.5'
    

  • Plugin Developer

    @mirko314

    Hi!

    You should only have one mysensors domain, so remove the "1" after "mysensors" in your config:

    mysensors:
      gateways:
        - port: '/dev/ttyUSB0'
          persistence_file: 'hass_log/mysensors.json'
      debug: true
      persistence: true
      version: '1.5'
    


  • @martinhjelmare
    Thank you!
    Seems to Load now :)
    I disabled persistence because I did not seem to need it right now.
    I am getting the following log when I Push the Wireless Button, it seems to work.
    But I dont see any now nodes / Sensor on the Dashboard. Did I forget something?

    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=3,c=1,t=16,pt=2,l=2,sg=0: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=3,c=1,t=16,pt=2,l=2,sg=0:0
    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
    

  • Plugin Developer

    @mirko314

    INFO:homeassistant.components.mysensors:No sketch_name: node 1
    

    This indicates that the gateway hasn't received all presentation messages from node 1. It's missing sketch name for this node.

    If you disable persistence you have to restart your nodes each time you restart home assistant, to resend the presentation messages.



  • @martinhjelmare
    Got that worked out, changed the Name in the Persistence File that HA created! :+1:
    But it still does not show up.
    HA Log:

    INFO:mysensors.mysensors:n:0 c:0 t:3 s:9 p:read: 1-1-0 s=3,c=1,t=16,pt=2,l=2,sg=0: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=3,c=1,t=16,pt=2,l=2,sg=0: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=16,pt=2,l=2,sg=0: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=3,c=1,t=16,pt=2,l=2,sg=0:0
    INFO:homeassistant.components.mysensors:update sensor_update: node 1
    

    Persistence File:

    {"1": {"sketch_version": null, "children": {"3": {"type": 0, "values": {"16": "0"}, "id": 3}}, "sketch_name": "testgateway", "battery_level": 0, "sensor_id": 1, "type": 17}}
    

  • Plugin Developer

    @mirko314

    I can't see anything obviously wrong with the persistence file, except for sketch version being null, although that is not used by HA. Try changing that to "1.0" and restart.


  • Plugin Developer

    @mirko314

    Btw, your values are setup for a door sensor and not a switch. Maybe that was your intention?



  • @martinhjelmare
    I Changed the Version, yet there is nothing added to the dashboard.
    I used the sample BinarySwitch example sketch of MYS. The Sensor Arduino has a button connected to Pin 3.
    I'm relativly new here so maybe I missed something. And I don't know what Values you mean.


  • Plugin Developer

    @mirko314

    Can you post your sketch and the complete log of HA after start? You can censor any sensitive info.


  • Plugin Developer

    @mirko314

    A clarification: In home assistant a switch is something you can turn on/off from home assistant, an actuator. The BinarySwitch example in mysensors examples is something you turn on/off by the node, a sensor.

    It should work anyhow, but I was a bit confused at first. :smiley:



  • The Whole log is:
    screenlog.txt
    The Sketch is:
    BinarySwitchSensor.ino
    The Sketch was not modified and should be the same as the one of the MYS download Page.

    Do I maybe have to add anything to my config.yaml besides the plattform thing?


  • Plugin Developer

    Unfortunately, I've realized this is a bug caused by me. There will be a bugfix release soon, so I hope we can have a fix for this in there. Sorry for the inconvenience!

    Right now the binary sensors are missing in the sensor platform. I think it's due to me planning to do a binary sensor platform, but then changing my mind, and posponing that. Again sorry!
    :anguished:



  • Alright then, I started to feel a bit dumb :D
    If you need any help let me know!
    Thank you for looking into the issue :+1:


  • Plugin Developer

    @mirko314

    Thanks for testing and reporting the problem. All feedback is very welcome and important, cause even though I try to test most scenarios, it's easy to miss something. In this case, though, I feel a bit embarrassed. :flushed:

    I've submitted a tested pull request which fixes this, and it has already been merged. Hopefully the bugfix release will be live very soon.


  • Plugin Developer

    Update: Bugfix release 0.11.1 is now out.



  • Nice!
    Thank you, I installed it, works like a charm!
    Going to try a HA switch tomorrow!
    Are 1-Wire Components like AM2301 Temp-Sensor already supported?


Log in to reply
 

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.