Is there a way to get the value/state of an output/PWM light.
I have manual buttons on my esp with automation (inside esphome) that turns on the light in 3 steps (20%, 50%, off).
I need to get the value (inside of esphome) of the light because if i turn on the light in home assistant the first push of the button should turn the light off if its already on.
Hi there…Did you add the light to the esphome integration in HA? If you had done it, you should be able to see the brightness of the light as a state attribute of the light.podlaha_led in HA.
The automation is not in the home assistant. The automation is in the esp. I want to change the led_val if i turn the light on in home assistant. Because now my automation doesn’t now that home assistant turned on the light and always starts from zero.
For example if i turn the light on in HomeAssistant. And then i push the button on the esp the light should turn off. Only if the light is turned off the esp automation should run.
I want the automation to work in esp without homeAssistent. Now it works without the homeAssistant but i am able to use it also inside homeAssistant. But i doesn’t have feedback from the homeAssistant if i turn on the light there. And therefore my automation starts from zero (20, 50, off)
On every components page in the ESPHome documentation is a link “API Reference” at the bottom. You will get to the documentation of the C++ API. But there is mostly no description. You have to guess or to look into the source code. The code is linked inside the API reference.
Yes that is by design. So that a light will have the same brightness when you switch if off and then on again.
You can combine it with the value from: id(podlaha_light).current_values.is_on()