The errors that you see are probably related to compiling the code using the current v1.20.x release of ESPHome or using an older dev version which doesn’t contain the latest changes.
There’s one error in there about a missing semi-colon. That error was fixed a minute ago, That you see this error, also indicates that the ESPHome code used wasn’t a recent dev or beta.
The custom_light_transformer branch does not compile with the current release, but it does compile for me with ESPHome dev and beta. Others have reported the same.
On beta everything is ok.
For some reason, it gives an error on esphome dev version.
I deleted and re-installed dev version, but it did not help.
What could be wrong?
What is your refresh interval of the external component? So are you sure you are using the latest version of the external component. I also use the dev version from the add-on store and it compiles without errors.
Maybe you can post the external component part of the yams file you are using.
Try to add the refresh configuration variable to the external component section to ensure you are using the latest version of the component, for instance
Just to share a short update - mine is now back working totally fine, including the color and brighness taps
So I can continue to use my automation to dim the light to 1 % - thanks so much @mmakaay!
I’ve just used your latest example yaml and changed my settings from scratch. No idea what was wrong with my other version, but the lamp felt into reboot loop (every 0.5 seconds) after flashing (both, OTA and serial). Anyhow - I’m happy tho have it working now!
EDIT: I’ve used ESPHome v1.22.0 and the custom_light_transformer branch
EDIT2: @mmakaay: There is a duplicate key in your example.yaml file, api section is double in line 33 and 42.
Thanks for the uodate @badbroechten
Good to hear your lamp is working again.
I will take care of that API section issue!
@alexamig What does the dev version report as its version in the bottom right of the GUI?
And Jos’ suggestion is a good one. Without a refresh time, you won’t have the latest code from my development branch. So add that and retry the compile. I am will update my earlier info with this.
Also: please use a code block when posting a config. This config dump is very hard to read
@ mmakaay, jsuanet
Apologies, was away.
refresh: 60s did not help, it gives the same error.
The esphome version at the bottom right gives out v1.21.0-dev
At startup, it swears at this in the log, I attach pictures.
ESPHome 2021.8.0 is released. So you can try it with the new version. Choose “Clean Build Files” from the 'Hamburger menu" in your lamp entry to be sure all old ‘rubbish’ is removed.
And the current development version is v1.22-0-dev, time for an update
Hello. I have already installed ESPHome 2021.8.0 and have safely updated the firmware of the respected [mmakaay] Everything compiled well and worked. : smile:
But I wanted to figure out with the dev version, why it doesn’t work. ((
Recently, Home Assistant introduced explicit color modes (RGB, Color Temperature, etc.). ESPHome had to follow by adding color modes to its API as well. This did cause some head aches along the way. For users of the Bedside Lamp 2 most noticably the disappearing RGB and Color Temperature tabs in the GUI control panel of Home Assistant. For me as developer, various compatibility issues between my code and the progressing ESPHome code.
But the suffering should now be over With the release of ESPHome 2021.8.0, the code base has been stabilized and I can release new code that is fully compatible with ESPHome and Home Assistant again.
The changes for this release
Preset identifiers (group and preset) for the preset.activate action are now validated at compile time.
Compatibliity with Home Assistant 2021.8.0. and ESPHome 2021.8.0.
Now ESPHome has switched to Home Assistant’s versioning scheme,. this project will follow the versioning scheme as well.
The example.yaml has been updated to not use underscores in the hostname anymore. Since recently, using an underscore in the name yields a warning during the firmware compilation, because hostnames can only contain letters, numbers and dashes “-”.
For those who are on ref: custom_light_transformer
You can now switch to either ref: 2021.8.0 or ref: main to make use of the new code.
The custom_light_transformer branch will be deleted in a while, since its code has been fully merged.
Nice, this is working perfect i’m greatfull for the work that you are doing. @mmakaay The only this that is not working is transition.
i had made a wake-up light script for my bedside light. so i wil transition slowly start from 0% to 100% with a transition off 5 seconds per procent. But now, when i use this the light just goes on at full brightness.
I was able tot reproduce this. I will work on a solution and keep you posted.
A possible work-around for now: in your script, first turn the lamp on at 1% brightness (or 2% if you want to skip the night light step at 1%). Then call the transitioning code.
Along with the new custom light transformer code (to make the firmware compatible with the latest and greatest Home Assistant and ESPHome) came some issues in transition handling. This release fixes the following issues:
Fixed transitioning from the off to on state. Thanks to @marcel1988 for informing me about his non-functional wake-up light script. Before this fix, the light would stay off during the full transformation, only to turn on at the very end.
The on_brightness trigger is now also called at the start of a transition. This fixes a problem with the brightness slider illumination not following along when you slide your finger over it.
Suppressing a transition time for transitioning to a night light color is now only instant when starting from a night light setting. Before this change, moving from for example 80% brightness to 1% brightness (i.e. night light), would be instant. Now an actual transformation is done.
You’re one of the persons that keep making Home assistant better(and ESPHome from what I see in the changelog). I wonder if the engineers from Xiaomi/Yeelight is following your work I hope they do
Haha, in fact, I was wondering about that myself yesterday I visited the Yeelight forum thread, but nothing seems to have changed there. Just and endless list of people posting their Mi ID. So sad.