• Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular

    Field Label SensorID and spaghetti

    General Discussion
    2
    19
    175
    Loading More Posts
    • 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.
    • J
      JeeLet last edited by JeeLet

      I can't figure out how
      field details:
      labels: --> name: My Relay ???

      • in the file Field Details
        "...
        fieldId: V_STATUS
        name: Relay
        metricType: binary
        ....
        labels:
        ms_node_id: '32'
        ms_sensor_id: '3'
        ms_type: '2'
        ms_type_string: V_STATUS
        ..."

      • And the file Wideget Yaml
        ".....
        resource:
        filters:
        metricType: binary
        labels_name: relay
        limit: 10
        nameKey: name
        type: field
        tableView: true
        type: switch_button

        .."

      good stop for tonight, see you tomorrow.
      bybye

      jkandasa 1 Reply Last reply Reply Quote 0
      • jkandasa
        jkandasa @JeeLet last edited by

        @jeelet

        I don't know how to do that, it's too far for me 😞

        np, I will create an issue

        1 Reply Last reply Reply Quote 0
        • jkandasa
          jkandasa @JeeLet last edited by

          @jeelet said in Field Label SensorID and spaghetti:

          I can't figure out how

          edit the field details and add new label name: My Relay

          Example:
          30afa773-8023-421d-b182-74f081a18af0-image.png

          0dffb5e5-d887-4102-b890-a1f37d1dbdb3-image.png

          1 Reply Last reply Reply Quote 0
          • J
            JeeLet last edited by

            Hello

            Sorry but "Update Resource" is not found 😞

            texte du lien

            houlala

            quote 🙂
            Patience and length of time
            Is more than strength or rage."

            jkandasa 1 Reply Last reply Reply Quote 0
            • jkandasa
              jkandasa @JeeLet last edited by jkandasa

              @jeelet

              Sorry but "Update Resource" is not found 😞

              I took the screenshot from different widget
              Please update Name Key as labels.name


              If you like to use custom name, you should include a label ignore_name: true
              aff5d907-328b-451a-aab0-90a80e33e5be-image.png

              1 Reply Last reply Reply Quote 0
              • J
                JeeLet last edited by

                🙂 YAML View is good

                • Edit Widget Settings
                 resource:
                    filters:
                      metricType: binary
                      name: relay
                    limit: 10
                    nameKey: labels.name
                    type: field
                  tableView: true
                  type: switch_button
                
                • Field Details
                ..  
                odeId: '32'
                sourceId: '3'
                fieldId: V_STATUS
                name: relay
                metricType: binary
                ...
                labels:
                  ignore_name: 'true'
                  ms_node_id: '32'
                  ms_sensor_id: '3'
                  ms_type: '2'
                  ms_type_string: V_STATUS
                  name: relay
                  ...
                

                beautiful , working cella

                I'll put the explanation in writing

                Thanks a lot jkandasa

                1 Reply Last reply Reply Quote 0
                • J
                  JeeLet last edited by JeeLet

                  the updated tutorial sheet

                  • an example for the relay is put in picture,
                    but it's the same for the door sensor.
                    so in red and pink the elements to add.
                    in green it's the MySensors sketch that puts them together by itself

                  • the important part so that the name is not changed

                  " jkandasa@ you like to use custom name, you should include a label "

                  ignore_name: true
                  

                  well the continuation 😉

                  texte du lien

                  jkandasa 1 Reply Last reply Reply Quote 0
                  • jkandasa
                    jkandasa @JeeLet last edited by

                    @jeelet No need to update both name and labels.name, you can use either.

                    • if you use name, you should add labels.ignore_name: 'true'
                    • otherwise you can use the labels.name directly
                    1 Reply Last reply Reply Quote 0
                    • J
                      JeeLet last edited by JeeLet

                      In the Widgets the options arrive at a speed too fast for my little brain, I can follow, but it's superhuman 🙂

                      Here is a picture of the new options: texte du lien

                      two questions:
                      what value to write in the

                      • Timestamp Key (what is it?)
                        and the
                      • Payload

                      in the SendPayload
                      the name "true" can be changed ?

                      • it's how to have a state, a return of state of a button which changes of color.
                        Red : default
                        Orange : On
                        Blue : Off

                      is there someone who can help you with the Documentation ?
                      how to set up MyController !

                      Nice work

                      (for information, next week I will be absent)

                      J jkandasa 2 Replies Last reply Reply Quote 0
                      • J
                        JeeLet @JeeLet last edited by

                        my last words may be confusing

                        the picture idea texte du lien

                        a button that takes several color states
                        (an idea of how difficult it is, it's up to you, and there are surely more important things to do)

                        yes as you are in Widgets it is the right time to do it?

                        jkandasa 1 Reply Last reply Reply Quote 0
                        • jkandasa
                          jkandasa @JeeLet last edited by

                          @jeelet

                          Timestamp Key (what is it?)

                          Timestamp Key used to display Last Seen in the panel.

                          Example:
                          3982c926-4b20-419c-addb-6180237ef1c4-image.png

                          • in field, it can be current.timstamp
                          • in node, it can be lastSeen

                          in the SendPayload
                          the name "true" can be changed ?

                          Yes, you can send anything you want and your node should support for that value
                          for buttons use Toggle Switch or Button Switch, gives better intraction

                          it's how to have a state, a return of state of a button which changes of color.
                          Red : default
                          Orange : On
                          Blue : Off

                          You can not change the button color in off state. it is applicable only for on state and for now it is linked with UI framework, so supports only four types
                          09593d08-1d13-4b41-a6e6-70a79ebcea05-image.png

                          is there someone who can help you with the Documentation ?

                          for now I do not see much contribution from the world. I believe we will get it soon.

                          (for information, next week I will be absent)

                          enjoy your time 🙂

                          1 Reply Last reply Reply Quote 0
                          • jkandasa
                            jkandasa @JeeLet last edited by jkandasa

                            @jeelet

                            my last words may be confusing

                            the picture idea texte du lien

                            a button that takes several color states
                            (an idea of how difficult it is, it's up to you, and there are surely more important things to do)

                            yes as you are in Widgets it is the right time to do it?

                            In MyController, MySensors plugin supports acknowledgement, hence state can not change if there is no acknowledgement received.
                            f21b7576-7c12-438d-97e5-5068e073fa9d-image.png

                            In MyController, you can set retry count to reattempt to send the payload again.
                            Example:
                            9d70d30e-2f04-44e5-a902-09204020a369-image.png

                            1 Reply Last reply Reply Quote 0
                            • J
                              JeeLet last edited by JeeLet

                              hello jkandasa

                              The Relay Controls with MyC work well.
                              switch ON/OFF button perfect 🙂

                              I have added to my sketch the function to turn off the relays when the arduino is restarted.
                              "digitalWrite(PIN_RELAY_1, RELAY_OFF);"

                              and add also

                              "send(msg.set(CHILD_ID_RELAY_1==HIGH ? 1 : 0), true);"
                              to return the information to MyController

                              But in my widget the status remains ON, while the Relay is OFF

                              it's an error in my sketch and I have misconfigured my widget ?

                              Thanks

                              jkandasa 1 Reply Last reply Reply Quote 0
                              • jkandasa
                                jkandasa @JeeLet last edited by

                                @jeelet in your sketch add wait(300); after send(...)
                                and seems some error in your msg.set command,

                                I do not know your sketch, This may not be right solution, hope it should work
                                send(msg.set(digitalRead(PIN_RELAY_1)==HIGH ? 1 : 0));,

                                1 Reply Last reply Reply Quote 0
                                • J
                                  JeeLet last edited by JeeLet

                                  yes yes I saw my mistake after posting 😞

                                  Setup ()
                                  send(msg.set(CHILD_ID_RELAY_1?false:true), true);
                                  or
                                  send(msg.set(digitalRead(PIN_RELAY_1)==HIGH ? 1 : 0));

                                  the 2 possibilities work

                                  at reboot of the Arduino it is functional .
                                  the status of my relay changes well 🙂
                                  thanks
                                  sorry for the inconvenience

                                  jkandasa 1 Reply Last reply Reply Quote 0
                                  • jkandasa
                                    jkandasa @JeeLet last edited by

                                    @jeelet no problem, good to know that it works for you

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

                                    0
                                    Online

                                    647
                                    Users

                                    506
                                    Topics

                                    3.3k
                                    Posts

                                    Copyright © 2015-2022 MyController.org | Contributors | Localization