carbonian.org / manual pages
CARBONIAN-HOME(1) Carbonian Manual CARBONIAN-HOME(1)

carbonian-home - the house's devices from the terminal and the widgets

carbonian-home [-q] widget [--once]
carbonian-home status
carbonian-home devices | list
carbonian-home scene [NAME [--dry-run]]
carbonian-home aircon [NAME | all] [status | on | off | temp N | mode MODE | fan SPEED]
carbonian-home tv [NAME | all] [status | on | off | volume N|up|down | mute | unmute | input NAME | sound NAME | key KEY]

carbonian-home shows and controls the house's devices, each maker through its own API: LG's air conditioners through ThinQ Connect (the REST contract of LG's thinqconnect SDK), Samsung's TVs through SmartThings (Samsung's API). Both are cloud APIs: every reading and every command goes through the maker's cloud. Python's standard library only, so nothing else has to be installed. Each maker has its token alone in a file, mode 600; a maker whose token is not there is not asked anything, and one that fails (an expired token) is said while the others go on.

Sign in at https://connect-pat.lgthinq.com with the ThinQ account, make a Personal Access Token and put it alone in ~/.config/carbonian/thinq-token, mode 600:

install -m600 /dev/null ~/.config/carbonian/thinq-token
$EDITOR ~/.config/carbonian/thinq-token

A token file that others can read is refused. Until the file exists nothing is asked of the network. A client id of its own is kept in ~/.local/state/carbonian/thinq-client-id.

carbonian-home login samsung signs in once, and the session renews itself from then on (it lasts while it is used at least once a month). The first time it registers carbonian-home in the Samsung account as an OAuth app (what smartthings apps:create makes), with a token from https://account.smartthings.com/tokens with the Apps, Devices and Locations scopes, put alone in ~/.config/carbonian/smartthings-token, mode 600; the app's client is kept in ~/.config/carbonian/smartthings-app. The browser then opens SmartThings's page to allow it, and goes back to http://localhost:8645/callback here (a browser on another machine cannot: paste the address it ends at in the terminal instead), or to the https address of home.conf(5)'s samsung-callback (SmartThings refuses localhost): its page shows a line, CODE:STATE, to copy and paste in the terminal that asked (the address the browser ends at, or the code alone, do as well; the code alone cannot be checked as this sign-in's, and the command says so). The session is kept in ~/.local/state/carbonian/smartthings-session; the token is not needed after that. Without signing in, the token alone also works, for the 24 hours it lasts.

No progress line. Without it, while LG answers, a turning mark and what it waits for (the devices, the units read one by one: reading: 3/5 ⋅ Sala) are drawn on standard error and wiped when done; only when standard error is a terminal, so a script, a pipe or ssh without a terminal get the results alone. The widget shows the same mark on its status line while a call is out.

Every device of the house as a widget. The device selected is on top in large digits (an air conditioner's target with the room, the mode and the fan; a TV's volume with its input and sound mode); below it the list of the devices, each air conditioner and TV with its state, the selected one marked. Other kinds are listed by name. It is not in the widgets by default; add a line to widgets.conf(5):

aircon   62%    carbonian-home widget
With the pane in focus: j and k (the up and down arrows, tab) choose the device; what follows acts on that one only, and space turns it on or off. An air conditioner: + and - (the left and right arrows) change its target by the unit's step, in the mode it is in (sent once the keys stop, or when another unit is chosen), m steps through the modes it accepts, f through the fan speeds. A TV: + and - change the volume, m mutes or not, i steps through the inputs, s through the sound modes. r reads them all again. The scenes of home.conf(5) are listed under the keys: 1 runs the first, 2 the next, up to 9. While the widgets are hidden it reads nothing. --once draws it once and exits.
Sign in to SmartThings (see Samsung above).
The whole house at a glance: every device, a group per kind (aircon first, as LG lists them), each with its state; an air conditioner on or off, its mode, target, fan and the room's temperature, a device of a kind that has no reading yet by its model. The columns line up; colour only on a terminal. The exit status is 1 when a unit could not be read (offline), so a script can tell.
The ThinQ devices of the account: id, kind, name, model.
The scenes of home.conf(5) and their lines (no call to LG).
scene NAME
Run the scene: every unit it names at once, a line for each (ok, already so, or why not). With --dry-run the payloads it would send, and nothing sent. From another machine: ssh carbonian-dell carbonian-home scene inverno
A line for each air conditioner, or for the one named: on or off, the mode, the target, the fan, the room.

The commands below act on the unit NAME (its name in the ThinQ app, any case, accents optional, several words allowed: sala de jantar; a unique start of a name; or its id), on every one with all, or without a name on the one home.conf names (or the only one).

aircon [NAME] on | off
aircon [NAME] temp N
The target, in °C (21.5 or 21,5), for the mode the unit is in: each mode keeps its own (cool, heat, auto), and fan has none. It is rounded to the unit's step; a value outside its range is refused.
aircon [NAME] mode MODE
cool, air_dry, fan, heat, auto: what the unit accepts (a wrong one lists them).
aircon [NAME] fan SPEED
low, mid, high, auto: what the unit accepts.
A line for each TV (or the one named, or the only one): on or off, the input, the volume, the sound mode. A name is found as for the air conditioners, or by the start of one of its words (living).
tv [NAME] on | off
An older set (the TV says so) is not turned on over the network: its remote does it.
tv [NAME] volume N|up|down
tv [NAME] mute | unmute
tv [NAME] input NAME
The inputs the TV reports: tv, hdmi1 (a wrong one lists them).
tv [NAME] sound NAME
The sound modes the TV reports (a wrong one lists them).
tv [NAME] key KEY
A key of the remote: HOME, BACK, UP, DOWN, LEFT, RIGHT, OK, MENU, SOURCE, 0 to 9, CHUP, CHDOWN...

~/.config/carbonian/thinq-token
~/.config/carbonian/smartthings-token
~/.config/carbonian/smartthings-app
~/.local/state/carbonian/smartthings-session
/etc/carbonian/home.conf
~/.config/carbonian/home.conf

carbonian-home status
carbonian-home aircon suite temp 23
carbonian-home aircon sala de jantar mode cool
carbonian-home aircon all off
carbonian-home tv living volume 12
carbonian-home tv input hdmi1
carbonian-home scene inverno --dry-run

0 when it was done; 1 with a line on standard error when not (no token, the unit offline, a value it refuses). Ctrl+C, SIGTERM or SIGHUP cancel it at any moment: it says so, puts the terminal back (the progress line wiped, the cursor shown) and leaves with 128 plus the signal (130, 143, 129). A sign-in cancelled keeps nothing of itself: no session is written, and its server is closed (carbonian-home's app, once registered in the account, stays, since SmartThings shows its secret only once). Nothing pasted (Ctrl+D) cancels it too.

home.conf(5), widgets.conf(5)

October 2026 Carbonian