Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. English
    3. Error/Bug
    4. [solved] Change enums object order

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    [solved] Change enums object order

    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      MartiMan last edited by MartiMan

      Hi all,

      I'm using the Enums entries as an array to update them with my PLC with the S7 adapter so their order is very important.

      d38f657f-8769-4c2f-9205-9fb325236f86-image.png

      There are sometimes more than 20 objects in there, now I forgot one in the beginning but it's impossible to move or rearrange them although clearly a little hand appears when you hover over the "state" icon.

      Is there a way to rearrange them using a file editor in a json file or so?
      Was looking in the ioBroker folders but can't find anything...

      Thanks in advance!

      Homoran 1 Reply Last reply Reply Quote 0
      • Homoran
        Homoran Global Moderator Administrators @MartiMan last edited by

        @martiman sagte in Change enums object order:

        Is there a way to rearrange them

        I don't think so. I guess they are sorted alphabetically.

        M 1 Reply Last reply Reply Quote 0
        • M
          MartiMan @Homoran last edited by

          @homoran No not alphabetically, they are put there in order as you place them.
          If you miss one in the beginning you have to delete all the ones after and start all over 🤣

          Homoran 1 Reply Last reply Reply Quote 0
          • Homoran
            Homoran Global Moderator Administrators @MartiMan last edited by

            @martiman sagte in Change enums object order:

            they are put there in order as you place them.

            so I'm very sorry, that I cannot help you.
            I just tried to play with some entries, but no success.

            Maybe another user who works with enums cann help.

            M 1 Reply Last reply Reply Quote 0
            • Jey Cee
              Jey Cee Developer last edited by

              It is possible to sort it, as the enums are objects.
              Activate the expert mode, go to objects tab, enum and look for the object of enum group you want to edit.
              Then open the object raw by clicking on the end of the line. There you will find the members array, which is what you are looking for.

              You can automate the sorting with a javascript, while in the settings of the javascript adapter the setObject is checked.

              Homoran M paul53 3 Replies Last reply Reply Quote 1
              • M
                MartiMan @Homoran last edited by

                @homoran Thanks for your effort, anyway I'm doing it by hand now checking 3 times each time adding 😆
                But because of the little hand it looks like the possibility in arranging them was meant to be the plan but simply not implemented yet.
                Therefore my message.

                1 Reply Last reply Reply Quote 0
                • Homoran
                  Homoran Global Moderator Administrators @Jey Cee last edited by

                  @jey-cee that was what I remembered, but I didn't find the listing (in enums 🤦 )

                  M 1 Reply Last reply Reply Quote 0
                  • M
                    MartiMan @Jey Cee last edited by

                    @jey-cee Awesome!!! Thanks, didn't think of expert mode was necessary to show enums in objects 😉
                    👍

                    1 Reply Last reply Reply Quote 0
                    • paul53
                      paul53 @Jey Cee last edited by

                      @jey-cee sagte: You can automate the sorting with a javascript, while in the settings of the javascript adapter the setObject is checked.

                      const idBat = 'enum.functions.HeatingUp.BatStat';
                      const obj = getObject(idBat);
                      obj.common.members.sort();
                      setObject(idBat, obj);
                      
                      1 Reply Last reply Reply Quote 0
                      • M
                        MartiMan @Homoran last edited by

                        @homoran For me this issue can be closed, can I or does a moderator have to de this?

                        Homoran 1 Reply Last reply Reply Quote 0
                        • Homoran
                          Homoran Global Moderator Administrators @MartiMan last edited by

                          @martiman sagte in Change enums object order:

                          can I

                          edit the first post and set [solved] at the start of the title

                          1 Reply Last reply Reply Quote 1
                          • First post
                            Last post

                          Support us

                          ioBroker
                          Community Adapters
                          Donate

                          549
                          Online

                          31.8k
                          Users

                          80.0k
                          Topics

                          1.3m
                          Posts

                          4
                          11
                          1724
                          Loading More Posts
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes
                          Reply
                          • Reply as topic
                          Log in to reply
                          Community
                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                          The ioBroker Community 2014-2023
                          logo