Timed Stop - Sleep


#21

Here’s another command you can use to control Channels tvOS directly:

curl -XPOST http://appletv.local:57000/api/stop


#22

Interesting. What other API commands are there? Are they documented anywhere?


#23

They are undocumented, private and subject to change at any time. :slight_smile:


#24

I suspected as much. :grinning:


#25

Except for STOP which was made public and documented here? :grimacing:


#26

Where did we land on this? Is this feature still be considered? Possibly on the product roadmap? If not, did anyone come up with a work around that is more elegant than the home bridge solution? Nothing against the work around, just checking. Wife loves falling asleep with the TV and therefore we can’t get rid of the TV remote. If we had sleep, only Apple TV remotes all around. Thanks


#27

This is on the roadmap, but no ETA at this time.


#28

Is the roadmap published somewhere?


#29

Nope sorry.


#30

Thanks for the reply. Glad to know this is still being thought of.


#31

I tried this command with ip address and hostname.local and I get an error:

curl -XPOST http://192.168.7.36:57000/api/stop
“curl: (7) Failed to connect to 192.168.7.29 port 57000: Connection refused”

Do I need to authenticate first? I am on the machine where the DVR software is running.


#32

Sounds like either that is not the IP of your ATV, or the Channels app is not running.


#33

It was the channel app on appletv was not running.


#34

Any ideas on why I get this error?
PS C:> curl -XPOST http://192.168.1.28:57000/api/stop
Invoke-WebRequest : A parameter cannot be found that matches parameter name ‘XPOST’.
At line:1 char:6

  • curl -XPOST http://192.168.1.28:57000/api/stop
  •  ~~~~~~
    
    • CategoryInfo : InvalidArgument: (:slight_smile: [Invoke-WebRequest], ParameterBindingException
    • FullyQualifiedErrorId : NamedParameterNotFound,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

#35

On windows PowerShell, use:

iwr -usebasicparsing -method post http://192.168.1.28:57000/api/stop


#36

It’s been over a year and a half, has no one come up with a better solution than the homebridge work around??


#37

Hey everyone. We just released the Channels API.

This should make scripting the Channels app a little easier to do things like what the Homebridge hack above does. I know it’s not the same as having a sleep timer inside the app, but it’s at least accomplishable easier.

Also, instead of setting a sleep timer every night you watch, you could create an automation to just attempt to stop Channels every night at a specific time of night. Set it and forget it!

Also a native Homebridge plugin will be made available sometime soon, so you’d be able to do this even easier with Homebridge.

A Home Assistant media player is already in the core of Home Assistant and will be available with it’s next release. Using Home Assistant, you can do ALL KINDS of cool stuff with Channels really easily, including stopping playback when your TV turns off.

You can learn more here:

Channels API: https://getchannels.com/api
Community Announcement: Channels HTTP API


#38

Thank you! I’m excited to play with this!


#39

Does anyone do this? Does it work well?