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 »

Masonit wrote:Hi

Since yesterday I get a certificate warning when running get-tdsensor. Never seen this before. Certificate is issued to *.ballou.se. Anyone else with the same problem? My powershell scripts isen't working correctly because of this.


\Masonit
Hmm... I'm getting the same error. It seems Telldus is moving some stuff around (like this forum), which could be the cause of this.

I'll look into to it as soon as a can!
c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

Updated version available!

Get it at:
https://github.com/AWahlqvist/powershel ... lldus.psm1


@Masonit: Could you verify if this version works for you? Thanks in advance!
Masonit
Posts: 79
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by Masonit »

Works just fine again. Thanks for quick response! :clap:

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

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

Awesome! :D

Thanks for reporting the issue!
c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

Just wanted to give you a small update.

I've updated the module to include some changes:
  • It's available at the PowerShell Gallery. If you run Windows 10 (or PowerShell 5) this means you can install it by simply running "Install-Module Telldus". You can also update to the latest version at any time by running "Update-Module Telldus" in a PowerShell prompt.
  • You can now save your credentials really simply by executing: Connect-TelldusLive -SaveCredential. After you've done this once, you can reuse those by running "Connect-TelldusLive -UseSavedCredential". The credentials are saved encrypted using your logon session (in windows).
  • Bell support for Set-TDDevice
  • If you specify a date/time when fetching sensor history, the cmdlet wont change it to UTC automtically.

Link to PowerShell Gallery:
https://www.powershellgallery.com/packages/Telldus
Masonit
Posts: 79
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by Masonit »

Thanks for keeping it up to date. :) Are you planning to support local api?

https://developer.telldus.com/blog/2016 ... ublic-beta

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

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

Sorry for a late reply! I'd love to support that. I guess I just have to upgrade to a znet first :)

Will try to look into it... :)
ArneG
Posts: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

What about a set (rename?) devicename cmdlet? Winstick has this features so I think it is in the API...?
c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

Sure, that looks very straight forward. I haven't had use for that so far, no other reason why it hasn't been created :-)

I'll put it on the ToDo-list!
c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

ArneG wrote:What about a set (rename?) devicename cmdlet? Winstick has this features so I think it is in the API...?
Updated the module with Rename-TDDevice now. Also added Get-TDEvent, and up/down actions for Set-TDDevice. I don't have any device supporting that though, so I haven't been able to test that (up/down actions).

I also noticed a bug in Connect-TelldusLive when used with the "-SaveCredential" switch on the first run which is hopefully fixed now. Sorry about that!

If you installed the module from PowerShell Gallery you can simply run "Update-Module Telldus -Force" to get the new version.

The latest version is also always available at:
https://www.powershellgallery.com/packages/Telldus


If you want any other features in this module, feel free to request them here :-)
ArneG
Posts: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

A few other tasks that we have to log on to Teldus Live manually to perform would be nice to be able to do via the CMDLet:
Turn on/off the Telldus live's 'store history'-function for sensors.
Set the Ignore/Show switch for devices/sensors
c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

So, with the release of PowerShell 6.0 aka PowerShell Core, I wanted to revisit this project a bit. (see: https://blogs.msdn.microsoft.com/powers ... supported/)

The goal is to enable cross platform support (PowerShell core runs on Windows, macOS and Linux. Also works on Raspberry Pi 2) which I believe would be quite nice for a module that relates to home automation.

In this process I also wanted to enable OAuth but without the need for all users to get their own individual API keys.

The updated version is now available with a new name. You can get it from:
https://www.powershellgallery.com/packages/AutomaTD

Or by running the following command in PowerShell:
Install-Module AutomaTD

I will allow the old version of the module to still be listed on PowerShell Gallery if anyone needs it, but I really want to encourage you to try the new version which is more officially supported by Telldus (complies better with their APIs, they won't help you with module issues of course ;) ), and it also contains a few bugfixes already that the old version had.

All future development will go into the new version.

Edit: Removed information about the pre-release versions
c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

ArneG wrote: Thu Jan 18, 2018 11:08 am A few other tasks that we have to log on to Teldus Live manually to perform would be nice to be able to do via the CMDLet:
Turn on/off the Telldus live's 'store history'-function for sensors.
Set the Ignore/Show switch for devices/sensors
Implemented in the new module (Set-TDSensor)! Also added Get-TDClient. Get-TDSensor now returns the latest value of the sensors directly (don't need to call Get-TDSensorData), also added an option to fetch hidden/ignored sensors. Set-TDDevice have "stop"-support now.

Just fetch/update to the latest version on PowerShell Gallery.

Edit: I'll also look into adding functionality for updating device settings (like hide/show etc.)
ArneG
Posts: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

Set-TDSensor: "-newname" and "-keephistory" options works, "-IgnoreSensor" does not?
c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

hmm, odd. Just tried it on one of my sensors and it worked fine for me.

You ran something like:
Set-TDSensor -DeviceID 123456 -IgnoreSensor $true

or?
Post Reply