PowerShell based cmdlets / Commands

Moderator: Telldus

c8h10n4o2
Posts: 73
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 » Thu Jul 19, 2018 9:17 am

Roger that! :-)

ArneG
Posts: 39
Joined: Thu Jan 18, 2018 11:08 am

Re: PowerShell based cmdlets / Commands

Post by ArneG » Thu Jul 19, 2018 9:33 am

Also good to know regarding this issue: The collecting/maintaining of historydata even for ignored sensors still is working as usual (if the 'Save historydata' is checked). :D

So the "Get-TDSensorHistoryData"-function WILL still get the all historydata for both ignored and not ignored sensors (i.e. for ALL sensors that actually have the 'Save historydata' is checked')

ArneG
Posts: 39
Joined: Thu Jan 18, 2018 11:08 am

Re: PowerShell based cmdlets / Commands

Post by ArneG » Thu Jul 19, 2018 9:38 am

A completely different question: Does anyone know why each sensor has its own 'SensorID' in addition to already having its own unique 'DeviceID'. What is it (or can it be) used for? :?:

ArneG
Posts: 39
Joined: Thu Jan 18, 2018 11:08 am

Re: PowerShell based cmdlets / Commands

Post by ArneG » Tue Oct 09, 2018 7:01 am

Having a problem with renaming a telldus device to a name containing country-spesific charachters (in my case norwegian). Works manually via normal web-input on Telldus Live site, but not when using Rename-TDDevice. I think this used to work just fine on older versions. Or maybe Telldus-site/api has changed something..?

c8h10n4o2
Posts: 73
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 » Thu Oct 18, 2018 2:37 pm

Sorry for my late reply, somehow I didn't get any notification about your post, so I just noticed it now.

Anyway, I hope I've fixed that bug now, please update to version 1.1.6 and try again! :) (Update-Module AutomaTD -Force)

Thanks for reporting the bug!

ArneG
Posts: 39
Joined: Thu Jan 18, 2018 11:08 am

Re: PowerShell based cmdlets / Commands

Post by ArneG » Thu Oct 18, 2018 6:34 pm

Same problem with Set-TDSensor and -NewName-switch....

c8h10n4o2
Posts: 73
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 » Thu Oct 18, 2018 7:33 pm

Doh! :banghead:

Of course! Fixed in 1.1.7! Thanks again for reporting :-)

ArneG
Posts: 39
Joined: Thu Jan 18, 2018 11:08 am

Re: PowerShell based cmdlets / Commands

Post by ArneG » Tue Oct 23, 2018 4:27 pm

Both works fine now :)

ArneG
Posts: 39
Joined: Thu Jan 18, 2018 11:08 am

Re: PowerShell based cmdlets / Commands

Post by ArneG » Thu Nov 29, 2018 8:50 am

Soooo...what about getting sensordata other than temperature and humidity? Is it possible and will you fix it?
You see I got this raincollector-thing from Oregon. It is detected just fine on telldus-web interface and it shows values for both current measurement and an average of rain per hours. Both values in millimeters (mm). It does show up in the lists from the different TD-GetSensor*-functions but reports no values for temperature/humidity (obviously because the sensor does not send that data in the first place:)

Willl you look at it? (Such other sensor data than Temp/Hum may also be an deature to take care of for other kind of sensors that the tellstick supports, for instance wind-speed/direction-sensors...)

c8h10n4o2
Posts: 73
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 » Thu Nov 29, 2018 8:58 am

If you store the output from Get-TDSensorData and look in the data-property, do you see the values there?

For example:
$Sensor = Get-TDSensorData -DeviceID 123456789
$Sensor.Data

ArneG
Posts: 39
Joined: Thu Jan 18, 2018 11:08 am

Re: PowerShell based cmdlets / Commands

Post by ArneG » Thu Nov 29, 2018 9:41 am

Yes I do indeed :)

Data : {@{name=rrate; value=875; scale=0; lastUpdated=1543483566; max=875; maxTime=1543482344},
@{name=rtot; value=19.7; scale=0; lastUpdated=1543483566}}

or,

name : rrate
value : 875
scale : 0
lastUpdated : 1543483566
max : 875
maxTime : 1543482344

name : rtot
value : 19.7
scale : 0
lastUpdated : 1543483566

c8h10n4o2
Posts: 73
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 » Thu Nov 29, 2018 9:52 am

Great! :D

Does that work for you? :)

ArneG
Posts: 39
Joined: Thu Jan 18, 2018 11:08 am

Re: PowerShell based cmdlets / Commands

Post by ArneG » Thu Nov 29, 2018 10:18 am

Well, I can probably pick up the values somehow, but the best would have this intergrated nicely in AutomaTD ?

I use it like this:
$SensorData=Get-TDSensor | Get-TDSensorData
$SensorData | Export-Csv "Sensors.csv" -Encoding utf8

One sensors on each line in sensors.csv. It would have been nice to have the 'rrat' and 'rtot' somewhere in those lines (on the end of each line or something..)

Also the Get-TDSensorHistoryData needs changes to output those 'rrate' and 'rtot'-values, instead of (or in addition to) temperature and humidity ?

c8h10n4o2
Posts: 73
Joined: Thu Jan 18, 2018 11:08 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 » Thu Nov 29, 2018 11:50 am

I guess that could make sense, I'll try to look into it when I get a chance!

Meanwhile, you could try this:

Code: Select all

$SensorData=Get-TDSensor | Get-TDSensorData
$SensorData | select *, @{N='RainRate';e={ $_.data.where({$_.name -eq 'rrate'}).value }}, @{N='RainTotal';e={ $_.data.where({$_.name -eq 'rtot'}).value }} | Export-Csv "Sensors.csv" -Encoding utf8

ArneG
Posts: 39
Joined: Thu Jan 18, 2018 11:08 am

Re: PowerShell based cmdlets / Commands

Post by ArneG » Thu Nov 29, 2018 12:02 pm

That seems to work...
Quick workaround for the Get-TDSensorHistoryData also ?

Post Reply