Original Reddit post

Hey all Just wanted to waffle on about a rather cool CC session I had this afternoon. My mother is elderly, mostly sits in a chair all day and watches satellite TV. However, she can get stuck in TV menu’s, the Sky Q box (UK sat) can have a fit and just shows a blue screen, a popup appears for some reason or she ends up in the wrong input and forced to watche K-Pop for hours. Can’t have that, she needs her rolling news! Claude to the rescue? I asked CC to create a really simple touch screen menu system with her 3 favourite channels, a mute button and an ALL OFF button. The channel buttons are macros so will turn the TV on, Select HDMI 1 source input and then punch in 3 channel codes. It’s slower than a human who knows what they are doing…doing it, but for my mother this never goes wrong. She can mash keys on any remote control and my system will get her back to her fav channel. For proof of concept purposes I just wanted to see if it would work across my home lan from a windows PC to her TV and Sky Q Mini box. An hour and a bit later it was all finished and working great! A web front end, 5 buttons and I can control her TV and Sky box from a different room over the lan. All working flawlessly. It even shows the time in an OAP friendly format so she knows it’s 3 in the MORNING and should be sleeping like the rest of the house! Those that know, know. This is all designed in a docker container for ease of development and portability. It’s going to live on a Raspberry Pi with touchscreen in a few days. Anyway, some technical bits if anybody else is thinking of doing something like this. Sky Q Mini boxes have two private API’s on different ports. Port 9006 is JSON over HTTP for things like status, awake etc. And port 49160 for TCP binary instructions and remote control button presses. Samsung Smart TV (2017 model) also has two API’s, Port 8001 is a REST api (Smart View Tizen Web), that is just used to test the TV is reachable really and Port 8002 which is Websocket Secure (wss://) for sending key presses. Software stack: Python + Flask serving static HTML web UI (with an admin button that’s OAP proof) Docker so can build and test on a Win PC and deploy to Pi when I buy the bits. Pyskyqremote for sky control, binary on port 49160 (not HTTP/SOAP) Samsungtvws via Websocket for TV control JSON config for the GUI so I can change the 3 channel buttons, load channel logo’s etc Things I learned, in case anyone’s building similar (Got Claude to write this out from session troubleshooting): Not open API, lots of people have figured these things out before me but over time the info can be stale and lead you astray. This is what worked for my setup. Early Sky Q Mini Boxes do not speak SOAP on its control port. Older Sky+ HD did; Sky Q replaced it with a custom binary protocol. The first thing the box returns on TCP is SKY 000.001\n, which makes Python requests choke with BadStatusLine. Use pyskyqremote (currently 0.3.26 on PyPI) - don’t hand-roll the handshake; the echo-length ramps from 12 bytes to 1 byte mid-handshake and it’s easy to get subtly wrong. Sky Q digit-press timing matters. Sending 1, 0, 1 for “BBC One” with 0.4 s between presses lost the middle digits because each press is its own TCP session. One full second between presses turned out to be the reliability threshold. Samsung Tizen has no “go to HDMI 1” key. You have to drive the source picker by hand: open it with KEY_SOURCE, walk LEFT until you hit the edge, then walk RIGHT N times. Newer (2018+) Samsungs expose current source via SmartThings - older ones don’t, so you can’t tell whether you even need to bother. Network topology bit me. My TV was on a mesh network but the skybox was passed through onto our older one. Make sure everything is on the same subnet. Docker on Windows ignores network_mode: host. The container ran fine but its ports never bound. Use port mapping for Windows dev, swap to host networking only on the Pi (where you actually need it for WoL broadcasts). Prompt: Nope, I started off by asking Claude Code to see if it could control a TV and Sky box using just the IP address over the LAN and vibed from that point on. It’s probably messy, but it figured everything out and works wonderfully. I doubt anybody is interesting in a repo of this as it was built for my model of TV and Sky Q Mini Box, I just hope some of this helps others thinking it might help them too. Took about 90 mins from concept to completion. Even got some steps in running from a dev machine to other rooms to see what the TV’s were doing. Moving to a Pi with touch screen should be trivial, and cost about £150 buying all new components. For now I am just going to have fun muting her TV over the lan. (kidding!, not kidding at 3AM). OAP Proofing it: Huge buttons, 5 on the whole screen using large SVG logos, bold colours. Big depression on button taps, disables interface for 2 seconds. Setup button is hold for several seconds to get into it, no pin. No accidental taps. Time displayed in OAP format, so not “3PM” but “3 in the morning - Everybody is sleeping!” One button turns everything off Channel buttons turn everything on, even if already on (ignored). Screen goes to 10% opacity after 5 minutes, jitter to avoid screen burn as 24/7 No RF Tranmitters used. It’s all controled over LAN. Could even hide the remotes. submitted by /u/BritishAnimator

Originally posted by u/BritishAnimator on r/ClaudeCode