Yes
3030304D4950302D30303A30303A30322E3030302C302E302C302E302C302C302E302C302C302C302C302C302C302C302C302C302C302C302C302C302E302C302C302C302C302C302C302E3030302C32353135392E35352C3237313630362E352C302C302C302C302C302E302C2A2C302E3030302C2A2C2A2C333237362E382C302E302C302C302E3030300D0A3030304D495054312C302E302C302E302C302E302C302E302C302C302C302C302C302E302C302C302E302C302C342C302E302C302E302C302E302C302E302C302E302C302C302E302C302C332C302C302C302C302C302C302E302C30300D

    So if your original device message looks like that:

    {"attr":"3030304D4950302D..."}

    Then with pvm code .attr ==> %hexstr ==> #decoded.attr you will get that resulting message:

    {"attr":"3030304D4950302D...","decoded.attr":"000MIP0-..."}

    If you need to break down that HEX-decoded string into separate parameters - you have to know how those parameters are encoded in your string

    Yes, Thanks
    It's My Result

    can i have a way to map it i mean to convert it as a
    key: value
    to exemple

    {
    key_1 : 000MIPT1,
    Key_2:0,
    Key_3:0,
    }
    like this ?

      5 days later

      kial Hi

      thank you for your reply
      I want to ask you about this code ".attr ==>% hexstr ==> #decoded.attr"
      I'm just making sure befor run it
      Now , my attribute name is "paylod"

      If in my code it should be like this;
      .paylod ==>% hexstr ==> # decoded.paylod
      the correct ?

      • kial replied to this.

        kial
        thank you for your reply ,
        Yes the point is, how should these exceptions be handled with extra flespi code, can I find a way to do it?

          • Edited

          SouhailOusbouane-Bakioui Yes, but without extra spaces after % and #: .paylod ==> %hexstr ==> #decoded.paylod
          By the way, you can use any suitable name like this: ... ==> #result_property

            Is it a plugin that runs just before the data is entered into the database? Or should every request be worked by a REST API event attribute saved in the database in hex format?
            I mean if I have an old value in hexadecimal form, and when I make a request by a REST API, should the plugins work? Or just work with new data ?

            SouhailOusbouane-Bakioui Plugins work only with real-time data, there is no built-in feature to apply plugins to data already stored in the flespi device.

              9 days later

              Hi
              how can i calculate the power of a number in PVM ?

                for example : 2 ^ 2 =4
                raising to the power 2

                • kial replied to this.

                  ok, i have a problem with the division x /y
                  example : 3 / 2 should equal to 1.5 but the result is 1
                  how can i solve this problem ?

                    6 days later

                    AminaBALAMHITOU We have added math.pow[...] to pvm. So with following plugin code:

                    .value ==> math.pow[.power] ==> #result

                    The message {"power":10,"value":2} will be transformed into {"power":10,"result":1024,"value":2}

                    6 months later
                    Write a Reply...