PowerShell based cmdlets / Commands
Moderator: Telldus
Re: PowerShell based cmdlets / Commands
I Will debug my code a little bit more and report back...
Re: PowerShell based cmdlets / Commands
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)
"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
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?
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
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
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
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.
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
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![Smile :-)](./images/smilies/icon_e_smile.gif)
I guess the easiest way would be to simply run Get-TDSensor, it returns the "editable" property
![Smile :-)](./images/smilies/icon_e_smile.gif)
Re: PowerShell based cmdlets / Commands
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
)
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
![Smile :-)](./images/smilies/icon_e_smile.gif)
Re: PowerShell based cmdlets / Commands
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![Sad :(](./images/smilies/icon_e_sad.gif)
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
![Sad :(](./images/smilies/icon_e_sad.gif)
Re: PowerShell based cmdlets / Commands
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![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
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:)
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
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
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
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!![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
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!
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Re: PowerShell based cmdlets / Commands
Yes, I know. I' m still on Win7, Office 2010 and Delphi 7........"When things stops working, THEN fix it" ![😁](https://cdn.jsdelivr.net/gh/s9e/emoji-assets-twemoji@11.2/dist/svgz/1f601.svgz)
Re: PowerShell based cmdlets / Commands
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
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
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.
If you're using the new one and it still doesn't work, maybe try to reauth and see if that helps.