PowerShell based cmdlets / Commands

Moderator: Telldus

c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

Roger that! :-)
ArneG
Posts: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

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: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

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: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

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: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

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: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

Same problem with Set-TDSensor and -NewName-switch....
c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

Doh! :banghead:

Of course! Fixed in 1.1.7! Thanks again for reporting :-)
ArneG
Posts: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

Both works fine now :)
ArneG
Posts: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

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: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

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: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

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: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

Great! :D

Does that work for you? :)
ArneG
Posts: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

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: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

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: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

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