ESPHome is a system to control your ESP8266/ESP32 by simple yet powerful configuration files and control them remotely through Home Automation systems.
ESPHome, happily, also supports 3rd party components.
To add all my components at the current release version to any of your ESPHome-configured devices, use the following syntax in your ESP32 device's .yaml file:
external_components:
- source: github://litui/esphome-components@v1.0.0
To add the main development tree instead, replace v1.0.0
with main
.
Why make a Neewer Light BLE light component in ESPHome?
The only device I've spent any time trying to support is my own Neewer RGB660. So the list, if you insist on one, looks like this:
Other Neewer RGB/Colour Temperature devices will likely work with all or a subset of these BLE commands but I haven't tailored the support. Feel free to fork and try things out.
To add only the NeewerLight support to your ESPHome instance (in case I add more components later), use the following syntax in your ESP32 device's .yaml file.
external_components:
- source: github://litui/esphome-components@v1.0.0
components: [ neewerlight_ble, neewerlight ]
Similar to the Airthings BLE implementation, the neewerlight_ble
component will simply draw your attention to the Neewer-RGB660 devices detected by esp32_ble_tracker
. From there, you'll need to copy/paste or otherwise record the Bluetooth MAC addresses of your devices. After that point, neewerlight_ble
becomes unnecessary.
To control your light in Home Assistant, you'll need to set up the ble_client
with your MAC address and an ID, then set up a light
block with the platform neewerlight
.
It should look as follows:
esp32_ble_tracker:
### Commented out after initial detection:
# neewerlight_ble:
### Added the following blocks with the detected
### mac addresses:
ble_client:
- mac_address: AA:AA:AA:AA:AA:AA
id: nw660_ble_1
- mac_address: BB:BB:BB:BB:BB:BB
id: nw660_ble_2
light:
- platform: neewerlight
name: "NW660 RGB Light 1"
ble_client_id: nw660_ble_1
gamma_correct: 1.0
default_transition_length: 0s
- platform: neewerlight
name: "NW660 RGB Light 2"
ble_client_id: nw660_ble_2
gamma_correct: 1.0
default_transition_length: 0s
Set gamma_correct
as you desire; 1.0 makes the most sense for me. I highly recommend setting default_transition_length
to 0s
to prevent spamming the wonky Neewer BLE implementation with far too many instructions at once. I've had my lamps suddenly stop responding to requests when overwhelmed (they overwhelm easily) and I needed to physically turn them off and on again.
I'm still working on learning the ropes of the ESPHome Python validations. The current set is not very strict.