PowerShell based cmdlets / Commands

Moderator: Telldus

Masonit
Posts: 75
Joined: Thu Jan 18, 2018 11:08 am

Re: PowerShell based cmdlets / Commands

Post by Masonit » Fri Jun 22, 2018 9:59 pm

Thanks for quick reply. :)

Yes, I saw that there was a new one. I installed AutomaTD 1.1.1. But I have problem connecting. I tried with:

Connect-TelldusLive -SavedCredential , I pasted url in browser and logged in to telldus site and gave permission to AutomaTD. I then came to https://automatd.net and in the url I have oauth_token and oauth_verifier. Is this accesstoken and AccessTokenSecret?

I tried to save accesstoken and AccessTokenSecret to a pscredential. And connect with Connect-TelldusLive -Credential $cred.
No errors but when running get-tddevice I get: "statusCode":500,"errorCode":0,"message":"An error has occurred. For more information, please check the logs

\Masonit

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

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 » Fri Jun 22, 2018 10:33 pm

hmm... You're right, something is broken with the Connect-TelldusLive cmdlet.

I will try to look into this as soon as I get a chance and update the module to fix it. I'll report back as soon as that is done!

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

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 » Fri Jun 22, 2018 11:38 pm

So... I hope I've found and fixed the issue with the Connect-TelldusLive cmdlet.

Could you update the module to version 1.1.3 and try again?

You should be able to just run the cmdlet to connect, it should detect the login automatically within 30 seconds or so and it should ”just work” after that.

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

Re: PowerShell based cmdlets / Commands

Post by ArneG » Sat Jun 23, 2018 6:27 am

Log inn manually on web and accept the new 'terms&conditions'. The modules should work again after this. Worked for me when they stopped workng like that 10-12 days ago

Masonit
Posts: 75
Joined: Thu Jan 18, 2018 11:08 am

Re: PowerShell based cmdlets / Commands

Post by Masonit » Sat Jun 23, 2018 7:47 am

After updated to lastest it works now! :clap:

When connecting I connect with: Connect-TelldusLive -UseSavedCredential
It works, is this the "right" way?

\Masonit

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

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 » Sat Jun 23, 2018 8:17 am

Awesome! :D

Glad to hear it works now.

Yes, you are exactly right. First time you use the module on a computer you run:
Connect-TelldusLive -SaveCredential

Then authenticate the module through the Telldus website. After that, you can simply run:
Connect-TelldusLive -UseSavedCredential

And the access token you retrieved in the first step will be reloaded without having to go through the Telldus website again. This is how I use it myself :-)


Sidenote: The accesstoken is stored encrypted on the computer, it get's encrypted using your current user session so only the user who ran the command will be able to use it (for obvious security reasons). Can be good to know if you want to run scheduled tasks etc, that will work just fine but you need to run it under the same user account.

The module actually have a cmdlet for exporting the access token if you need to (Get-TDAccessToken) but I don't imagine anyone having that much use for it, "Connect-TelldusLive -UseSavedCredential" is the preferred way :-)

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

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 » Thu Jul 05, 2018 11:16 am

Just wanted to mention that the module has been updated to version 1.1.4 now. Added some validation that the saved/specified credentials actually work when executing the Connect-TelldusLive cmdlet, and I've also made some improvements on the backend service, error messages should now hopefully be at least a little bit better and help when troubleshooting is needed.

And just because it's possible for pocket money... the backend service supporting this module is now geo-redundant (supported by two different Azure regions, North and West Europe) with automatic failover and scaling in each region.

So hopefully it should be fairly reliable as well :-)

Version 1.1.5 is available at https://www.powershellgallery.com/packa ... maTD/1.1.5 (or just run "Update-Module AutomaTD" in a PowerShell prompt if you already installed it earlier, or "Install-Module AutomaTD" if you haven't used it before).

If anything seems weird, please ping me so I can get it fixed!
Last edited by c8h10n4o2 on Thu Jul 19, 2018 7:13 am, edited 1 time in total.

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

Re: PowerShell based cmdlets / Commands

Post by ArneG » Thu Jul 19, 2018 6:35 am

There seems to be a problem with Set-TDSensor. Ignoring a sensor works fine, but unignoring it does not. This may be an api-problem because when trying the same thing manually on Telldus Live web-site also fails. The sensor seems to be 'unignored' on the screen, but the setting won't stick, the sensor is back on the list of ignored sensors when sensors page is refreshed)

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

Re: PowerShell based cmdlets / Commands

Post by ArneG » Thu Jul 19, 2018 6:47 am

And this line: '$SensorData=Get-TDSensor | Get-TDSensorData' does not collect ignored sensors?!

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

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 » Thu Jul 19, 2018 7:12 am

Seems you are right @ArneG, I get the same behavior (and now I can't get my sensor back! :( )

I know that this has worked fine in the past, and as you say, the Telldus Live! website is broken in the same way, so seems this is a problem on their end. I'll add a support ticket to them asking about it.

Not sure if this is valid workaround for you in the meantime, but if you update to the latest version of the module (1.1.5, available at: https://www.powershellgallery.com/packa ... maTD/1.1.5), you can run:
$SensorData=Get-TDSensor -IncludeIgnored | Get-TDSensorData

To fetch data for ignored/hidden sensors as well. The switch was actually available in earlier versions of the module, but sadly there was a bug so it didn't work.

Should work fine now though!

Thanks for reporting the issue!

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

Re: PowerShell based cmdlets / Commands

Post by ArneG » Thu Jul 19, 2018 8:31 am

The unignore-thing is a bug in Tellstick NET. Got this answer from support:
"Yes, I´m afraid that is right.
There is a bug that occurs when you have TellStick Net that doesnt allow users to take back ignored sensors.
We can do this manually though."

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

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 » Thu Jul 19, 2018 8:37 am

Ah, OK. Seems they have no plans to fix it?

Oh well, at least it's fixable by them manually then. Thanks for reporting back!

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

Re: PowerShell based cmdlets / Commands

Post by ArneG » Thu Jul 19, 2018 8:43 am

I don't know yet, I asked them if it will be fixed, but hasn't got an answer for that..yet?

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

Re: PowerShell based cmdlets / Commands

Post by ArneG » Thu Jul 19, 2018 8:59 am

btw: can confirm that the -IncludeIgnored switch works in 1.1.5

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

Re: PowerShell based cmdlets / Commands

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

c8h10n4o2 wrote:
Thu Jul 19, 2018 8:37 am
Ah, OK. Seems they have no plans to fix it?

Oh well, at least it's fixable by them manually then. Thanks for reporting back!
From Telldus support: "Hopefully our developers can solve this later in the fall when everyone is back from vacation again.
Please note that this bug only occurs for TellStick Net users!"

Post Reply