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 ?
SouhailOusbouane-Bakioui yes, is possible if you can describe a way to split each value. Please note that you have two lines of the comma-separated value, and some of them are not numbers. How that exceptions should be handled?
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?
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 ?
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
%
#
.paylod ==> %hexstr ==> #decoded.paylod
... ==> #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.
SouhailOusbouane-Bakioui but you may re-post the data back to flespi using this guide: https://flespi.com/kb/how-to-re-post-historical-data
Hi how can i calculate the power of a number in PVM ?
AminaBALAMHITOU Do you mean pow()-like function? https://en.wikipedia.org/wiki/Exponentiation
kial yes i mean this.
for example : 2 ^ 2 =4 raising to the power 2
AminaBALAMHITOU We'll add such a feature the next week
AminaBALAMHITOU We have added math.pow[...] to pvm. So with following plugin code:
math.pow[...]
.value ==> math.pow[.power] ==> #result
The message {"power":10,"value":2} will be transformed into {"power":10,"result":1024,"value":2}
{"power":10,"value":2}
{"power":10,"result":1024,"value":2}
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 ?
AminaBALAMHITOU You can do it like this: 3 / 2.0
3 / 2.0