Fluval Aquasky BLE RGB-Light

Hi @alpopone,

sorry for the (very) late reply. Somehow I am not getting email notifications any longer…

Oddly enough, I never had any issues getting a correct system time before the addon connects to the lights - but then again, many things in ESPHome changed in the last year(s)… :wink:

To be honest, your solution looks quite good, but you could skip the reconnection by using the time sync function of the addon. I created a button on my dashboard for that, but you could try to implement that into the time sync trigger.

The button I made works like this:

button:
  - platform: template        
    id: freki1_timesync    
    name: Freki1 sync time
    on_press:
      then:
        - fluval_ble_led.sync_time: fluval_freki1

fluval_freki1 is the name of the addon instance:

fluval_ble_led:
  - ble_client_id: ble_freki1
    time_id: ha_time
    number_of_channels: 4
    id: fluval_freki1

So in your case you could try:

time:
  - platform: homeassistant
    id: ha_time
    on_time_sync:
      then:  
        - fluval_ble_led.sync_time: <your fluval_ble_led name here>

best regards
mrzottel

Hi @dannyslinn,

sorry for the late answer - as I already said, I am not getting email notifications anymore :wink:

Also, time flies by, it’s no longer funny anymore :woozy_face:

So in theory, every device compatible with ESPHome should work as long as it supports bluetooth.

Personaly, I use these boards: AZDelivery 1 x ESP32 Dev Kit C V4 NodeMCU WLAN WiFi Development Board mit USB-C Anschluss kompatibel mit Arduino inklusive E-Book!: Amazon.de: Computer & Zubehör

but their availability might be limited depending on where you live on this planet :wink:

Also, an “open” dev board might not be your ideal setup if you never worked with stuff like this before. I 3d printed a “mostly watertight” case for it and put it on a selfmade PCB with some relais, a LCD and ports for temperature sensors and stuff like that which monitors my fish tank and starts fans in case of over temperature etc. So a bit more involved than just controlling lights.

If you still want to go on with the project, just write me a PM and we can figure out what works best for you :wink:

best regards
mrzottel

Hi @mrzottel ,
Thank you for your response and support!
I tested your suggestion and it works great in my enviroment. Will stick to it as it is more elegant than a full disconnect-reconnect cycle.

Best Regards,
Alexander

Hello, which / are any / esp home components still supported?
I deployed fluval_ble_led a year or two ago - the old fluval_ble_led seems no longer online and I can get none of the external components configs found in this thread to work.
This is blocking me from making any changes to the esphome device at all.

For this external component,

external_components:
  - source: github://mrzottel/esphome@fluval_ble_led
    components: [ fluval_ble_led ]

I get the following errors:

Failed config

external_components: [source /config/esphome/aquarium-ble-light-controller.yaml:3]

  • source: github://mrzottel/esphome@fluval_ble_led
    components:

    Could not find init.py file for component fluval_ble_led. Please check the component is defined by this source (search path: /data/external_components/7f010557/esphome/components/fluval_ble_led/init.py).

    • fluval_ble_led

Thanks for all your hard work. And for your incredibly nicely readable formulated comments

Hi all, trying to wrap my head around this thing. I have a Fluval AquaSky 2 and would love to be able to simply turn it on and off from within HA.

I have an ESP32 with a base ESPHome install on it that has been brought into ESP builder and added to HA. Do I literally add this code to the yaml for this device in ESP Builder to get this started?

external_components:
  - source: github://mrzottel/esphome@fluval_ble_led
    components: [ fluval_ble_led ]

I’ve not done a lot of direct yaml work before, outside of supplying a variable here and there to existing code, so I’m a little uncertain how this is supposed to work. :confused:

Honestly I’m also not entirely clear how it works once it’s connected… will entities automatically appear in HA once the above code is added and the ESP32 is near enough to the tank to connect?

I currently am running in Pro mode and am happy with the settings, but it’s a hassle anytime I simply want to turn the lights on and off for a moment outside of the set programming. That’s sort of what I’m hoping for here. And I guess this hopefully fixes the clock drift and power loss reset problem is an added bonus, although I’ve literally never been affected. (good luck, as I’ve read the reports of others who have so I know it’s a legit thing)

Hi all,

it seems that the latest ESPHome update broke the component. I’m on it.

Update: Component compiles again and seems to work fine on my test setup. I love breaking changes before christmas :grimacing:

best regards
mrzottel

1 Like

Hi @kalanster,

just adding the component would not be enough, it needs to be configured as well as the required entities added. There is quite some documentation about that as well as sample yaml in the thread above.

If that does not help you, feel free to PM me =)

best regards
mrzottel

Is it also possible to run on home assitant (rpi5) without esp home?

If I’m understanding correctly this is all developed as a custom ESPhome plugin. I’m wondering - is there a reason for that (personal preference)?

Reason I wonder is, if technically possible, it would be convenient to package the logic into a HA integration that runs on top of its BT stack (Bluetooth proxy, etc). At least, I’d love to leverage that.

Hi @RFC793,

yes, this is all in a custom ESPHome component. It was kind of a mix of personal preference and my interest to control my Fluval LEDs with the ESPHome devices I already used to check and influence temperature in the aquarium.

So I tried to find a component and found this thread, but there was no ready to use component yet but some very good work already done. I kind of reverse engineered the protocol and encryption and managed to create the C++ part of the component quite quickly. (I’m more used to C# though). The Python part was way harder for me to get right, and I think I did not really fully understand how it works today.

I started to work on a HA integration, but since this was even more Python, I did not get far, especially since HA is a way bigger hill to climb than ESPHome was.

But I will gladly assist in anyone trying to make an integration out of this!

best regards
mrzottel

Thanks. That makes a lot of sense. I’m actually in the market to buy a new aquarium light. And of course I’m looking at automation and saw a few hopeful candidates.

  • There’s Hygger’s smart lights. They apparently use Tuya under the hood (at least one of the graphics on Amazon say to use the Tuya app). So, could maybe leverage the Tuya BLE already in HA, or maybe reflash it with ESPhome. Price is low, a bit of a gamble, and doesn’t seem to have separate cold vs warm white channels (it does have a load of LEDs though.
  • There’s Glowarium. I’m skeptical, but with BLE and WiFi - can surely get one of them working, even if it is a custom firmware (or maybe not and it will always be glued to the Chinese Cloud)
  • Then there’s the Fluvals. They are pricier than I first wanted (and seem to be comparatively low wattage). They are a name brand, AND someone has at least cracked the comms - so that’s a huge plus. BUT: there is a new generation (Aquasky 3.0) that I would want to get. It supports BLE and WiFi, but also boasts a new app - and I fear they may not be protocol compatible. Or worse: they do actual encryption.

So now I don’t know whether to go for the Fluval 3.0 and hope for the best. Get the 2.0, it isn’t as nice but I know I can integrate it. Or a cheapo where I don’t risk much if I end up needing to reflash it.

Fun times. Do you know if 3.0 speaks the same protocol?

Regarding programming effort I have about 20 years of Python, and even more C/C++ under my belt. I would definitely give it a shot.

Nice project!
I have two tanks with Aquasky “Bluetooth 1st generation”.
is this the version 2 or version 1 of the AquaSky?
I am a bit confused.

Regards!
Dennis

I had a look at it and my best guess would be, that the Aquasky 3.0 still uses the same protocol, since it has mostly the same features etc. It is also controllable by bluetooth like the older ones - only wifi is new, but even this would require bluetooth to set up.

I have no Aquasky 3.0 to test though, so this is really just a guess based on the the fact that it costs money to create a new protocol and/or encryption and I have not heard from Fluval yet that they considered this component a security issue. So no need for them to spend any money to do the same things but different… :wink:

But to be sure, either the source code or some reversing of the fluval connect app might help :wink:

Also, if you want to create a HA integration I am happy to assist if you want. The ESPHome component is in a github repo, all of the quite simple decoding and the protocol are in one C++ file. I tried to create a HA integration myself, but got a bit lost in all the frameworks etc. used by HA, including their own, and never found the time to really get into it.

@SuperElma “Bluetooth 1st generation” is AquaSky 2, which use a “bluetooth only” connection.

1 Like

This is my repo when I was working on this

I had two lights connected, it took a lot of memory from the ESP device so it wasn’t very stable. I used it to auto sync my lights whenever there was a power outage. If only they included an RTC chip in these…

hey, thanks for all the hard work. I have one light i believe it is the aquasky 1.0 or some kind of planted version i can not remember.

i got everything working except in the logs my esp seems to connect then disconnect. the esp is place right next to the light as well.

this is my current yaml.

esphome:
  name: fluvalble
  friendly_name: fluvalble
  min_version: 2025.11.0
  name_add_mac_suffix: false

esp32:
  board: esp32dev
  framework:
    type: esp-idf
    version: recommended
logger:
  level: VERY_VERBOSE
  logs:
    i2c.arduino: INFO
    i2c.idf: DEBUG
    esp32_ble_tracker: DEBUG
    esp32_ble: DEBUG
    component: ERROR
    api.service: DEBUG
    scheduler: DEBUG
    fluval_ble_led: VERY_VERBOSE
# Enable Home Assistant API
api:

# Allow Over-The-Air updates
ota:
- platform: esphome

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password


esp32_ble_tracker:
time:
  - platform: homeassistant
    id: ha_time

external_components:
  - source: github://mrzottel/esphome@fluval_ble_led
    components: [ fluval_ble_led ]

ble_client:
   - mac_address: 44:A6:E5:65:40:68
     id: bigtankClient

fluval_ble_led:
   - ble_client_id: bigtankClient
     time_id: ha_time
     number_of_channels: 4
     id: bigtank 


sensor:    
  - platform: fluval_ble_led
    fluval_ble_led_id: bigtank 
    channel: 1      
    zero_if_off: true
    name: "bigtank  Channel Red"

  - platform: fluval_ble_led
    fluval_ble_led_id: bigtank 
    channel: 2      
    zero_if_off: true
    name: "bigtank  Channel Green"  

  - platform: fluval_ble_led
    fluval_ble_led_id: bigtank 
    channel: 3      
    zero_if_off: true
    name: "bigtank  Channel Blue"  

  - platform: fluval_ble_led
    fluval_ble_led_id: bigtank 
    channel: 4      
    zero_if_off: true
    name: "bigtank  Channel White" 

text_sensor:
  - platform: fluval_ble_led
    fluval_ble_led_id: bigtank 
    name: "bigtank Mode"

button:  
  - platform: fluval_ble_led
    fluval_ble_led_id: bigtank 
    mode: "MANUAL"
    name: "bigtank Switch to manual"

  - platform: fluval_ble_led
    fluval_ble_led_id: bigtank 
    mode: "AUTO"
    name: "bigtank Switch to auto"

  - platform: fluval_ble_led
    fluval_ble_led_id: bigtank 
    mode: "PRO"
    name: "bigtank Switch to pro"

number:
  - platform: fluval_ble_led
    fluval_ble_led_id: bigtank 
    name: "bigtank Red"
    channel: 1
    zero_if_off: true

  - platform: fluval_ble_led
    fluval_ble_led_id: bigtank 
    name: "bigtank Channel Green"
    channel: 2
    zero_if_off: true

  - platform: fluval_ble_led
    fluval_ble_led_id: bigtank 
    name: "bigtank Channel Blue"
    channel: 3
    zero_if_off: true

  - platform: fluval_ble_led
    fluval_ble_led_id: bigtank 
    name: "bigtank Channel White"
    channel: 4
    max_value: 1000
    step: 10
    zero_if_off: true


switch:
- platform: fluval_ble_led
  fluval_ble_led_id: bigtank 
  name: "bigtank LED Switch"

and here is what i think the relevent log is.

10:22:51.655][I][esp32_ble_client:125]: [0] [44:A6:E5:65:40:68] 0x00 Connecting
[10:22:51.655][V][esp32_ble_client:045]: [0] [44:A6:E5:65:40:68] Set state 4
[10:22:51.656][D][esp32_ble_tracker:826]: Scan stop complete, set scanner state to IDLE.
[10:22:51.656][D][esp32_ble_tracker:163]: connecting: 1, discovered: 0, disconnecting: 0
[10:22:51.860][VV][app:515]: logger loop enabled from ISR
[10:22:51.874][VV][esp-idf:000][BTU_TASK]: W (121295) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e dev_find 1
[10:22:51.969][VV][app:515]: logger loop enabled from ISR
[10:22:51.995][VV][esp-idf:000][BTU_TASK]: W (121400) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e dev_find 1
[10:22:52.077][VV][app:515]: logger loop enabled from ISR
[10:22:52.093][VV][esp-idf:000][BTU_TASK]: W (121516) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e dev_find 1
[10:22:52.185][VV][app:515]: logger loop enabled from ISR
[10:22:52.200][VV][esp-idf:000][BTU_TASK]: W (121610) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e dev_find 1
[10:22:52.281][VV][app:515]: logger loop enabled from ISR
[10:22:52.290][VV][esp-idf:000][BTU_TASK]: W (121726) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e dev_find 1
[10:22:52.372][VV][app:515]: logger loop enabled from ISR
[10:22:52.376][VV][esp-idf:000][BTU_TASK]: W (121819) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e dev_find 1
[10:22:52.473][VV][app:515]: logger loop enabled from ISR
[10:22:52.572][VV][esp-idf:000][BTU_TASK]: W (121924) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e dev_find 1
[10:22:52.588][VV][app:515]: logger loop enabled from ISR
[10:22:52.589][VV][esp-idf:000][BTU_TASK]: W (122030) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e dev_find 1
[10:22:52.678][VV][app:515]: logger loop enabled from ISR
[10:22:52.694][VV][esp-idf:000][BTU_TASK]: W (122134) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e dev_find 1
[10:22:53.193][VV][app:515]: logger loop enabled from ISR
[10:22:53.204][VV][esp-idf:000][BTU_TASK]: W (122659) BT_HCI: hcif disc complete: hdl 0x0, rsn 0x3e dev_find 1
[10:22:53.725][VV][app:515]: logger loop enabled from ISR
[10:22:53.735][V][esp32_ble_client:288]: [0] [44:A6:E5:65:40:68] gattc_event_handler: event=41 gattc_if=3
[10:22:53.735][D][esp32_ble_client:379]: [0] [44:A6:E5:65:40:68] ESP_GATTC_DISCONNECT_EVT, reason 0x3e
[10:22:53.736][V][esp32_ble_client:045]: [0] [44:A6:E5:65:40:68] Set state 1
[10:22:53.739][V][fluval_ble_led:226]: GOT GATTC EVENT: 41
[10:22:53.739][W][fluval_ble_led:229]: Disconnected from Fluval LED. Resetting handshake.
[10:22:53.740][V][esp32_ble_client:288]: [0] [44:A6:E5:65:40:68] gattc_event_handler: event=2 gattc_if=3
[10:22:53.740][D][esp32_ble_client:211]: [0] [44:A6:E5:65:40:68] ESP_GATTC_OPEN_EVT
[10:22:53.748][E][esp32_ble_client:324]: [0] [44:A6:E5:65:40:68] ESP_GATTC_OPEN_EVT in DISCONNECTING state (status=133)
[10:22:53.748][W][esp32_ble_client:223]: [0] [44:A6:E5:65:40:68] Connection open error, status=133
[10:22:53.755][V][esp32_ble_client:045]: [0] [44:A6:E5:65:40:68] Set state 2
[10:22:53.768][V][fluval_ble_led:226]: GOT GATTC EVENT: 2
[10:22:53.830][D][esp32_ble_tracker:163]: connecting: 0, discovered: 0, disconnecting: 0

thanks so much for any help.

Hi @11binary00,

so the configuration looks good so far. What’s happening is that the connection drops right after connecting, but from the underlying esp32_ble_client.

Things you could check:

  1. Are there really 4 channels on the device?
  2. Is the mac address correct? (it looks like it’s correct, since most lights start with 44:46, but who knows?)
  3. Is the app on your phone active the same time? Only one device can connect to the light at the same time unfortunately. So maybe the app and your esp are fighting against each other.

best regards
mrzottel