Page 4 of 9

Re: PowerShell based cmdlets / Commands

Posted: Fri Feb 16, 2018 7:35 am
by ArneG
I Will debug my code a little bit more and report back...

Re: PowerShell based cmdlets / Commands

Posted: Fri Feb 16, 2018 8:39 am
by ArneG
Maybe a clue: I tried something directly when logged in on the telldus site:

"https://live.telldus.com/sensor/setKeep ... pHistory=1"
Telldus site returns "{"status":"success"}" and does what it should

"https://live.telldus.com/sensor/setIgno ... 3&ignore=1"
Telldus site returns nothing (and the sensor is still not ignored)

Re: PowerShell based cmdlets / Commands

Posted: Fri Feb 16, 2018 8:58 am
by c8h10n4o2
That is really weird, when I run it against one of my sensors I get a success status back and the sensor gets ignored.

Not sure it's related... But Telldus returns a "editable" property for all sensors, is that set to True or False for the sensor you try to ignore?

Re: PowerShell based cmdlets / Commands

Posted: Fri Feb 16, 2018 9:20 am
by ArneG
I don't know if it is editable, but the keephistory-switch does work, so probably the sensor it is indeed editable. I also tried many other sensors, same shit.
BUT, I just tried it agian now:

"https://live.telldus.com/sensor/setIgno ... 3&ignore=1"

The telldus site returns an error on this now:
Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template cinderella 'pages/sensor/setIgnore.tpl' in 'base.tpl'' in /var/www/live.telldus.com/cinderella/core/smarty/sysplugins/smarty_internal_templatebase.php:127 Stack trace: #0 /var/www/live.telldus.com/cinderella/core/smarty/sysplugins/smarty_internal_template.php(286): Smarty_Internal_TemplateBase->fetch(NULL, NULL, NULL, NULL, false, false, true) #1 /var/www/live.telldus.com/cinderella/var/compiled/www/4e53f4e2bd84f70a3ae907335f03816308d0bf0b.cinderella.base.tpl.php(34): Smarty_Internal_Template->getSubTemplate('pages/sensor/se...', NULL, NULL, NULL, NULL, Array, 0) #2 /var/www/live.telldus.com/cinderella/core/smarty/sysplugins/smarty_internal_templatebase.php(180): content_54e4593c1049f1_41015035(Object(Smarty_Internal_Template)) #3 /var/www/live.telldus.com/cinderella/core/smarty/sysplugins/smarty_internal_templatebase.php(374): Smarty_Internal_TemplateBase->fetch('base.tpl', NULL, NULL, NULL, true) #4 /var/www/live.telldus.com/cinderel in /var/www/live.telldus.com/cinderella/core/smarty/sysplugins/smarty_internal_templatebase.php on line 127

Re: PowerShell based cmdlets / Commands

Posted: Fri Feb 16, 2018 9:34 am
by ArneG
And now it is back to returning nothing.
How to best check if my sensor(s) are "editable"? As I said; -keephistory and -newname works as it should.

Re: PowerShell based cmdlets / Commands

Posted: Fri Feb 16, 2018 9:38 am
by c8h10n4o2
Very odd indeed, not sure what's failing.

I guess the easiest way would be to simply run Get-TDSensor, it returns the "editable" property :-)

Re: PowerShell based cmdlets / Commands

Posted: Fri Feb 16, 2018 11:18 am
by ArneG
Just checked to be sure: Sensor IS editable

Re: PowerShell based cmdlets / Commands

Posted: Fri Feb 16, 2018 2:20 pm
by c8h10n4o2
Alright, not sure what can cause that then.

Does it work if you just check the "Ignored" checkbox through live.telldus.com and hit save? (I know you tried posting it in the URL, just want to make sure you also tried the standard "UI" way :-) )

Re: PowerShell based cmdlets / Commands

Posted: Fri Feb 16, 2018 2:53 pm
by ArneG
Yes, it works the UI-way 8)

Re: PowerShell based cmdlets / Commands

Posted: Fri Feb 16, 2018 3:39 pm
by c8h10n4o2
I noticed they are using different api endpoints for this method at api.telldus.com (/setIgnore) and live.telldus.com (/setIgnored).

So maybe that's why the test you did earlier didn't return anything.

If you try this link you might have greater luck:
https://live.telldus.com/sensor/setIgno ... &ignored=0

The module however, is using the endpoint under api.telldus.com, so I'm afraid it doesn't help us much.

I have yet to have that method fail for me though, I've tried it a bunch of times on different sensors and it works every time for me.

Currently have no clue why it wouldn't work for you :(

Re: PowerShell based cmdlets / Commands

Posted: Fri Feb 16, 2018 7:42 pm
by ArneG
YES, there it was.
The clue you need to understand why it not worked for me is that I am still using older version of 'teldus.psm1'-module and have forked the new Set-TDSensor function into it (with some changes to the login-stuff and URI invoking-stuff, i.e. I use the live.telldus.com endpoint yes.)
Don't ask :9 It is a "If it works for you, don't fix it"-thing :D
Changing my stuff to to api.telldus.com does the trick. So does also keeping live.telldus.com and change URL to 'setignored......ignored=x''
So yes, everything is working perfectly OK the way I want it now:)

Re: PowerShell based cmdlets / Commands

Posted: Fri Feb 16, 2018 10:34 pm
by c8h10n4o2
Ah, I see. That definitely explains the issues you were having.

You should know the new module works more or less exactly the same as the old one in the shell (I have myself migrated all of my home automation to it without any changes except for the specified credentials), you can store the credentials (stored locally, encrypted) the same way and not have to re-auth etc.

The main difference is that it is implemented the way that Telldus specifies and will long-term be more reliable. It has way better portability as well since it supports PowerShell core (can run on a raspberry pi etc.).


That said, I agree with the principle of "if it works, don't fix it", and I'm very happy you got a setup that works for you! :D

Re: PowerShell based cmdlets / Commands

Posted: Sat Feb 17, 2018 7:48 am
by ArneG
Yes, I know. I' m still on Win7, Office 2010 and Delphi 7........"When things stops working, THEN fix it" 😁

Re: PowerShell based cmdlets / Commands

Posted: Fri Jun 22, 2018 8:53 pm
by Masonit
Hi

Seems like the cmdlets has stopped working. Think it hasen't worked for 10 days now. Connecting works fine. But not for example get-tddevice and get-tdsensor. Any possibility to update cmdlets?

\Masonit

Re: PowerShell based cmdlets / Commands

Posted: Fri Jun 22, 2018 9:00 pm
by c8h10n4o2
huh, weird, they still work fine for me. Are you using the latest module or the old one? (AutomaTD is the new one that should work just fine)

If you're using the new one and it still doesn't work, maybe try to reauth and see if that helps.