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. Getting started

Getting started

Scheduled Pinned Locked Moved Home Assistant
21 Posts 6 Posters 4.2k Views 6 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.
  • M Offline
    M Offline
    Misna
    wrote on last edited by
    #1

    Hi all!

    I'm just about to get my first sensor readout to Home Assistant but something is wrong and I need your help.

    I now have Home Assistant running on Raspberry Pi 3 and an Arduino Uno acting as a serial gateway flashed with the example gateway sketch. And one sensor node on Pro Mini with DHT22 attached and flashed with the example DHT sketch.

    From examining the logs I can see that Home Assistant is able to connect to the gateway:
    2017-11-14 22:35:03 INFO (Thread-13) [mysensors.gateway_serial] Trying to connect to /dev/ttyACM0
    2017-11-14 22:35:03 INFO (Thread-13) [mysensors.gateway_serial] /dev/ttyACM0 is open...
    2017-11-14 22:35:03 INFO (Thread-13) [mysensors.gateway_serial] Connected to /dev/ttyACM0

    And I can see that the gateway is talking to Home Assistant
    2017-11-14 22:35:05 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0
    2017-11-14 22:35:05 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT
    2017-11-14 22:35:05 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSF:WUR:MS=0
    2017-11-14 22:35:05 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT:TSP OK
    2017-11-14 22:35:05 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT:GW MODE
    2017-11-14 22:35:05 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSM:READY:ID=0,PAR=0,DIS=0
    2017-11-14 22:35:05 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:MCO:REG:NOT NEEDED
    2017-11-14 22:35:05 INFO (Thread-13) [mysensors] n:0 c:255 t:3 s:14 p:Gateway startup complete.
    2017-11-14 22:35:05 DEBUG (Thread-13) [homeassistant.components.mysensors] Node update: node 0 child 255
    2017-11-14 22:35:05 DEBUG (Thread-13) [homeassistant.components.mysensors] Not a child update for node 0
    2017-11-14 22:35:05 DEBUG (Thread-13) [mysensors] Handle queue with call <bound method SerialGateway.logic of SerialGateway>(('0;255;0;0;18;2.1.0\n',), {}) took 0.190 seconds
    2017-11-14 22:35:05 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:STP
    2017-11-14 22:35:05 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:INIT OK,TSP=1
    2017-11-14 22:35:05 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:

    But after this all that happens is that this goes on over and over
    2017-11-14 22:45:27 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSF:MSG:READ,1-1-0,s=0,c=1,t=1,pt=7,l=5,sg=0:39.6
    2017-11-14 22:45:27 WARNING (Thread-13) [mysensors] Node 1 is unknown
    2017-11-14 22:45:27 INFO (Thread-13) [mysensors] Requesting new presentation for node 1
    2017-11-14 22:45:27 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:!TSF:MSG:SEND,0-0-1-1,s=255,c=3,t=19,pt=0,l=0,sg=0,ft=0,st=NACK:
    2017-11-14 22:45:27 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:INIT GW,CP=RNNGA--,VER=2.1.0
    2017-11-14 22:45:27 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT
    2017-11-14 22:45:27 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSF:WUR:MS=0
    2017-11-14 22:45:27 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT:TSP OK
    2017-11-14 22:45:27 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSM:INIT:GW MODE
    2017-11-14 22:45:27 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:TSM:READY:ID=0,PAR=0,DIS=0
    2017-11-14 22:45:27 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:MCO:REG:NOT NEEDED
    2017-11-14 22:45:27 INFO (Thread-13) [mysensors] n:0 c:255 t:3 s:14 p:Gateway startup complete.
    2017-11-14 22:45:27 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:STP
    2017-11-14 22:45:27 DEBUG (Thread-13) [mysensors] n:0 c:255 t:3 s:9 p:MCO:BGN:INIT OK,TSP=1
    2017-11-14 22:45:27 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:

    Here is my HA configuration:

    mysensors:
      gateways:
        - device: '/dev/ttyACM0'
          baud_rate: 115200
          persistence_file: '/home/homeassistant/.homeassistant/mysensors2.json'
      optimistic: false
      persistence: true
      version: 2.0
      
    logger:
      default: info
      logs:
        homeassistant.components.mysensors: debug
        mysensors: debug
    

    And the contents of the "mysensors2.json" persistence file

    {"0": {"sketch_name": null, "children": {}, "sensor_id": 0, "battery_level": 0, "sketch_version": null, "type": 18, "protocol_version": "2.1.0"}}
    

    So what should I investigate next? Is there perhaps something missing from the example from https://www.mysensors.org/build/humidity ?

    In the example there is defined only child ID's not the node ID's. Shouldn't these come from the controller (HA) ?

    Thanks for your help, I hope you my explanations make sense.

    1 Reply Last reply
    0
    • gohanG Offline
      gohanG Offline
      gohan
      Mod
      wrote on last edited by
      #2

      I'd try to assign a node id in code and see if it works better, later you can investigate how to do auto assign

      1 Reply Last reply
      0
      • M Offline
        M Offline
        Misna
        wrote on last edited by
        #3

        Hi!

        I managed to get the node to work by rebooting everything. Maybe the controller and gateway must be alive before the sensor send its presentation?

        But thanks for the help anyway!

        I'm exited to start building my homeautomation now that I have all the connection working from end to end.

        The first task is to replace my room thermostats with intelligent ones but I think I'll continue it in a different topic.

        Mikko

        martinhjelmareM 1 Reply Last reply
        0
        • M Misna

          Hi!

          I managed to get the node to work by rebooting everything. Maybe the controller and gateway must be alive before the sensor send its presentation?

          But thanks for the help anyway!

          I'm exited to start building my homeautomation now that I have all the connection working from end to end.

          The first task is to replace my room thermostats with intelligent ones but I think I'll continue it in a different topic.

          Mikko

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

          @Misna

          Yes, the controller and gateway needs to be running the first time your present a node and sensor.

          You also might want to look into the power supply and stability of your gateway, since it seemed to reboot when it sent the request for new presentation.

          M 1 Reply Last reply
          0
          • martinhjelmareM martinhjelmare

            @Misna

            Yes, the controller and gateway needs to be running the first time your present a node and sensor.

            You also might want to look into the power supply and stability of your gateway, since it seemed to reboot when it sent the request for new presentation.

            M Offline
            M Offline
            Misna
            wrote on last edited by
            #5

            @martinhjelmare The gateway (Uno) is powered from the USB port of the RPi3 which runs Home Assistant. Should I use a external power supply?

            martinhjelmareM 1 Reply Last reply
            0
            • M Misna

              @martinhjelmare The gateway (Uno) is powered from the USB port of the RPi3 which runs Home Assistant. Should I use a external power supply?

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

              @Misna

              Yes, I would recommend that. From personal experience computer usb powered unos are unstable. Make sure you have a capacitor close to the radio, as recommended in the radio guide on the mysensors site, too.

              M 1 Reply Last reply
              1
              • martinhjelmareM martinhjelmare

                @Misna

                Yes, I would recommend that. From personal experience computer usb powered unos are unstable. Make sure you have a capacitor close to the radio, as recommended in the radio guide on the mysensors site, too.

                M Offline
                M Offline
                Misna
                wrote on last edited by
                #7

                @martinhjelmare ok, I'll get a proper power supply. I have a capasitor welded to the radio module. The gateway has the model with the stick antenna.

                I have tried how far the demo sensor node works (it has the std module with the antenna on the PCB) and it works anywhere in my 3 story house.
                But when I moved it to a building next to my house it didn't work. The distance was maybe 40m.

                Should I experiment with the setting #define MY_RF24_PA_LEVEL ?
                What does this require from the HW?

                gohanG 1 Reply Last reply
                0
                • M Misna

                  @martinhjelmare ok, I'll get a proper power supply. I have a capasitor welded to the radio module. The gateway has the model with the stick antenna.

                  I have tried how far the demo sensor node works (it has the std module with the antenna on the PCB) and it works anywhere in my 3 story house.
                  But when I moved it to a building next to my house it didn't work. The distance was maybe 40m.

                  Should I experiment with the setting #define MY_RF24_PA_LEVEL ?
                  What does this require from the HW?

                  gohanG Offline
                  gohanG Offline
                  gohan
                  Mod
                  wrote on last edited by
                  #8

                  @Misna said in Getting started:

                  stick antenna.

                  Is it a PA LNA version?
                  Btw I guess it is normal that a normal nrf24 can't reach between 2 buildings that far. If you can use 2 PA LNA radios it should work better

                  1 Reply Last reply
                  1
                  • skywatchS Offline
                    skywatchS Offline
                    skywatch
                    wrote on last edited by
                    #9

                    You can of course try pa level max. It might help. As @gohan said, the pa/lna version would also help in this situation. You can also try directional antenna yagi to maximise power in the direction you want it to go (fairly cheap on ebay).

                    What is between the buildings? 40m of free space?

                    Also think about using the 5V power from the uno and going via a buck converter (or any linear or switching voltage regulator) down to 3.3v - the arduino 3.3v supply is notorious for being 'noisy'..

                    M 1 Reply Last reply
                    0
                    • skywatchS skywatch

                      You can of course try pa level max. It might help. As @gohan said, the pa/lna version would also help in this situation. You can also try directional antenna yagi to maximise power in the direction you want it to go (fairly cheap on ebay).

                      What is between the buildings? 40m of free space?

                      Also think about using the 5V power from the uno and going via a buck converter (or any linear or switching voltage regulator) down to 3.3v - the arduino 3.3v supply is notorious for being 'noisy'..

                      M Offline
                      M Offline
                      Misna
                      wrote on last edited by
                      #10

                      @skywatch There is maybe 30m between the buildings and the gateway is on the other side of my house so 10m of indoor space and lots of walls...

                      Yes the gateway has the PA LNA version. I guess it's ok to mix these?

                      I'm taking 5V from the UNO to RF module via this adapter: https://www.aliexpress.com/item/New-Socket-Adapter-plate-Board-for-8Pin-NRF24L01-Wireless-Transceive-module-51/32655936568.html?spm=a2g0s.9042311.0.0.IAzDGk

                      I'm planning to maybe place a couple of nodes to the outside wall of my house so maybe using these as repeaters might solve the problem..

                      At the moment I only have one PA LNA version but I'm about to place an order this weekend.

                      1 Reply Last reply
                      0
                      • gohanG Offline
                        gohanG Offline
                        gohan
                        Mod
                        wrote on last edited by
                        #11

                        Your only option is to have repeaters

                        1 Reply Last reply
                        0
                        • skywatchS Offline
                          skywatchS Offline
                          skywatch
                          wrote on last edited by skywatch
                          #12

                          Here are the directional antenna yagi arrays. You need one each end for best range and they need to be able to 'see' each other (no metal buildings in the way)

                          https://www.ebay.co.uk/itm/2-4GHz-13DBI-15DBI-Yagi-WLAN-WiFi-Wireless-Antenna-for-Router-A1Q5/112448960487?epid=2078505269&hash=item1a2e7af7e7:g:HhIAAOSwwzhZSDda

                          Wiht two of these and 2 pa/lna boards you should get many km in open space!!!

                          hth

                          1 Reply Last reply
                          0
                          • gohanG Offline
                            gohanG Offline
                            gohan
                            Mod
                            wrote on last edited by
                            #13

                            The problem is that you would use signal around that antenna if you have other sensors in the building

                            1 Reply Last reply
                            0
                            • skywatchS Offline
                              skywatchS Offline
                              skywatch
                              wrote on last edited by
                              #14

                              @gohan,

                              My intention was for @minsa to use this only for the long range link, the receiving pro=mini could be a gw for the garage sensor(s). Everything else would remian the same.

                              M 1 Reply Last reply
                              0
                              • skywatchS skywatch

                                @gohan,

                                My intention was for @minsa to use this only for the long range link, the receiving pro=mini could be a gw for the garage sensor(s). Everything else would remian the same.

                                M Offline
                                M Offline
                                Misna
                                wrote on last edited by
                                #15

                                @skywatch So I would have 2 gateways? One for indoor sensors and one for outdoor sensors?

                                Would it be possible to have NRF24 and RFM69 chips on the same gateway?
                                So I could use the RFM69 with nodes that are farther away?

                                zboblamontZ skywatchS gohanG 3 Replies Last reply
                                0
                                • M Misna

                                  @skywatch So I would have 2 gateways? One for indoor sensors and one for outdoor sensors?

                                  Would it be possible to have NRF24 and RFM69 chips on the same gateway?
                                  So I could use the RFM69 with nodes that are farther away?

                                  zboblamontZ Offline
                                  zboblamontZ Offline
                                  zboblamont
                                  wrote on last edited by
                                  #16

                                  @Misna Look at the Sensebender Gateway...

                                  1 Reply Last reply
                                  0
                                  • M Misna

                                    @skywatch So I would have 2 gateways? One for indoor sensors and one for outdoor sensors?

                                    Would it be possible to have NRF24 and RFM69 chips on the same gateway?
                                    So I could use the RFM69 with nodes that are farther away?

                                    skywatchS Offline
                                    skywatchS Offline
                                    skywatch
                                    wrote on last edited by
                                    #17

                                    @Misna

                                    Adding a gateway means that your current system stays the same and is not changed in any way - so you have time to experiment with the new additions.

                                    I have never used rfm69 so can't say on those, sorry.

                                    I will say that you probably can't have 2 radios on one gw. But it might be possible.
                                    With MyController you can have multiple gateways for the controller and that is what you will need.
                                    As per above, I would just add another pro mini to act as a second gw for the longer range testing as that will not impact on your current setup.

                                    rejoe2R 1 Reply Last reply
                                    0
                                    • skywatchS skywatch

                                      @Misna

                                      Adding a gateway means that your current system stays the same and is not changed in any way - so you have time to experiment with the new additions.

                                      I have never used rfm69 so can't say on those, sorry.

                                      I will say that you probably can't have 2 radios on one gw. But it might be possible.
                                      With MyController you can have multiple gateways for the controller and that is what you will need.
                                      As per above, I would just add another pro mini to act as a second gw for the longer range testing as that will not impact on your current setup.

                                      rejoe2R Offline
                                      rejoe2R Offline
                                      rejoe2
                                      wrote on last edited by
                                      #18

                                      @skywatch said in Getting started:

                                      e 2 radios on one gw. But it might be possible.

                                      At least by now, one can only use one transport layer per Node/Gateway.

                                      Controller: FHEM; MySensors: 2.3.1, RS485,nRF24,RFM69, serial Gateways

                                      1 Reply Last reply
                                      0
                                      • M Misna

                                        @skywatch So I would have 2 gateways? One for indoor sensors and one for outdoor sensors?

                                        Would it be possible to have NRF24 and RFM69 chips on the same gateway?
                                        So I could use the RFM69 with nodes that are farther away?

                                        gohanG Offline
                                        gohanG Offline
                                        gohan
                                        Mod
                                        wrote on last edited by
                                        #19

                                        @Misna said in Getting started:

                                        stick antenna.

                                        Is it a PA LNA version?
                                        Btw I guess it is normal that a normal nrf24 can't reach between 2 buildings that far. If you can use 2 PA LNA radios it should work better

                                        you can compile and run 2 different instances of the raspberry gateway in 2 separate folders. There is an openhardware project for a raspberry hat

                                        M 1 Reply Last reply
                                        0
                                        • gohanG gohan

                                          @Misna said in Getting started:

                                          stick antenna.

                                          Is it a PA LNA version?
                                          Btw I guess it is normal that a normal nrf24 can't reach between 2 buildings that far. If you can use 2 PA LNA radios it should work better

                                          you can compile and run 2 different instances of the raspberry gateway in 2 separate folders. There is an openhardware project for a raspberry hat

                                          M Offline
                                          M Offline
                                          Misna
                                          wrote on last edited by
                                          #20

                                          @gohan ok but at the moment the gateway runs on Arduino Uno. So I have to switch to RasPi?
                                          Or can I buy another Uno and use RFM69 with it? But does Home Assistant support multiple MySensors gateways?

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


                                          13

                                          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