bulber is a Java Swing app for controlling a TP-Link Smart Bulb.
It supports vocal and GUI commands.
- JRE/JDK 8+
- TP-Link Smart Bulb (Kasa) connected to the WLAN
A list of supported bulbs can be found here.
Clone this repo and run mvn clean package
on the directory where the pom.xml is located.
Then simply run java -jar bulber-1.0.jar
.
The usage instructions.
During startup, bulber searches for all smart bulbs in the local network.
When the search is done, this window is shown:
You can double-click on a table element, or select it and hit Start, to use the specific bulb.
If no bulb was found, you can click on the Refresh button to repeat the search.
If it doesn't work, try to disconnect and reconnect to your local network, where the bulb is connected,
and click on the Refresh button again.
After loading, this window is shown:
In the Microphone section, you can press the mic icon (without releasing) to activate the vocal command function.
The check-box Keep on actives vocal commands without the need of the user to keep the mic button pressed.
The blue screen shows vocal commands done by the user, if they are valid, in LCD style; the slider below changes the speed of the text shown in the display.
These are the supported vocal commands:
Change the color of the bulb.
Supported values are:
- black
- blue
- magenta
- cyan
- gray
- green
- orange
- pink
- red
- white
- yellow
Here the audio example.
Change the brightness of the bulb.
Values in range [0,100]
are supported.
Here the audio example.
Changes the temperature, in Kelvin, of the bulb.
Supported by a subset of bulbs, range variates from bulb to bulb.
Here the audio example.
Change the color of the bulb, specified by its red, green and blue (RGB) values.
This command is ideal for selecting a specific color, not covered by the color case.
The three numerical values are in the RGB range [0,255]
and must be separated by the word dot.
Here the audio example.
Start the bulb after it's been shutdown with off.
You cannot start a bulb when the light switch is off.
Shutdown the bulb.
Can be reopened with on.
The parameter transition can be appended to a vocal command.
Through this, you can control the transition between the previous and new state of the bulb. For example,
specifying a transition of 5 seconds at the color blue
command will cause the bulb to switch to that color
in the span of 5 seconds; so, less the value, less the time to switch to color blue.
The value can be in milliseconds (plain number) or seconds (seconds appended to the number value).
Range is [0,15000]
for milliseconds and [0,15]
for seconds.
Here the milliseconds audio example.
Here the seconds audio example.
The GUI is pretty simple:
- Color Picker: change the color of the bulb. You can also select an RGB value from the relative tab. (Note)
- Brightness: change the bulb color brightness
- Temperature: change the bulb temperature (not available in all bulbs)
- Transition: control the transition (both in seconds and in milliseconds) for the previous commands
To confirm the change, you need to press the Confirm button of the command section.
When a vocal command is fired, the respective GUI section is updated.
For example, a temperature 8000 transition 3 seconds vocal command causes the temperature section
to change to 8000K (both the text field and the slider) and the transition section to 3s (both the text field and the slider).
The inverse is not valid (e.g. if the transition is set to 3s in the GUI, a vocal command is not affected by it).
You can select a language flag at the top right of the panel to change language.
The default language is automatically detected from the JVM.
For now, only english and italian are supported.
The italian settings for vocal commands are the followings:
- colore
- nero
- blu
- magenta
- ciano
- grigio
- verde
- arancione
- rosa
- rosso
- bianco
- giallo
- potenza
- temperatura
- numerico
- Separator is the word punto
- apri
- chiudi
Transition is transizione with seconds as secondo | secondi
- The button shows information about the bulb
- The button returns to the Startup window
The color picker panel language cannot be changed due to a bug of the Swing framework.
Alessandro Chiariello (dems98)