Help please write a rule

Hey. Help please write a rule.
There is data for the API:
http://trc-api.wialon.com/wialon/ajax.html?svc=core/login&params={“user”:“user”,“password”:“pass”}
I get the data:
{“host”:“211.145.24.223”,“eid”:“5272238b01fce0559513577f3dda11a6”,“au”:“user”,“tm”:1510831508,“wsdk_version”:“1.179”,“base_url”:“https://trc-api.wialon.com",“user”:{“nm”:“werasas”,“cls”:1,“id”:13199392,“prp”:{“addr_provider”:“map_webgis”,“dst”:"-1",“email”:"werser@mail.ru”,“evt_flags”:“3”,“language”:“ru”,“locator”:“1”,“loctok”:“1449576413580”,“locup”:“1”,“m_mc”:“13224988”,“m_ml”:“12”,“mbl_geolocation”:“1”,“mbl_mp_type”:“map_gurtam”,“mbl_ui_visibility”:“1”,“mbl_um_mask”:“Kia Rio*”,“mbl_un_visibility”:“1”,“mbl_ut_msg_params”:“1”,“mbl_ut_sensors”:“1”,“mbl_uv_lst”:“13224988”,“minimap_zoom_level”:“12”,“monuv”:“1”,“msc”:“1”,“mtgis2”:“1”,“mtnavm”:“1”,“mtve”:“1”,“mtwikim”:“1”,“muf”:“10”,“muow”:“13224988”,“otip”:“0”,“radd”:"{“w”:“4”,“c”:0,“u”:13224988,“a”:1,“td”:0,“s”:“0 66ffff;40 0099ff;60 3300ff;90 990099;120 ff0033”,“f”:0}",“show_log”:“0”,“shown”:“13224988”,“sloc”:“13224988”,“svk”:“13224988”,“tz”:“134228528”,“ud”:“1”,“umap”:“OpenStreetMap Mapnik”,“ursstp”:“0x5eff”,“us_addr_fmt”:“1255211008_10_5”,“used_hw”:"{“216940”:2,“315726”:1,“13194033”:5}",“ws”:“2.6.9”},“crt”:0,“bact”:13199391,“mu”:0,“ct”:1446184943,“ftp”:{“ch”:0,“tp”:0,“fl”:0},“fl”:36,“hm”:"",“ld”:1510831508,“pfl”:0,“mapps”:{},“mappsmax”:0,“uacl”:2146947},“classes”:{“avl_hw”:4,“avl_resource”:3,“avl_unit”:2,“avl_unit_group”:5,“user”:1},“features”:{“unlim”:0,“svcs”:{“allow_core_login”:1,“avl_resource”:0,“avl_unit”:1,“create_units”:1,“email_notification”:1,“messages”:1,“notifications”:1,“pois”:1,“sdk”:1,“storage_user”:0,“trace_mobile2”:1,“trace_orange”:1,“unit_commands”:1,“wialon_activex”:1,“wialon_mobile”:1,“wialon_trace_api”:1,“zones_library”:1}}}

Inuously select eid

Then:
http://trc-api.wialon.com/wialon/ajax.html?svc=core/search_item&params={"id":13224999,"flags":1025}&sid=eid

Get:
{“item”:{“nm”:“VW Polo”,“cls”:2,“id”:13224999,“mu”:0,“pos”:{“t”:1510804962,“f”:1073741827,“lc”:0,“y”:25.6809333,“x”:29.8387575,“z”:125,“s”:0,“c”:297,“sc”:18},“lmsg”:{“t”:1510804962,“f”:1073741827,“tp”:“ud”,“pos”:{“y”:25.6809333,“x”:29.8387575,“z”:125,“s”:0,“c”:297,“sc”:18},“i”:0,“lc”:0,“p”:{“param240”:0,“gsm”:0,“param200”:0,“param239”:0,“param250”:0,“pwr_ext”:12.416,“param24”:0,“param205”:0,“cell_id”:0,“battery_charge”:0}},“uacl”:-1},“flags”:1025}

It is necessary to transfer openHAB - pwr_ext

Thanks!

With this Tool you can extract the Values from the Request.

I do this with a Bash Script and write it to Item’s

Here is my Example:

#!/bin/bash

##############################################
#Lautstärke  Airplay Büro (Raum 3) einstellen#
##############################################

VolumeState="$(curl -s GET --header "Accept: application/json" "http://10.10.80.9:8080/rest/items/AP_Volume_Buero" | jq -r '.state')"
curl "http://10.10.80.6/iTunes/iTunes-controller.php?airplay=AP_Volume_Raum3&volume=$VolumeState"

Your Bash Script must request the Value pwr_ext from the Web Service and than send the Value via Rest API to an OpenHab String or Number Item.
The Bash Script can execute with a OpenHab rule … Trigger can be Time Cron

write please for my case

No… try it first yourself … when Problems you can post your Code for Review here …

I can’t test the Code … because I have no Access to your API…

1 Like

Perhaps you can use this …