PowerShell based cmdlets / Commands
Posted: Fri Mar 17, 2023 9:45 am
Hi all,
First time poster here! Using a Tellstick Net device for automating more and more of my home! It's great that you try and keep things as open as possible so new ways of integrating your product can be developed! Thanks.
Whilst it appears there's a fair amount of automation for the Tellstick / Duo, the Tellstick net seems much newer, and so far less developed. In my setup, I've a Media Center / Logitech Harmony remote, which I would like to do some automation against and ideally sequences (such as theatre mode, dim all lights etc.) - Ideally this will eventually be included into eventghost or another commander which would launch this as a script.
I'm a PowerShell programmer amongst many things at work, so thought would bridge a gap by creating commands / cmdlets to automate some basic power on / off / dim commands. I've managed to get my way through oAuth to autenticate against the API site, and now on my way to creating some cmdlets. I've still got some ways to allow the programming to do public API and authentication - but wanted to get some thoughts / feedback on what people may like to see.
So far I've got the following cmdlets:
Get-TDDevices - No options, just collects all devices associated to your account. returns a table (object) containing the ID, Name, State, and StateValue
Set-TDPower
- Options: operation (currently only turnon, and turnoff)
id (id of device to perform command against)
- This cmdlet allows you to specify a single ID to perform a turn on / off command against.
- The cmdlet returns the XML response back so you can understand operation success
Set-TDDimmer
- Options: level (currently between 0-255 - would % be of interest to people?)
id (id of device to perform command against)
- This cmdlet allows you to specify a single ID, and the level (between 0-255) to dim the device.
- The cmdlet returns the XML response back
I've still some more integration to go, but you can do stuff like:
All devices power off: Get-TDDevices | ForEach-Object { Set-TDPower -id $_.id -operation turnoff }
Power on Devices with specifc name: Get-TDDevices | ? { $_.name -like "*Room*" } | ForEach-Object { Set-TDPower -id $_.id -operation turnon }
So my question to everyone to help understand if this would help people in building further automation, if there is any thoughts, or inclusions you would like to see?
My second question, is if anyone has any thoughts on how I go about getting Authorization / Tokens in a text based console - or what the process is to authenticate users, as it seems most of the articles point to URL redirection?
Thanks in advance! Hope this helps others too!
First time poster here! Using a Tellstick Net device for automating more and more of my home! It's great that you try and keep things as open as possible so new ways of integrating your product can be developed! Thanks.
Whilst it appears there's a fair amount of automation for the Tellstick / Duo, the Tellstick net seems much newer, and so far less developed. In my setup, I've a Media Center / Logitech Harmony remote, which I would like to do some automation against and ideally sequences (such as theatre mode, dim all lights etc.) - Ideally this will eventually be included into eventghost or another commander which would launch this as a script.
I'm a PowerShell programmer amongst many things at work, so thought would bridge a gap by creating commands / cmdlets to automate some basic power on / off / dim commands. I've managed to get my way through oAuth to autenticate against the API site, and now on my way to creating some cmdlets. I've still got some ways to allow the programming to do public API and authentication - but wanted to get some thoughts / feedback on what people may like to see.
So far I've got the following cmdlets:
Get-TDDevices - No options, just collects all devices associated to your account. returns a table (object) containing the ID, Name, State, and StateValue
Set-TDPower
- Options: operation (currently only turnon, and turnoff)
id (id of device to perform command against)
- This cmdlet allows you to specify a single ID to perform a turn on / off command against.
- The cmdlet returns the XML response back so you can understand operation success
Set-TDDimmer
- Options: level (currently between 0-255 - would % be of interest to people?)
id (id of device to perform command against)
- This cmdlet allows you to specify a single ID, and the level (between 0-255) to dim the device.
- The cmdlet returns the XML response back
I've still some more integration to go, but you can do stuff like:
All devices power off: Get-TDDevices | ForEach-Object { Set-TDPower -id $_.id -operation turnoff }
Power on Devices with specifc name: Get-TDDevices | ? { $_.name -like "*Room*" } | ForEach-Object { Set-TDPower -id $_.id -operation turnon }
So my question to everyone to help understand if this would help people in building further automation, if there is any thoughts, or inclusions you would like to see?
My second question, is if anyone has any thoughts on how I go about getting Authorization / Tokens in a text based console - or what the process is to authenticate users, as it seems most of the articles point to URL redirection?
Thanks in advance! Hope this helps others too!