Page 5 of 9

Re: PowerShell based cmdlets / Commands

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

Re: PowerShell based cmdlets / Commands

Posted: Fri Mar 17, 2023 9:45 am
by c8h10n4o2
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!

Re: PowerShell based cmdlets / Commands

Posted: Fri Mar 17, 2023 9:45 am
by c8h10n4o2
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.

Re: PowerShell based cmdlets / Commands

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

Re: PowerShell based cmdlets / Commands

Posted: Fri Mar 17, 2023 9:45 am
by Masonit
After updated to lastest it works now! :clap:

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

\Masonit

Re: PowerShell based cmdlets / Commands

Posted: Fri Mar 17, 2023 9:45 am
by c8h10n4o2
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 :-)

Re: PowerShell based cmdlets / Commands

Posted: Fri Mar 17, 2023 9:45 am
by c8h10n4o2
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!

Re: PowerShell based cmdlets / Commands

Posted: Fri Mar 17, 2023 9:45 am
by ArneG
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)

Re: PowerShell based cmdlets / Commands

Posted: Fri Mar 17, 2023 9:45 am
by ArneG
And this line: '$SensorData=Get-TDSensor | Get-TDSensorData' does not collect ignored sensors?!

Re: PowerShell based cmdlets / Commands

Posted: Fri Mar 17, 2023 9:45 am
by c8h10n4o2
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!

Re: PowerShell based cmdlets / Commands

Posted: Fri Mar 17, 2023 9:45 am
by ArneG
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."

Re: PowerShell based cmdlets / Commands

Posted: Fri Mar 17, 2023 9:45 am
by c8h10n4o2
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!

Re: PowerShell based cmdlets / Commands

Posted: Fri Mar 17, 2023 9:45 am
by ArneG
I don't know yet, I asked them if it will be fixed, but hasn't got an answer for that..yet?

Re: PowerShell based cmdlets / Commands

Posted: Fri Mar 17, 2023 9:45 am
by ArneG
btw: can confirm that the -IncludeIgnored switch works in 1.1.5

Re: PowerShell based cmdlets / Commands

Posted: Fri Mar 17, 2023 9:45 am
by ArneG
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!"