thank you very much, but now i need a write_action.
it is to difficult for me now, i am new with programming
esphome does not compile;)
INFO ESPHome 2025.12.0-dev
INFO Reading configuration /config/esphome/zentraleinheit01.yaml...
INFO Detected timezone 'Europe/Vienna'
Failed config
output.template: [source /config/esphome/zentraleinheit01.yaml:434]
'write_action' is a required option for [output.template].
platform: template
id: remote_relay01
type: binary
yes thanks, i have read, but i have no idea for the explicit write_action
- platform: template
id: remote_relay01
type: binary
write_action:
- output.set_level:
id: remote_light01
level: !lambda return state; # i dont now if this is correct?
this is the compile log now
INFO ESPHome 2025.12.0-dev
INFO Reading configuration /config/esphome/zentraleinheit01.yaml...
INFO Detected timezone 'Europe/Vienna'
Failed config
output.template: [source /config/esphome/zentraleinheit01.yaml:434]
platform: template
id: remote_relay01
write_action:
then:
- output.set_level:
ID 'remote_light01' of type light::LightState doesn't inherit from output::FloatOutput. Please double check your ID is pointing to the correct value.
id: remote_light01
level: !lambda |-
return state;
type: binary
I got completely lost now about what are you trying to do.
Light component controls output, but now here you are trying to control light from that output.
Since your homeassistant action is coded on light component, you should leave the output write_action empty.
you are the best
it has finish compiled but the light does not switch on or off in real
[19:04:14.907][C][homeassistant.sensor:031]: Entity ID: 'sensor.tempkaminwohnen_temperature'
[19:04:18.295][W][component:481]: lvgl took a long time for an operation (234 ms)
[19:04:18.296][W][component:484]: Components should block for at most 30 ms
[19:04:20.826][D][light:090]: 'remote_Light01' Setting:
[19:04:20.826][D][light:103]: State: ON
[19:04:25.666][D][light:090]: 'remote_Light01' Setting:
[19:04:25.666][D][light:103]: State: OFF
[19:04:34.551][I][safe_mode:042]: Boot seems successful; resetting boot loop counter
[19:04:34.556][D][esp32.preferences:149]: Writing 1 items: 0 cached, 1 written, 0 failed
[19:04:37.848][D][sensor:135]: 'Battery Percentage': Sending state 92.48881 % with 1 decimals of accuracy
[19:04:38.454][D][sensor:135]: 'Battery Voltage': Sending state 8.06250 V with 2 decimals of accuracy
[19:04:38.455][D][sensor:135]: 'Battery Current': Sending state 0.17294 A with 3 decimals of accuracy
i dont know, if this is right? i can only turn on and off from homeassistant self
[20:15:21.857][D][homeassistant.binary_sensor:026]: 'light.tischzentrale01': Got state ON
[20:15:21.858][D][binary_sensor:039]: 'tischzentrale01': New state is ON
[20:15:23.908][D][homeassistant.binary_sensor:026]: 'light.tischzentrale01': Got state OFF
[20:15:23.908][D][binary_sensor:039]: 'tischzentrale01': New state is OFF
[20:15:31.051][D][main:393]: LVGL resuming
[20:15:31.051][D][light:090]: 'Display Backlight' Setting:
[20:15:31.051][D][light:103]: State: ON
[20:15:31.051][D][light:141]: Transition length: 0.2s
[20:15:32.321][D][light:090]: 'remote_Light01' Setting:
[20:15:32.323][D][light:103]: State: ON
[20:15:33.220][D][light:090]: 'remote_Light01' Setting:
[20:15:33.220][D][light:103]: State: OFF
possibly is also an error in my binary_sensor: sektion?
If all you want to do is toggle the HA light when the button is pressed, just put that action (service: light.toggle) directly in the on_click trigger. It’s not clear to me why you have the light component in ESPHome if your device is not directly controlling a light.
@clydebarrow i does not understand for details, what you mean, sorry i am not a programmer,
but i have this problem since days and cannot solve this
thanks for any help.
That looks basically correct. What part isn’t working?
Monitor the ESPHome logs while you turn the light on and off via HA, you should see lines (at debug level) like this:
[21:15:28][D][homeassistant.binary_sensor:026]: 'light.patio_light_light1': Got state OFF
And the checked state of your LVGL button should change. If that works, but clicking the button doesn’t toggle the light, then it’s likely you haven’t granted your ESPHome device permission to perform HA actions.