PowerShell based cmdlets / Commands

Moderator: Telldus

ArneG
Posts: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

Tested Oregon windsensor:
Seems to work fine with latest AutomatD, but a tiny little issue (in 'properties to output'): This windsensor sends 3 values to Telldus Live; wavg, wdir and wgust. In current AutomatD wgust is not translated into a friendly name like wavg and wdir is.
c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

Ahh, thanks for reporting back! I've added a fix to the module for that but I'm working a few other changes as well so I'd rather wait and release them all at the same time. Not sure when I'll do the release but I'll post back when I do!
ArneG
Posts: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

No problem. For a string in Delphi 'wgust' is just as friendly (or not) as 'WindGust' or any other string :D
c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

So, I've published a new version (1.4.0) now which should change wgust to WindGust (sorry, I guess this will be a breaking change for you but I hope you can manage :oops: :) ).

I've also added a few new functions/cmdlets as well, one noteworthy function is "Backup-TDAccount" which will store information about the clients/locations, devices, sensors, schedules and events that are associated with Telldus Live! account on local disk. This backup can be used to for example restore events in case they got lost, or as in my case, be used to migrate events from one client (Tellstick) to another (used it when I migrated from Tellstick Net to TellStick ZNet Lite v2).

The actual migration script is not published yet, but if anyone has need for it please ping me and we'll work something out! :wave:
c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

Minor update, seems there have been some intermittent connection issues against the Telldus Live! API lately, I've therefor added "server side retries", ie. the backend service used by the module will automatically perform a few retries (for errors related to the specific connection issues) before giving up.

This could potentially cause a slight delay in the response, but will hopefully improve reliability of the module even when Telldus Live! is a bit shaky :)

Related error message you might have seen in the module:
Telldus Live! API responded with error: "Unable to connect to the remote server"

If you still see this message or something similar, please respond to this thread with the exact error and I'll have a look.
ArneG
Posts: 45
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by ArneG »

Yes, either you fixed it or Telldus fixed their api.
Not sure, but got lots of those timeouts you refer to during the last week or so, but now it's been 24 hours plus with no timeouts :)
I've noticed that the script execution times is now back to more or less 'normal', so maybe Telldus got their api-things right again...
c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

Awesome! Happy to hear that.

I don't think it has been fixed on the Telldus Live side, the app is logging an event every time this happens and it happened quite a few times yesterday as well. Nothing so far today though, but it seems to come in "bursts", where multiple timeouts and connection failures happens within a specific time window.

Anyway, hope this change can fix that at least to some level so it becomes less of a problem from a module usage standpoint :-)
Masonit
Posts: 79
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by Masonit »

Hi

Just upgraded to Znet v2 and AutomaTD 1.4. :)

Looking forward to more reliable state value from z-wave device. But does not seem to be able to query the state of z-wave device. Should I just trust the state value I get from get-tddevice? I know this value can't be trusted on 433 devices because of one way communication.

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

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

Hmm... That seems weird. What do you mean by not being able to query the state value? Is the value wrong, missing or something else?

The module just gets the data from the Telldus API, hopefully that should be correct. But if not, I'll be happy to take a closer look on what's up!

(I actually don't have any z wave device yet though but we'll figure something out!)
Masonit
Posts: 79
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by Masonit »

I just thought I should be able to run a commad and refresh status for a specific device. The refresh command would query the physical device status.
But I just did some testing and turned off and turned on the z-wave device on the physical on/off button. And status in telldus live is updated correctly. Seems like state on z-wave device is trustworth in Tellus live. :D

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

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

Ahh, I get what you mean now.

Just as you said, I guess the status in Telldus Live! is simply kept in sync/updated on an event basis. So as long as the internet connection isn't dropped or there is a service error or similar, the status should be trustworthy I guess :)

Glad it works :D
c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

I was just made aware of a problem with authenticating this module when it's used initially or without using a stored credential that sadly seems to have been going on for a while, my apologies to anyone who's been affected by this (I used a service to provide shortened urls that was depricated this spring).

It should now have been fixed, so if you've experienced an issue related to this, please try again now!
c8h10n4o2
Posts: 86
Joined: Fri Mar 17, 2023 9:45 am
Contact:

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

Just wanted to let you know that I've upgraded the "backend part" to newer infrastructure. Shouldn't make any difference whatsoever in terms of how to use the module etc. but hopefully it will be slightly faster now :-)

If you notice something weird then please reach out and I'll have a look ASAP.
Masonit
Posts: 79
Joined: Fri Mar 17, 2023 9:45 am

Re: PowerShell based cmdlets / Commands

Post by Masonit »

Great that you still are maintaining the cmdlets! :D

Regarding my worries for unrelyable status on znet devices. My worries was not wrong. :(
I made some testing with znet device that was almost out of range. Often when I send on to the device. The physical device was turned on and status was set to on in telldus live. But some seconds later the status was automatically set to off again in telldus live. Under device history you could then see that the status change was discarded because verification was never received from znet device. This resulted in znet device turned on and status as off in telldus live. I guess this is something that can never be 100%. But it would be good to be able to request status directly from znet device or trigger a status update in telldus live as I thought was possible in the beginning.

But I guess I could always double check device history for any errors.

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

Re: PowerShell based cmdlets / Commands

Post by c8h10n4o2 »

hmm, alright I get the problem at least. Might not be easy to solve "client side" but I guess I could potentially add a switch (-ConfirmCommand or something like that) that polls the history and wait for the verification to be registered, and if not resend the same command as a "retry".

Or maybe that would too much of a hack... What do you think? :-)

I can try to take a look at the API docs and see if Telldus have added some info about how to handle this as well when I get some time.
Post Reply