Sensor last update in local API

Moderator: Telldus

Post Reply
kipe
Posts: 1
Joined: Mon Mar 12, 2018 6:58 pm

Sensor last update in local API

Post by kipe » Mon Mar 12, 2018 7:04 pm

Hey,

I've just started experimenting with the local (HTTP) API. First of all, the documentation for it sucks. I can't understand how the documentation can be nearly non-existent. I have to bounce around testing the Live API, reading the documentation of old C API etc. Without being used to the old C API found in Tellstick Duo, I would have been totally lost.

But once I got around the issues with documentation, I ran into an interesting issue... There is no information about the last update of sensor value in the local API at all. This information is fairly critical to estimate if the sensor value should be trusted or not, especially when using the values to set the state of heating etc.

Is there any workaround to get the last update time of a sensor?

-Kipe

etompau
Posts: 2118
Joined: Thu Jan 18, 2018 11:08 am
Location: Skåne

Re: Sensor last update in local API

Post by etompau » Wed Mar 14, 2018 7:35 am

I think this is "by design".

kamsvag
Posts: 62
Joined: Thu Jan 18, 2018 11:08 am

Re: Sensor last update in local API

Post by kamsvag » Sun Mar 18, 2018 8:04 pm

Are you refering to the fact that there's missing a keypair for time in the JSON object i agree. If that's not what you refer to, please explain further.

I've build functions for Node Red to access the local API and a Python script. You can have them booth if that helps.

This is sample output from my python script.

Code: Select all

    {
      "battery": 100,
      "id": 77,
      "model": "n/a",
      "name": "MoSens.Ute.Frontdoor",
      "novalues": true,
      "protocol": "zwave",
      "sensorId": 77
    },

kamsvag
Posts: 62
Joined: Thu Jan 18, 2018 11:08 am

Re: Sensor last update in local API

Post by kamsvag » Mon Mar 19, 2018 7:31 am

Might not be the easiest way to solve the issue but you could always simply listen in on the eventListener on the Tellstick. That will provide you with all the sensor data the telldus hears.

The syntax is not as easy to read as a JSON object but it's fully possible.

erikture
Posts: 11
Joined: Thu Jan 18, 2018 11:08 am

Re: Sensor last update in local API

Post by erikture » Mon Apr 30, 2018 12:10 pm

I have had a discussion with the support about this. The problem is that the last update value is not exported in the local api. The value exists. They say that they have no plan when it can be fixed.

I have tried to implement it my self, I do not think that it is that much work. Just a few lines of code. The problem is how to test it?
I have installed a local tellstick server on a Ubuntu machine and deployed my changes, but I do not have any sensors that reports values to it. I have tried to install the yr plugin localy but with no success.

If somebody has a working testenvironment please tell me! I can send my changes and maybe somebody can test them.

Post Reply