1

retrieve the value of a parameter:

Тема: retrieve the value of a parameter:

Hello I am trying to retrieve the value of a parameter: The only thing I found is this:

https://sdk.wialon.com/wiki/en/sidebar/ … lc_sensors
svc=unit/calc_sensors&params={"source":<text>,
                  "indexFrom":<uint>,
                  "indexTo":<uint>,
                  "unitId":<long>,
                  "sensorId":<long>,
                  "width":<uint>}
I understand all the parameters except source ??? I find it or source and what is it ???
There is no more example
please ;-)

2

retrieve the value of a parameter:

Re: retrieve the value of a parameter:

I tryed... and many ....
{
                  "source":"",
                  "indexFrom":1607385600,
                  "indexTo":1607528711,
                  "unitId":id,
                  "sensorId":111_183,
       
                }

return an empty array or ....
  error: 4,
  reason: 'VALIDATE_PARAMS_ERROR: {source: text, indexFrom: uint, indexTo: uint, unitId: long, sensorId: long}'
}

3

retrieve the value of a parameter:

Re: retrieve the value of a parameter:

Hello!

If you need to get parameter with it's value (raw value) you can just get messages - please look example here https://sdk.wialon.com/wiki/en/sidebar/ … s/messages

To get sensor's values via request svc=unit/calc_sensors, first it needs to load messages to loader.
For this you can execute request load messages ( see request in example above)
Then execute request svc=unit/calc_sensors , where "source":"" means default loader which used for load messages.
Please note sensor id is number like '1', '2' and etc. To get all sensor is used "sensorId":0

For example,

https://hst-api.wialon.com/wialon/ajax.html?svc=messages/load_interval&params={"itemId":214,"timeFrom":1607589900,"timeTo":1607589995,"flags":1,"flagsMask":65281,"loadCount":6}&sid=027cb1c8f0b3c7b745963fc
https://hst-api.wialon.com/wialon/ajax.html?svc=unit/calc_sensors&params={"source":"","indexFrom":0,"indexTo":5,"unitId":214,"sensorId":0}&sid=027cb1c8f0b3c7b25745963fc
Diana Cheley
Wialon Hosting Expert
Gurtam