Skip to main content
7-Bedrock
June 29, 2023
Solved

trouble with queryPropertyHistory

  • June 29, 2023
  • 1 reply
  • 1668 views

Hello, i need to get a single value and timestamp from the service, and i have trouble understanding the documentation - as in I can't seem to get it to work.

The properties the service gets are as following:

MA_10062204_0-1688050340468.png

The output should be an infotable containing "timestamp" and "Modbus_Demobox2_kW", which is defined in a datashape.

My main Problem is filtering right -- what do I have to do?

 

 

 

Best answer by nmutter

I think you are searching the service called "QueryNumberPropertyHistory" where you can pass in the propertyname "Modbus_Demobox2_kW" and maxItems set to "1." and oldestFirst "false"

 

1 reply

nmutter16-PearlAnswer
16-Pearl
June 29, 2023

I think you are searching the service called "QueryNumberPropertyHistory" where you can pass in the propertyname "Modbus_Demobox2_kW" and maxItems set to "1." and oldestFirst "false"

 

7-Bedrock
July 7, 2023

Well, it worked. It wasn't really what I was asking for, but I made it work. So, thanks I guess 🙂

16-Pearl
July 7, 2023

Maybe I did not understand the question correctly then. I understood you wanted a service which will return "timestamp" and "value" of a property.

 

There is also service GetPropertyValuesVTQ (returns Value Time Quality for ALL properties of the thing), or GetNamedPropertyValuesVTQ where you can specify which properties you want.

I was searching for a GetPropertyVTQ(propertyName) but such a service does not seem to exist. So I thought the proposed solution with maxItems=1 would be easiest.

What were you searching for? Maybe you can add some code and what you would expect it to do so I can better understand.