air-q-kotlin
is a small helper written in Kotlin giving you the ability to access
commonly required features which are missing in air-Q's UI and official Python library
aioairq
.
I bought air-Q because it's advertised as "Cloud is optional". However, I was very disappointed when the built-in UI did not allow me to set any relevant configuration. One cannot set the many LED themes the device supports, it's not even possible to configure the IP setup. π
Support initially redirected me to official apps for Android and iOS. This is of course not the same as "Cloud", but for privacy-concerned people (like me π€) this is also unacceptable. I do not want to install additional software on some phone to configure another device.
Luckily, both the Python library and air-Q UI's JavaScript show how to access the API
and from the structure of the config data one can easily guess what data to set to.
This is how air-q-kotlin
was born.
At this point, a thanks to the air-Q guys, providing me with additional documentation, making it a bit easier for me. π
The following table compares all supported features between air-q-kotlin
,
the air-Q's UI and the official Python library (as of 2023-04-11).
Feature | supported byair-q-kotlin |
supported by air-Q's UI |
supported byaioairq |
---|---|---|---|
check for correct password by ping endpoint |
β | - | β |
read all configuration keys/values | β | β | β |
read current data | β | β | β |
read average data | β | β | β |
access the device's log | β | β | β |
set WLAN login data | β | β | β |
set air-Q's password | β | β | β |
read/change the device's category | β | β | β |
read/change the device's name | β | β | β |
enable/disable cloud upload | β | β | β |
enable/disable cloud remote | β | β | β |
trigger firmware update | β | β | β |
configure NTP server | β | β | β |
configure custom IP setup (disabling DHCP) | β | β | β |
set IP setup back to DHCP | β | β | β |
set LED brightness | β | β | β |
set LED brightness (day/night mode) | β | β | β |
set LED theme (individually for each side) | β | β | β |
identify air-Q device (by blinking its LEDs) | β | β | β |
manually restart air-Q device | β | β | β |
gracefully shutdown air-Q device | β | β | β |
air-Q has a lot more features to be configured. I only implemented the missing things I needed for it to operate. Also, air-Q support warned me not every feature is available for every device tier. So I tinkered with my device as little as possible.
air-q-kotlin
is not a nice console tool, but for "run once".
- Go to Main.kt, uncomment and change the parts you need.
- Setup environment variables
AIRQ_HOST
(mDNS name or current IP address) andAIRQ_PASSWORD
.
- Run the application.
As the better alternative, you can use an IDE (I used IntelliJ).
- Create a run configuration with above environment variables.
- But a breakpoint in
Main.kt
afterairQ
is declared, that is the}
line. - Run in Debug mode.
- Use "Evaluate Expression" on the
airQ
instance to read from/apply to your air-Q device instantly. π