Page 1 of 1

dashticz - time to work

Posted: Monday 04 November 2019 13:10
by abaratian
Hi,
I'm new to dashticz I wanna add a block that shows my transit time to work or other places.
I am using a local service. In the documentation it says i should send a GET request:

Code: Select all

GET:
	https://api.neshan.org/v2/direction?parameters
Headers:
	Api-Key: YOUR_API_KEY
the parameters are origin and destination as: latitude,longitude.

then the result would be

Code: Select all

{
  "routes": [
    {
      "legs": [
        {
          "summary": "آزادی - ولیعصر",
          "distance": {
            "value": 8998,
            "text": "۹ کیلومتر"
          },
          "duration": {
            "value": 2012,
            "text": "۳۴ دقیقه"
          },
          "steps": [
            {
              "name": "عضدی جنوبی",
              "instruction": "در جهت شرق در عضدی جنوبی قرار بگیرید",
              "distance": {
                "value": 46,
                "text": "۴۶ متر"
              },
              "duration": {
                "value": 11,
                "text": "کمتر از ۱ دقیقه"
              },
              "polyline": "qxu|EkpcjJb@{@Tc@b...",
              "maneuver": "depart",
              "start_location": [
                51.344035,
                35.695452
              ]
            }
          ]
        }
      ],
      "overview_polyline": {
        "points": "qwzxEgckxHBeAWEDq ..."
      }
    }
  ]
}
from this list i want to display "summary" and duration "value" which is in seconds converted to hours:minutes on my dashboard like this:
It will take you HH:MM to work using THE_NAME_OF_THE_ROAD.

My js knowledge is pretty basic (zero to be honest) and can't figure out how to do this.
can any one help?

Re: dashticz - time to work

Posted: Saturday 09 November 2019 16:06
by abaratian
Hi,
I did in domoticz using dzvents with a dummy text device.

CLOSED