Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
  1. Home
  2. Controllers
  3. Home Assistant
  4. Home Assistant v 0.11.1 with switch support

Home Assistant v 0.11.1 with switch support

Scheduled Pinned Locked Moved Home Assistant
switchserial gatewayhome assistant
53 Posts 5 Posters 22.0k Views 5 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • martinhjelmareM Offline
    martinhjelmareM Offline
    martinhjelmare
    Plugin Developer
    wrote on last edited by martinhjelmare
    #1

    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.

    1 Reply Last reply
    2
    • M Offline
      M Offline
      Mihai
      wrote on last edited by
      #2

      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.

      martinhjelmareM 1 Reply Last reply
      0
      • M Mihai

        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.

        martinhjelmareM Offline
        martinhjelmareM Offline
        martinhjelmare
        Plugin Developer
        wrote on last edited by martinhjelmare
        #3

        @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.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          Mihai
          wrote on last edited by
          #4

          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.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            mirko314
            wrote on last edited by
            #5

            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'
            
            martinhjelmareM 1 Reply Last reply
            0
            • M mirko314

              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'
              
              martinhjelmareM Offline
              martinhjelmareM Offline
              martinhjelmare
              Plugin Developer
              wrote on last edited by
              #6

              @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'
              
              1 Reply Last reply
              1
              • M Offline
                M Offline
                mirko314
                wrote on last edited by
                #7

                @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
                
                martinhjelmareM 1 Reply Last reply
                0
                • M mirko314

                  @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
                  
                  martinhjelmareM Offline
                  martinhjelmareM Offline
                  martinhjelmare
                  Plugin Developer
                  wrote on last edited by
                  #8

                  @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.

                  1 Reply Last reply
                  1
                  • M Offline
                    M Offline
                    mirko314
                    wrote on last edited by
                    #9

                    @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}}
                    
                    martinhjelmareM 2 Replies Last reply
                    0
                    • M mirko314

                      @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}}
                      
                      martinhjelmareM Offline
                      martinhjelmareM Offline
                      martinhjelmare
                      Plugin Developer
                      wrote on last edited by
                      #10

                      @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.

                      1 Reply Last reply
                      0
                      • M mirko314

                        @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}}
                        
                        martinhjelmareM Offline
                        martinhjelmareM Offline
                        martinhjelmare
                        Plugin Developer
                        wrote on last edited by
                        #11

                        @mirko314

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

                        1 Reply Last reply
                        0
                        • M Offline
                          M Offline
                          mirko314
                          wrote on last edited by
                          #12

                          @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.

                          martinhjelmareM 1 Reply Last reply
                          0
                          • M mirko314

                            @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.

                            martinhjelmareM Offline
                            martinhjelmareM Offline
                            martinhjelmare
                            Plugin Developer
                            wrote on last edited by
                            #13

                            @mirko314

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

                            1 Reply Last reply
                            0
                            • martinhjelmareM Offline
                              martinhjelmareM Offline
                              martinhjelmare
                              Plugin Developer
                              wrote on last edited by martinhjelmare
                              #14

                              @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:

                              1 Reply Last reply
                              0
                              • M Offline
                                M Offline
                                mirko314
                                wrote on last edited by
                                #15

                                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?

                                1 Reply Last reply
                                0
                                • martinhjelmareM Offline
                                  martinhjelmareM Offline
                                  martinhjelmare
                                  Plugin Developer
                                  wrote on last edited by
                                  #16

                                  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:

                                  1 Reply Last reply
                                  0
                                  • M Offline
                                    M Offline
                                    mirko314
                                    wrote on last edited by
                                    #17

                                    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:

                                    martinhjelmareM 1 Reply Last reply
                                    0
                                    • M mirko314

                                      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:

                                      martinhjelmareM Offline
                                      martinhjelmareM Offline
                                      martinhjelmare
                                      Plugin Developer
                                      wrote on last edited by
                                      #18

                                      @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.

                                      1 Reply Last reply
                                      0
                                      • martinhjelmareM Offline
                                        martinhjelmareM Offline
                                        martinhjelmare
                                        Plugin Developer
                                        wrote on last edited by
                                        #19

                                        Update: Bugfix release 0.11.1 is now out.

                                        1 Reply Last reply
                                        0
                                        • M Offline
                                          M Offline
                                          mirko314
                                          wrote on last edited by
                                          #20

                                          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?

                                          1 Reply Last reply
                                          0
                                          Reply
                                          • Reply as topic
                                          Log in to reply
                                          • Oldest to Newest
                                          • Newest to Oldest
                                          • Most Votes


                                          17

                                          Online

                                          11.7k

                                          Users

                                          11.2k

                                          Topics

                                          113.1k

                                          Posts


                                          Copyright 2025 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
                                          • Login

                                          • Don't have an account? Register

                                          • Login or register to search.
                                          • First post
                                            Last post
                                          0
                                          • MySensors
                                          • OpenHardware.io
                                          • Categories
                                          • Recent
                                          • Tags
                                          • Popular