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. New sensor ID-s when changing network

New sensor ID-s when changing network

Scheduled Pinned Locked Moved Home Assistant
8 Posts 4 Posters 774 Views 4 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.
  • pvojP Offline
    pvojP Offline
    pvoj
    wrote on last edited by
    #1

    I've controlled my nodes from HA in the last some years (I was happier with domoticz, anyway). After some hardware difficulties, I had to replace the Arduino in the serial gateway. Now I have a new gateway hardware and plugged into a different USB which runs Home Assistant.
    The result: I have new devices and entity id-s. Great.
    Do I need to rewrite all of my scripts, automations, templates, etc...?
    Is there any solution to this problem?

    1 Reply Last reply
    0
    • E Offline
      E Offline
      ejlane
      wrote on last edited by
      #2

      I don't know if there's a way to do it from the Home Assistant side, but it's always possible to hard-code the ID of each individual 'sensor' when you're programming it. If you want them to never change, this is a way, and maybe the only way to do it. (I don't really know, but it's the only way that I know of.)

      According to this page: https://www.mysensors.org/download/sensor_api_20

      You set MY_NODE_ID to the ID you want and you should be good.

      #define MY_NODE_ID 12 // or whatever number you want...
      
      mfalkviddM pvojP 2 Replies Last reply
      0
      • E ejlane

        I don't know if there's a way to do it from the Home Assistant side, but it's always possible to hard-code the ID of each individual 'sensor' when you're programming it. If you want them to never change, this is a way, and maybe the only way to do it. (I don't really know, but it's the only way that I know of.)

        According to this page: https://www.mysensors.org/download/sensor_api_20

        You set MY_NODE_ID to the ID you want and you should be good.

        #define MY_NODE_ID 12 // or whatever number you want...
        
        mfalkviddM Offline
        mfalkviddM Offline
        mfalkvidd
        Mod
        wrote on last edited by
        #3

        @ejlane I don't think setting node id helps if Home Assistant think there is a new gateway. A new gateway means a new MySensors network (parallel to the earlier network). Since people could have any number of MySensors gateways connected at the same time, a MySensors node is identified not only by its node id, but by its gateway (address/path) and its node id.

        In Domoticz, the correct way is to replace the old gateway with the new gateway, instead of adding the new gateway. I don't know if HA has a similar concept but it should.

        E 1 Reply Last reply
        1
        • mfalkviddM mfalkvidd

          @ejlane I don't think setting node id helps if Home Assistant think there is a new gateway. A new gateway means a new MySensors network (parallel to the earlier network). Since people could have any number of MySensors gateways connected at the same time, a MySensors node is identified not only by its node id, but by its gateway (address/path) and its node id.

          In Domoticz, the correct way is to replace the old gateway with the new gateway, instead of adding the new gateway. I don't know if HA has a similar concept but it should.

          E Offline
          E Offline
          ejlane
          wrote on last edited by ejlane
          #4

          @mfalkvidd Oh, that kind of issue didn't even occur to me. I was thinking that it was still showing up as the same mysensors network, but that now what used to be sensor 10 was now 3 or whatever.

          Yeah, my suggestion wouldn't help if Home Assistant sees this as a totally new connection/profile/whatever.

          And I use Home Assistant, and I've changed gateways, but I'm always tinkering, so I change things often, and it was no big deal for what I do to go from one to the other. I don't remember having any issues with this. (Could be I still did, but it was a minor enough problem, compared to other big issues, that I simply forgot about it.)

          But I don't have an easy way to test going from one to the other right now. I don't have a spare gateway to test on. :(

          1 Reply Last reply
          1
          • mfalkviddM Offline
            mfalkviddM Offline
            mfalkvidd
            Mod
            wrote on last edited by
            #5

            I think that HA would keep the entities and ids if it was aware that the new gateway was a replacement of the old gateway.

            pvojP 1 Reply Last reply
            1
            • E ejlane

              I don't know if there's a way to do it from the Home Assistant side, but it's always possible to hard-code the ID of each individual 'sensor' when you're programming it. If you want them to never change, this is a way, and maybe the only way to do it. (I don't really know, but it's the only way that I know of.)

              According to this page: https://www.mysensors.org/download/sensor_api_20

              You set MY_NODE_ID to the ID you want and you should be good.

              #define MY_NODE_ID 12 // or whatever number you want...
              
              pvojP Offline
              pvojP Offline
              pvoj
              wrote on last edited by
              #6

              @ejlane
              As it is mentioned above, it seems to be a new network for HA, since it has a new gateway. I also use fixed IDs in the network. It's a great feature.

              1 Reply Last reply
              0
              • mfalkviddM mfalkvidd

                I think that HA would keep the entities and ids if it was aware that the new gateway was a replacement of the old gateway.

                pvojP Offline
                pvojP Offline
                pvoj
                wrote on last edited by
                #7

                @mfalkvidd said in New sensor ID-s when changing network:

                gateway

                A network ID provided by MySensors gateway would be a good solution to solve this problem. Unfortunately I do not expect any development activity in the project. It seems to be dead in the last few years. :(

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  JeeLet
                  wrote on last edited by JeeLet
                  #8

                  yes HA or (Hassio ) and not very friendly with MySensors.

                  the "Persistence" function of the sensors and the rewriting of the sketches ( for the validation of the messages) and a constraint.
                  Persistance

                  No MyS is not dead, we are La!
                  and for "Do I have to rewrite all my scripts, automations, models, etc..." ... it is perhaps the safest, cleanest...

                  give us the result! Ask on the HA/Hassio forum for a solution?

                  you are in mode #define MY_NODE_ID "static" for the nodes??

                  1 Reply Last reply
                  0

                  Hello! It looks like you're interested in this conversation, but you don't have an account yet.

                  Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

                  With your input, this post could be even better 💗

                  Register Login
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  24

                  Online

                  12.0k

                  Users

                  11.2k

                  Topics

                  113.4k

                  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