Hi there.
I have build some lights with ESP-Home and PWM.
Up till now i have defined the default_transition_length as a fixed value in my source.
It’s all running properly.
Now, i would like to change these fading-time every time i change the PWM value.
For example:
In the night the fading should be 7seconds.
On the day time, when i opened the front door, the lights should be on within 1 second.
So i have create a global variable like:
globals:
- id: fade_time
type: std::string
restore_value: no
initial_value: "0.5s"
On the “light” section i have used (for example) these:
- platform: monochromatic
output: pwm_output8
name: "Licht Nebenraum"
default_transition_length: 'return id(fade_time);'
None of the syntax i’ve used accepts the compiler
Here i get a return like that:
Expected time period with unit, got return id(fade_time);.
default_transition_length: return id(fade_time);
I have tested a number of syntax options, but none of these are accepted.
So i hope, that anybody of you can help me here…
Greetings!