Fluval Aquasky BLE RGB-Light

Nice one =)

The fluval stuff (I came to this forum in hope of a ready to use integration after all :wink: ) is part of a project:

The small black block with the two capacitors in the lower left is a voltage regulator to be able to power the whole thing from 12 volts (power brick of the LED), temperature sensor (connected on the top left) and a small display, and two 12V relays (large black blocks in the middle, switched through the white optocoppler and the two transistors). The PCBs for that are ordered in china and will be here eventually. Also it gets a 3D printed case :wink:

The idea behind it is to have the temperature and then use one relay to switch the cooling fans on/off depending on the temperature. The second relay can be used to switch “dumb” lights like on most of the nano tanks, which also will supply the power through their power bricks. In theory, those Omron relays are also capable of switching mains voltage - but thats a bit too hot for me. Thats what smart plugs are for - and home automation - anyway :wink:

So with having an ESP at each fish tank anyway, the idea of controlling the Fluval lights came naturally :wink:

Best regards
mrzottel

2 Likes

cant wait for the write up and ill have to start looking into esp never used it so thatll be new for me. also wanted to incorporate a temp probe so itll send me a notification on my phone if the tank water gets too hot or too cold. was also thinking of maybe a sensor if there was a way not sure if possible to measure the amount of co2 in the cylinder so id no when its getting low…

I hope I get to it this weekend. Currently, daytime job (also coding…) takes too much time :wink:

Measuring a co2 cylinder should be possible with a load cell to measure the cylinders weight. A full cylinder with 500g CO2 in it would be 500g lighter if empty. At least that’s the manual way I measure my cylinders.

Best regards
mrzottel

The documentation preview is online, but I have no idea for how long. Please bear in mind that I am not a native english speaker, so have mercy :wink:

Fluval BLE LED — ESPHome (deploy-preview-2653–esphome.netlify.app)

The documentation of course lacks this part:

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

as it is targeted towards a merged component.

Best regards
mrzottel

I am having an issue with running an automation. At 7pm everyday (when a dropdown helper is set to a value), I change the rgb values on the fish tank lights to other values, but sometimes that doesn’t work. The code for the automation in YAML is:

alias: Big Tank Night Mode
description: ""
trigger:
  - platform: time
    at: "19:00:00"
condition:
  - condition: state
    entity_id: input_select.big_tank_lights_automation_mode
    state: Normal
action:
  - device_id: 3acaa91425aeff3c03c554bf13160383
    domain: number
    entity_id: number.channel_red
    type: set_value
    value: 1000
  - device_id: 3acaa91425aeff3c03c554bf13160383
    domain: number
    entity_id: number.channel_green
    type: set_value
    value: 300
  - device_id: 3acaa91425aeff3c03c554bf13160383
    domain: number
    entity_id: number.channel_blue
    type: set_value
    value: 1000
  - device_id: 3acaa91425aeff3c03c554bf13160383
    domain: number
    entity_id: number.channel_white
    type: set_value
    value: 50
mode: single

and the configuration for the esphome is:

esphome:
  name: "fishtank-controler"

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:


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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-92Feac"
    password: "KDnpJiLVW33v"
  
  manual_ip:
    static_ip: 192.168.1.74
    gateway: 192.168.1.1
    subnet: 255.255.255.0

captive_portal:

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

time:
  - platform: homeassistant
    id: ha_time

esp32_ble_tracker:

ble_client:
   - mac_address: 44:A6:E5:1E:65:E1
     id: big_tank_ble

fluval_ble_led:
  ble_client_id: big_tank_ble
  time_id: ha_time
  number_of_channels: 4
  id: my_fluval_led

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

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

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

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

text_sensor:
  - platform: fluval_ble_led
    fluval_ble_led_id: my_fluval_led
    mapping_manual: "Manuel"
    mapping_auto: "Auto"
    mapping_pro: "Pro"
    name: "Mode"

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

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

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

  - platform: restart
    name: "Living Room Restart"

  - platform: shutdown
    name: "Living Room Shutdown"  
  

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

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

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

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

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

Hi,
first of all, many thanks for the great work. I only have one issue, I am not using home assistant, and would like to use mqtt with iobroker. The only issue I have is that as soon as I add mqtt with a broker address to the yaml, I get complains from esphome that:
INFO Generating C++ source…
ERROR ID mqtt_mqttbuttoncomponent is already registered

This disappears as soon as I remove the button definition for the fluval lamp.

With the API it works with home assistant, but I would prefer to use SNTP and MQTT

SNTP works fine, but as mentioned mqtt needs removal of the button definitions.

cu

Hi mpovel,

thanks for the feedback - I will have a look at this issue this weekend. I am not using mqtt, but I think I can set up some testing stuff for that.

I’ll update this post as soon as I got it fixed!

Update: Turned out I did not need an MQTT broker to reproduce this. It’s fixed in the latest commit.

Best regards,
mrzottel

Hi ODog2028,

if it fails sometimes, it might be due to BLE loosing connection. I’m still trying to find a good way to handle connection issues. Maybe implementing a queue with a retry mechanism or something similar.

Thanks a lot for the yaml code, I will use this as a base for testing. I’m quite new to HA myself, so I had no idea how to automate this at all :wink:

Best regards
mrzottel

Hi,
sounds great, and yes you won’t need any MQTT broker, as the issue already occured as soon mqtt was configured in the yaml…

Many thanks

Hello ! @mrzottel THANK YOU SO MUCH !!! I’m using your module it’s working well on an esp-wroom-32!
I have 2 issues:

  • it restarts sometimes. Here is the uptime graph:

    But I already saw that in another BT module, and I feel it’s the Bluetooth stack in this board
  • I have a demand for a feature:
    since it’s not possible to connect more than one device at the same time to the light,
    do you think there is a way to add a switch to disconnect the esp device from the light to left my phone connect and do some setting changes (like changing auto mode light settings)?
    And then turn back on the switch to reconnect the esp device to the light ?

Thanks !

Hi @titilambert,

thanks a lot =)

I had those restarts as well, when I was using too many components. I am using an ESP32 Dev Kit C V4 from az-delivery for testing. You are right, the BT stack is using a lot of memory - and the EPS32 only has 320kb data memory. So the reboots were due to running out of memory after a while. I disabled another memory intensive component - the web server component - and since then, I had no more reboots. I lost the “fallover rescue mode when Wifi could not be connected”, but since I have access to my ESP32 with a cable and laptop, I could live with that :wink: Current uptime of my ESP32 is 62 hours - it restarted when the cat tried to eat the power cable. (The cat is fine).

About the feature:

This already is possible, but not directly from the Fluval module. The Fluval module is using BLE Client to connect to the device, and this client handles all the required connection stuff.

There is a “BLE Client Switch” to turn on/off the BLE Client: BLE Client Switch — ESPHome

I just found that out though, so I have not tested it myself with the Fluval module - i.e. if the module is able to reconnect, and how exactly it handles. But I will test this asap and if necessary fix the Fluval module to make it work with this switch.

Edit: I just tested the BLE Client Switch: It just works out of the box as expected. Switching off allows my phone to connect, switching back on gives control back to ESP32. I will check if I find a way to either hide or disable the Fluval module switches/buttons etc. to reflect the connection sate though, to make it more visible :wink:

Best regards
mrzottel

@mrzottel, great job on this project! I got it up and running pretty easily. I was having problems originally but I think it was related to trying to include a Dallas Temperature probe on the same board (ESP32 CP2102 TYPE-C). Maybe too resource intensive to run both tasks? Anyway, once I removed the Dallas code from the yaml and disconnected the probe itself, it was pretty simple. Documentation was good too.

Really looking forward to the internal LED clock not getting reset anytime there’s a power bump. I set my light up to manual mode and created some automations to bring the lights up and down each day. My only gripe (not your fault) is I won’t get the smooth lighting transition that the pro mode in the official app provided. I’m sure there’s a way to set it up but that’ll be a project for another day.

Hi @Rastrillo,

using a temperature probe should work, as it has no significant impact on resources. For my project I posted above, I am using a DS18B20 probe to switch a relay for a cooling fan. I heard about issues with DS18B20 probes (non genuine ones, like they are usually used in those premade waterproof housings) when using “parasite power mode”. They might pull the signal bus low after a while, crashing the ESP32. Did you connect all three wires of the probe, and placed a pull up resistor between vcc and signal?

Also, as you mentioned setting interal LED clock after reset - good call! I will change the Fluval component to update the clock after each reconnect instead of only the first connection. This will make sure, that the clock is up to date after a power cycle of the Fluval LED.

Best regards
mrzottel

Sorry for the delay - I did not abandon this project, I just found out that Covid is still a thing…

I added reconnection stuff to the component, so in case of Fluval LED power loss, the component gets the disconnect and on reconnect sets the time again.

I also created a PR request to start the journey towards getting this component into ESPHome. Whish me luck :wink:

Best regards
mrzottel

3 Likes

Struggling to get this to work correctly. Config is below. It connects/disconnects fine. And I can seem to switch between man/auto/pro. But it seems like in manual White is stuck at 1000 and the RGB channels at 0. Any suggestions?

Edit: It’s an aquasky

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

esp32_ble_tracker:

ble_client:
  - mac_address: MAC
    id: ble_fluval1
    on_connect:
      then:
        - lambda: |-
            ESP_LOGD("ble_client_lambda", "Connected to BLE device");
    on_disconnect:
      then:
        - lambda: |-
            ESP_LOGD("ble_client_lambda", "Disconnected from BLE device");

fluval_ble_led:
  - ble_client_id: ble_fluval1
    time_id: homeassistant_time
    number_of_channels: 5
    id: fluval_1

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

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

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

switch:
  - platform: fluval_ble_led
    fluval_ble_led_id: fluval_1
    name: "Tank 1 light"

  - platform: ble_client
    ble_client_id: ble_fluval1
    name: "Fluval 1 BLE Connection"

text_sensor:
  - platform: fluval_ble_led
    fluval_ble_led_id: fluval_1
    mapping_manual: "Manual"
    mapping_auto: "Automatic"
    mapping_pro: "Pro"
    name: "Tank 1 mode"

sensor:
  - platform: ble_client
    type: rssi
    ble_client_id: ble_fluval1
    name: "Fluval RSSI"

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

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

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

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

  # - platform: fluval_ble_led
  #   fluval_ble_led_id: fluval_1
  #   channel: 5
  #   zero_if_off: true
  #   name: "warm white"

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

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

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

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

Edit 2: I’m an idiot. Forgot to the number of channels to 4 in the fluval_ble_led…

1 Like

Thank you for your work on making this work :slight_smile:
I can get my fluval to appear on HA and I can do on/off and change the brightness for RGB+W but seems like settings the modes don’t really do anything. Manual just allows me to change the sliders, but auto and pro don’t do anything!?
Looks like this might be related to date/time. See log:
[15:07:51][D][fluval_ble_led:320]: Year: 23 / Month: 0 / Day: 10 / Day of week: 1 / Hour: 16 / Minute: 7 / Second: 51 / Checksumm: 94
There’s no month zero lol.
But it is actually 4:ish PM now, and we are in 2023 on a Monday. Not sure how it counts the days, from Sunday or Monday, and from 0 or 1…
Is there no way to set the “weather effects”?

My device is model 14556, some pictures of the box and the app:









@anon78847916

The mode setting is a bit special and easy to confuse.

Setting the RGB+W values as well as on/off only works in manual mode. This is the only mode which allows direct interaction with the light.

Auto and Pro modes are modes which need to be configured in the app, and then you can only switch between those modes using HA, but not edit those, as this would require quite a complicated interface to do.

So if you configure pro and/or auto with the smartphone app (you need to disable the fluval_ble_led connection for the app to be able to connect), and switch to this mode, the light should switch to whatever is configured in that mode for the current time.

The time setting is correct, even if it looks strange. I replicated what the app sends as date/time, and the app sets the month to 0 as well. Day of week starts on a sunday with 0 - don’t ask why, again just as the app does. :wink: But some testing showed, that the light is only using time anyway, which makes sense, as I can not configure a weekly program, just a 24 hour program which is the same each day using the app.

So far I have not tried to get the weather effects running, as I personaly never used them. Currently, the module is in the progress of (hopefully soon) be included into ESPHome. Once it is there, I will have a look at weather effects and maybe more additions, but currently I want to “freeze” the features to make the integration into ESPHome easier.

Best regards
mrzottel

1 Like

I understand. I’ll go downstairs now and configure the Pro mode, see what happens. Yesterday I had activated Pro on the app and it was showing daylight in the middle of the day. But when I disconnected the app and connected the ESP I only had the blue light, which is the stage called “night” and just before it goes completely off for the fish to sleep. So not sure what happened. I’ll report back.
As for the effects I understand too. Hope you can implement everything. If I may suggest, home assistant has itself the ability to connect to Bluetooth devices, this would give you a lot more flexibility because creating a light device means you can include lighting effects!! But if you still want to stay with ESPHome they probably have the same thing… In Home Assistant lighting effects can be called with a service inside an automation, then you can literally configure anything easily.

Excellent work! I have been eagerly anticipating this ever since you hinted that you would look into it.

I have 2 Aquasky 600mm devices. One of them is setup and working perfectly!! Thank you so much for making this possible.

However, I am having an issue with the second one. I keep getting a GATT error 133 when it attempts to connect.

esphome:
  name: esphome-web-40fa1c
  friendly_name: Fishtank LED Controller

esp32:
  board: esp32dev
  framework:
    type: arduino

esp32_ble_tracker:

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

ble_client:
  - mac_address: "44:A6:E5:38:CF:85"
    id: "Left"

  - mac_address: "44:A6:E5:35:B2:0C"
    id: "Right"

time:
  - platform: homeassistant
    timezone: "US/Central"
    id: ha_time

fluval_ble_led:
  - ble_client_id: "Right"
    time_id: ha_time
    number_of_channels: 4
    id: my_fluval_led_right

  - ble_client_id: "Left"
    time_id: ha_time
    number_of_channels: 5
    id: my_fluval_led_left
  

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

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

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

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

  - platform: fluval_ble_led
    fluval_ble_led_id: my_fluval_led_right
    channel: 1      
    zero_if_off: true
    name: "Left Channel Red"

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

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

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

text_sensor:
  - platform: fluval_ble_led
    fluval_ble_led_id: my_fluval_led_left
    mapping_manual: "Manuel"
    mapping_auto: "Auto"
    mapping_pro: "Pro"
    name: "Right Mode"
  - platform: fluval_ble_led
    fluval_ble_led_id: my_fluval_led_right
    mapping_manual: "Manuel"
    mapping_auto: "Auto"
    mapping_pro: "Pro"
    name: "Left Mode"  

button:  
  - platform: fluval_ble_led
    fluval_ble_led_id: my_fluval_led_left
    mode: "MANUAL"
    name: "Right to manual"

  - platform: fluval_ble_led
    fluval_ble_led_id: my_fluval_led_left
    mode: "AUTO"
    name: "Right to auto"

  - platform: fluval_ble_led
    fluval_ble_led_id: my_fluval_led_left
    mode: "PRO"
    name: "Right to pro"

  - platform: fluval_ble_led
    fluval_ble_led_id: my_fluval_led_right
    mode: "MANUAL"
    name: "Left to manual"

  - platform: fluval_ble_led
    fluval_ble_led_id: my_fluval_led_right
    mode: "AUTO"
    name: "Left to auto"

  - platform: fluval_ble_led
    fluval_ble_led_id: my_fluval_led_right
    mode: "PRO"
    name: "Left to pro"  

  - platform: restart
    name: "Aquarium Light Restart"

  - platform: shutdown
    name: "Aquarium Light Shutdown"  
  

number:
  - platform: fluval_ble_led
    fluval_ble_led_id: my_fluval_led_left
    name: "Right Channel Red"
    channel: 1
    zero_if_off: true

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

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

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

  - platform: fluval_ble_led
    fluval_ble_led_id: my_fluval_led_right
    name: "Left Channel Red"
    channel: 1
    zero_if_off: true

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

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

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

switch:
- platform: fluval_ble_led
  fluval_ble_led_id: my_fluval_led_left
  name: "Right LED Switch"

- platform: fluval_ble_led
  fluval_ble_led_id: my_fluval_led_right
  name: "Left LED Switch" 

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "a03RDQtwf7z2AvwxMrTytEzCMXmO4ejL6btxPuDnt3g="

ota:


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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-40Fa1C"
    password: "EaWcQmCoCVnf"

captive_portal:
    
    
INFO Reading configuration /config/esphome-web-40fa1c.yaml...
INFO Starting log output from esphome-web-40fa1c.local using esphome API
INFO Successfully connected to esphome-web-40fa1c.local
[03:33:08][I][app:102]: ESPHome version 2023.3.2 compiled on Apr 13 2023, 03:23:39
[03:33:08][C][wifi:504]: WiFi:
[03:33:08][C][wifi:362]:   Local MAC: B8:D6:1A:40:FA:1C
[03:33:09][C][wifi:363]:   SSID: [redacted]
[03:33:09][C][wifi:364]:   IP Address: 10.121.121.180
[03:33:09][C][wifi:366]:   BSSID: [redacted]
[03:33:09][C][wifi:367]:   Hostname: 'esphome-web-40fa1c'
[03:33:09][C][wifi:369]:   Signal strength: -15 dB ▂▄▆█
[03:33:09][C][wifi:373]:   Channel: 11
[03:33:09][C][wifi:374]:   Subnet: 255.255.255.0
[03:33:09][C][wifi:375]:   Gateway: 10.121.121.10
[03:33:09][C][wifi:376]:   DNS1: 1.1.1.3
[03:33:09][C][wifi:377]:   DNS2: 0.0.0.0
[03:33:09][C][logger:293]: Logger:
[03:33:09][C][logger:294]:   Level: DEBUG
[03:33:09][C][logger:295]:   Log Baud Rate: 115200
[03:33:09][C][logger:296]:   Hardware UART: UART0
[03:33:09][C][homeassistant.time:010]: Home Assistant Time:
[03:33:09][C][homeassistant.time:011]:   Timezone: 'CST6CDT,M3.2.0,M11.1.0'
[03:33:09][C][fluval_ble_led_channel_sensor:042]: Fluval BLE Channel Sensor 'Right Channel Red'
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   State Class: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Unit of Measurement: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Accuracy Decimals: 0
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Icon: 'mdi:lightbulb'
[03:33:09][C][fluval_ble_led_channel_sensor:042]: Fluval BLE Channel Sensor 'Right Channel Green'
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   State Class: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Unit of Measurement: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Accuracy Decimals: 0
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Icon: 'mdi:lightbulb'
[03:33:09][C][fluval_ble_led_channel_sensor:042]: Fluval BLE Channel Sensor 'Right Channel Blue'
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   State Class: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Unit of Measurement: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Accuracy Decimals: 0
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Icon: 'mdi:lightbulb'
[03:33:09][C][fluval_ble_led_channel_sensor:042]: Fluval BLE Channel Sensor 'Right Channel White'
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   State Class: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Unit of Measurement: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Accuracy Decimals: 0
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Icon: 'mdi:lightbulb'
[03:33:09][C][fluval_ble_led_channel_sensor:042]: Fluval BLE Channel Sensor 'Left Channel Red'
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   State Class: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Unit of Measurement: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Accuracy Decimals: 0
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Icon: 'mdi:lightbulb'
[03:33:09][C][fluval_ble_led_channel_sensor:042]: Fluval BLE Channel Sensor 'Left Channel Green'
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   State Class: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Unit of Measurement: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Accuracy Decimals: 0
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Icon: 'mdi:lightbulb'
[03:33:09][C][fluval_ble_led_channel_sensor:042]: Fluval BLE Channel Sensor 'Left Channel Blue'
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   State Class: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Unit of Measurement: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Accuracy Decimals: 0
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Icon: 'mdi:lightbulb'
[03:33:09][C][fluval_ble_led_channel_sensor:042]: Fluval BLE Channel Sensor 'Left Channel White'
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   State Class: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Unit of Measurement: ''
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Accuracy Decimals: 0
[03:33:09][C][fluval_ble_led_channel_sensor:042]:   Icon: 'mdi:lightbulb'
[03:33:09][C][fluval_ble_led_mode_sensor:034]: Fluval BLE Mode Sensor 'Right Mode'
[03:33:09][C][fluval_ble_led_mode_sensor:034]: Fluval BLE Mode Sensor 'Left Mode'
[03:33:09][C][fluval_ble_led_select_mode_button:018]: Fluval BLE LED Select Mode Button 'Right to manual'
[03:33:09][C][fluval_ble_led_select_mode_button:018]: Fluval BLE LED Select Mode Button 'Right to auto'
[03:33:09][C][fluval_ble_led_select_mode_button:018]: Fluval BLE LED Select Mode Button 'Right to pro'
[03:33:09][C][fluval_ble_led_select_mode_button:018]: Fluval BLE LED Select Mode Button 'Left to manual'
[03:33:09][C][fluval_ble_led_select_mode_button:018]: Fluval BLE LED Select Mode Button 'Left to auto'
[03:33:09][C][fluval_ble_led_select_mode_button:018]: Fluval BLE LED Select Mode Button 'Left to pro'
[03:33:09][C][restart.button:017]: Restart Button 'Aquarium Light Restart'
[03:33:09][C][shutdown.button:018]: Shutdown Button 'Aquarium Light Shutdown'
[03:33:09][C][shutdown.button:018]:   Icon: 'mdi:power'
[03:33:09][C][fluval_ble_led_channel_number:066]: Fluval BLE Channel Number 'Right Channel Red'
[03:33:09][C][fluval_ble_led_channel_number:066]: Fluval BLE Channel Number 'Right Channel Green'
[03:33:09][C][fluval_ble_led_channel_number:066]: Fluval BLE Channel Number 'Right Channel Blue'
[03:33:09][C][fluval_ble_led_channel_number:066]: Fluval BLE Channel Number 'Right Channel White'
[03:33:09][C][fluval_ble_led_channel_number:066]: Fluval BLE Channel Number 'Left Channel Red'
[03:33:09][C][fluval_ble_led_channel_number:066]: Fluval BLE Channel Number 'Left Channel Green'
[03:33:09][C][fluval_ble_led_channel_number:066]: Fluval BLE Channel Number 'Left Channel Blue'
[03:33:09][C][fluval_ble_led_channel_number:066]: Fluval BLE Channel Number 'Left Channel White'
[03:33:09][C][fluval_ble_led_switch:076]: Fluval BLE LED Switch 'Right LED Switch'
[03:33:09][C][fluval_ble_led_switch:078]:   Icon: 'mdi:lightbulb'
[03:33:09][C][fluval_ble_led_switch:099]:   Restore Mode: restore defaults to OFF
[03:33:09][C][fluval_ble_led_switch:076]: Fluval BLE LED Switch 'Left LED Switch'
[03:33:09][C][fluval_ble_led_switch:078]:   Icon: 'mdi:lightbulb'
[03:33:09][C][fluval_ble_led_switch:099]:   Restore Mode: restore defaults to OFF
[03:33:10][C][esp32_ble:214]: ESP32 BLE:
[03:33:10][C][esp32_ble_tracker:591]: BLE Tracker:
[03:33:10][C][esp32_ble_tracker:592]:   Scan Duration: 300 s
[03:33:10][C][esp32_ble_tracker:593]:   Scan Interval: 320.0 ms
[03:33:10][C][esp32_ble_tracker:594]:   Scan Window: 30.0 ms
[03:33:10][C][esp32_ble_tracker:595]:   Scan Type: ACTIVE
[03:33:10][C][esp32_ble_tracker:596]:   Continuous Scanning: True
[03:33:10][C][ble_client:027]: BLE Client:
[03:33:10][C][ble_client:028]:   Address: 44:A6:E5:38:CF:85
[03:33:10][C][ble_client:027]: BLE Client:
[03:33:10][C][ble_client:028]:   Address: 44:A6:E5:35:B2:0C
[03:33:10][C][captive_portal:088]: Captive Portal:
[03:33:10][C][mdns:108]: mDNS:
[03:33:10][C][mdns:109]:   Hostname: esphome-web-40fa1c
[03:33:10][C][ota:093]: Over-The-Air Updates:
[03:33:10][C][ota:094]:   Address: esphome-web-40fa1c.local:3232
[03:33:10][C][api:138]: API Server:
[03:33:10][C][api:139]:   Address: esphome-web-40fa1c.local:6053
[03:33:10][C][api:141]:   Using noise encryption: YES
[03:33:10][C][fluval_ble_led:013]: Fluval LED
[03:33:10][C][fluval_ble_led:014]:   Address: 44:A6:E5:35:B2:0C
[03:33:10][C][fluval_ble_led:015]:   Number of channels: 4
[03:33:10][C][fluval_ble_led:013]: Fluval LED
[03:33:10][C][fluval_ble_led:014]:   Address: 44:A6:E5:38:CF:85
[03:33:10][C][fluval_ble_led:015]:   Number of channels: 5
[03:33:17][D][switch:017]: 'Left LED Switch' Turning OFF.
[03:33:17][D][fluval_ble_led:192]: Turning LED off
[03:33:17][D][switch:056]: 'Left LED Switch': Sending state OFF
[03:33:17][D][fluval_ble_led:335]: [44:A6:E5:35:B2:0C] ESP_GATTC_WRITE_CHAR_EVT (Write confirmed)
[03:33:19][D][switch:013]: 'Left LED Switch' Turning ON.
[03:33:19][D][fluval_ble_led:188]: Turning LED on
[03:33:19][D][switch:056]: 'Left LED Switch': Sending state ON
[03:33:19][D][fluval_ble_led:335]: [44:A6:E5:35:B2:0C] ESP_GATTC_WRITE_CHAR_EVT (Write confirmed)
[03:33:22][D][switch:017]: 'Right LED Switch' Turning OFF.
[03:33:22][W][fluval_ble_led:183]: Cannot write to BLE characteristic - not connected
[03:33:22][D][switch:056]: 'Right LED Switch': Sending state OFF
[03:33:23][D][switch:013]: 'Right LED Switch' Turning ON.
[03:33:23][W][fluval_ble_led:183]: Cannot write to BLE characteristic - not connected
[03:33:23][D][switch:056]: 'Right LED Switch': Sending state ON

I have tried everything I could think of. I even made a separate yaml with just the problem light thinking I did something wrong, and I still have the same issue of it not connecting. I verified I can connect with my phone, the mac was correct, and there was no password on the device. I am at a loss.

Does anything jump out at you?

Thanks so much in advance!

Hi @3dgeb

One thing I noticed is, that you configured one light with 4 channels and one with 5. Given that you are using two Aquasky, it should be 4 channels for both lights.

GATT error 133 is a timeout error on connection though, so way before the number of channels should be an issue - but try fixing that anyway and see if it helps. I’ve not completely dug through the BLE libraries yet :wink:

If the error persists, I will try to recreate it - possibly an issue with trying to connect to both lights at once, so I might have to create a queueing (is that a word?) mechanism.

One other possible issue is the captive portal you are using. Both bluetooth and the web server required for the captive portal use a lot of memory, with the ESP32 only having 320kb of data memory, you might encounter out of memory crashes, at least according to the ESPHome documentation.

Best regards
mrzottel