Sep 14, 2026

A ceiling fan I run from the terminal

My ceiling fan has a light, six speeds and a phone app. It turned out the fan itself runs a small web server on the home network. Send it JSON and it does what you say. No account, no cloud.

Everything goes to one endpoint as a POST. A few of the keys:

fanOn           true / false
fanSpeed        1 to 6
fanDirection    forward / reverse
lightOn         true / false
lightBrightness 1 to 100
wind            breeze mode
fanTimer        minutes

Sending {"queryDynamicShadowData": 1} reads the current state back.

The tool

I wrapped it in a command called fan, plain Python with only the standard library:

fan              # show state
fan on | off | toggle
fan 3            # speed
fan rev          # direction
fan light 40     # brightness
fan wind
fan timer 30

I skipped building a web page or phone UI on purpose. A terminal is always open on my laptop anyway, and fan 2 is faster than any app.

← All posts