I am using your powershell models and they work great. Big thanks for sharing!

\Masonit
Moderator: Telldus
Sadly, there is no function to call for sensor history afaik, I have made a cmdlet/function for the detvice history though, the full module is available at github:ArneG wrote:Will there be any Get-TDSensorHistory soon ? The data from Telldus Live may be available now like it is with the Device-History ?
Hey, look at that! CoolArneG wrote:I know. I''m collecting devicehistory via that cmdlet on a regular basis. I also do poll the sensors via TD-GetSensor every 15 minutes or so, and that way collecting/storing my own sensorhistory locally via a simple Delphi-application that I've hacked together...But it would be nice to get this historical data directly from the Live-server the same way as for the device-history, and they are indeed betatesting this now. (http://live.telldus.com/sensor/index2). So Telldus Live server IS indeed storing such sensorhistory (You have to enabled the storing of historydata per device via 'Edit sensor'). Is there any way to pull off this history from the Live-server via a cmdlet?
Sorry for taking so long... I started this and then sadly forgot about it... Anyway, new version available at:ArneG wrote:The cmdlet for the sensorhistory data is collecting the complete history available on the telldusserver each time. This results in a lot of duplicate sensordata when the cmdlet is uses to poll the telldus server on a regular basis. Of course it is no problem handling/filtering out duplicate sensordata-reading/entries when dealing with the data locally afterwards.
But maybe you could modify the Cmdlet a bit so that the script using the sensorhistory-cmdlet can pass along a date/time-stamp along with the sensor-id to the cmdlet to only pull the sensorreadings on and after that given datestamp? Like pseudocode: "no need for getting those data I've already got, I only need the last few NEW entries since last poll"
Glad it works!ArneG wrote:Thanks. Works fine appearanty![]()
Btw: maybe the example in the code should reflect that the cmdlet uses UTC times (since the timedata from Telldus live is in UTC, and getdate() returns local time by default)
Same thing different wrapping?c8h10n4o2 wrote:
Glad it works!
Hmm... I think I see your point. The way it works now will make sure the user will get the expected data back from Telldus Live (converts the date you add to UTC). What I really should do though is convert the returned dates to the local time for the whole thing to make more sense (or the time zone of the tellstick really). It's supported in the API but I've been a bit lazy...
Did I understand you correctly? That it's a bit inconsistent currently?
Would returning the local time or just ask for UTC time as input be preferred?