Skip to content
erfaniumPublic
forked from MasterDevX/lampify

About

A simple CLI application to control the BLE lamp

Resources

Stars

1 star

Watchers

0 watching

Forks

 
 

Latest commit

 

History

6 Commits

Folders and files

Repository files navigation

Lampify

A GNOME Shell extension that controls cheap Bluetooth LE ceiling lamps from Quick Settings: on/off, light presets and pairing. No root, no extra daemons. It talks to the lamp through BlueZ over D-Bus.

Lampify in GNOME Quick Settings

This started as a fork of MasterDevX/lampify, a C command-line tool. The protocol is now reimplemented in JavaScript, and the C code is gone.

Features

  • Lamp toggle in Quick Settings to switch the light on and off
  • Preset bar in the toggle's menu: Night, Dim, Warm, Cool and Bright. Click a point or drag the knob, which snaps to the nearest preset. Arrow keys and scrolling work too.
  • Pair and unpair from the extension's preferences
  • Optional: the keyboard backlight turns on when the lamp goes off, and off when it goes on
  • Choose which Bluetooth adapter to use, or let it pick the first powered one

Compatible lamps

Lamps controlled by these Android apps share the same protocol and should work (tested with Victoria Lighting Losange/PL500):

Requirements

  • GNOME Shell 51
  • BlueZ with Bluetooth turned on

Install

git clone https://github.com/erfanium/lampify.git
cd lampify
make install

Log out and back in (Wayland), then enable it:

gnome-extensions enable lampify@erfanium.local

Pairing

The lamp has to learn your computer's ID once:

  1. Switch the lamp on at the wall.
  2. Within a few seconds, open the extension's preferences and press Pair.
  3. The lamp blinks when it has learned the ID.

How it works

Commands are sent as BLE advertisements through BlueZ. The lamp needs a Flags field that BlueZ only adds while the adapter is discoverable, so your computer is visible to nearby devices for about a second per command.

Development

make dev                                   # nested GNOME Shell with only this extension (run make install first)
tools/lampify-cli.js on                    # same code as the extension, from a terminal
tools/lampify-cli.js preset warm
tools/lampify-cli.js color 50 100          # brightness %, warmth %

About

A simple CLI application to control the BLE lamp

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages