Brilliant Lighting and LocalTuya / ESPHome

Hi, I have some Brilliant Lighting smart devices I am trying to integrate with HA. They are Tuya based devices. I have a light and a motion sensor.

https://brilliantlighting.com.au/product/smart-wifi-pir-motion-sensor-96ac94

and

https://brilliantlighting.com.au/product/smart-wifi-led-cct-biorhythm-globe-0e5574

When attempting to add these devices in LocalTuya, I am receiving the following error (with the local key filled out obviously).

These devices work fine when connected via Tuya app.

Ideally, in a perfect world I would like to flash these devices with ESPHome. I did notice when connected to my wifi I checked the DHCP server and the hostname appears as ESP-xxxxxx indicating to me they are running a ESP chip.

Is it possible to reverse engineer these, and flash them with ESPHome? I opened one device (the motion sensor) and noticed multiple pads that are available to solder to.

If they are not going to play well with Local Tuya, and just because I prefer ESPHome, it would be ideal if I could run ESPHome on them, the light bulb seems to be a little hard to get access to.

My setup is

HA connected to LAN >> internet access
All IoT devices connected to IoT WiFI VLANxx >> no internet access

No devices are connected to the internet other then HA itself.

Any ideas? If you have any questions just ask and I can give you some more info.

Much appreciated.





y

Your IP address seems to indicate a docker ip … just doublechecking as this should be the IP of the tuya device on your lan…
Note that it is also important that this does not change which I resolved by DHCP entry via MAC-address in my router

This motion sensor looks like being battery operated? In that case the esp is only powered when the primary (ultra low power) chip senses motion to send the changed binary sensor state over wifi. These devices are not officially supported by esphome but someone brewed something custom for that devices 3 years ago :point_down:

Indeed, like most of the β€œsmart” light bulbs. Best just buy them already freed with esphome, wled, tasmota, … flashed so you are not β€œforced” to break them to be able to own them :man_shrugging:

Looks like athom sells your (GU10?) type of :bulb:

Great, thank you! Some good info to go one here!

Since the gu10 is tuya and presumably using beken chips. You can still flash with libretuya, an esphome fork for non esp devices.

It’s also possible to flash it via ota method with tuya cloudcutter

1 Like

Is anyone familiar with the esphome command line?

Im trying to flash a PIR but a little stuck at where to put the YAML files?
Do I upload them to HA, or any specific directory? For example the .substitutions.yaml file? Where does it go?

Thanks

This is the error received when compiling.

[33mWARNING Calling ESPHome with the configuration before the command is deprecated and will be removed in the future. ←[0m
←[33mWARNING Please instead use:←[0m
←[33mWARNING    esphome compile pir.yaml←[0m
←[32mINFO Reading configuration pir.yaml...←[0m
←[33mWARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.←[0m
←[33mWARNING The selected Arduino framework version is not the recommended one. If there are connectivity or build issues please remove the manual version.←[0m
←[32mINFO Generating C++ source...←[0m
←[32mINFO Compiling app...←[0m
Processing pir (board: esp01_1m; framework: arduino; platform: platformio/espressif8266 @ 2.6.3)
------------------------------------------------------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/espressif8266/esp01_1m.html
PLATFORM: Espressif 8266 (2.6.3) > Espressif Generic ESP8266 ESP-01 1M
HARDWARE: ESP8266 80MHz, 80KB RAM, 1MB Flash
PACKAGES:
 - framework-arduinoespressif8266 @ 2.20501.190515 (2.5.1)
 - tool-esptool @ 1.413.0 (4.13)
 - toolchain-xtensa @ 2.40802.200502 (4.8.2)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ off, Compatibility ~ soft
Found 31 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- AsyncMqttClient-esphome @ 0.8.6
|   |-- ESPAsyncTCP-esphome @ 1.2.3
|-- ArduinoJson @ 6.18.5
Building in release mode
Compiling .pioenvs\pir\src\esphome\components\adc\adc_sensor.cpp.o
Compiling .pioenvs\pir\src\esphome\components\binary_sensor\automation.cpp.o
Compiling .pioenvs\pir\src\esphome\components\binary_sensor\binary_sensor.cpp.o
Compiling .pioenvs\pir\src\esphome\components\binary_sensor\filter.cpp.o
Compiling .pioenvs\pir\src\esphome\components\esp8266\core.cpp.o
Compiling .pioenvs\pir\src\esphome\components\esp8266\gpio.cpp.o
Compiling .pioenvs\pir\src\esphome\components\esp8266\preferences.cpp.o
Compiling .pioenvs\pir\src\esphome\components\json\json_util.cpp.o
src\esphome\components\esp8266\gpio.cpp:11:22: error: expected initializer before 'flags_to_mode'
 static int IRAM_ATTR flags_to_mode(gpio::Flags flags, uint8_t pin) {
                      ^
src\esphome\components\esp8266\gpio.cpp:107:1: error: expected '}' at end of input
 }  // namespace esphome
 ^
src\esphome\components\esp8266\gpio.cpp:107:1: error: expected '}' at end of input
cc1plus.exe: warning: unrecognized command line option "-Wno-nonnull-compare" [enabled by default]
src\esphome\components\esp8266\core.cpp:13:20: error: expected initializer before 'yield'
 void IRAM_ATTR HOT yield() { ::yield(); }
                    ^
src\esphome\components\esp8266\core.cpp:14:24: error: expected initializer before 'millis'
 uint32_t IRAM_ATTR HOT millis() { return ::millis(); }
                        ^
src\esphome\components\esp8266\core.cpp:15:20: error: expected initializer before 'delay'
 void IRAM_ATTR HOT delay(uint32_t ms) { ::delay(ms); }
                    ^
src\esphome\components\esp8266\core.cpp:16:24: error: expected initializer before 'micros'
 uint32_t IRAM_ATTR HOT micros() { return ::micros(); }
                        ^
src\esphome\components\esp8266\core.cpp:17:20: error: expected initializer before 'delayMicroseconds'
 void IRAM_ATTR HOT delayMicroseconds(uint32_t us) { delay_microseconds_safe(us); }
                    ^
src\esphome\components\esp8266\core.cpp:26:20: error: expected initializer before 'arch_feed_wdt'
 void IRAM_ATTR HOT arch_feed_wdt() {
                    ^
src\esphome\components\esp8266\core.cpp:33:24: error: expected initializer before 'arch_get_cpu_cycle_count'
 uint32_t IRAM_ATTR HOT arch_get_cpu_cycle_count() {
                        ^
cc1plus.exe: warning: unrecognized command line option "-Wno-nonnull-compare" [enabled by default]
*** [.pioenvs\pir\src\esphome\components\esp8266\gpio.cpp.o] Error 1
*** [.pioenvs\pir\src\esphome\components\esp8266\core.cpp.o] Error 1
============================================== [FAILED] Took 3.86 seconds ==============================================