Hello, I have installed ESPHome on a Nedis esp8266 IR transmitter and works well. I use the template switch to turn some lights on/off. That works well, but I would rather ESPhome publish this as a light to Home Assistant - but I cannot seem to wrap my head around how to set up that code.
The button is fine as-is. That is a light-effect that could be added to the light (blinking/flickering - candelight effect).
Anyone could help me rewrite this ESPHome code?
switch:
- platform: template
name: "Juletrelys"
optimistic: true
assumed_state: true
restore_mode: RESTORE_DEFAULT_OFF
turn_on_action:
- remote_transmitter.transmit_raw:
code: [2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,2000,-5600,
2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,2000,-5600,
2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,2000,-5600]
carrier_frequency: 38kHz
repeat:
times: 5
wait_time: 16ms
turn_off_action:
- remote_transmitter.transmit_raw:
code: [2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000, -400,1000, -400,1000, -400,2000,-5600,
2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000, -400,1000, -400,1000, -400,2000,-5600,
2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000, -400,1000, -400,1000, -400,2000,-5600]
carrier_frequency: 38kHz
repeat:
times: 5
wait_time: 16ms
button:
- platform: template
name: "Juletrelys Blinking"
on_press:
- remote_transmitter.transmit_raw:
code: [2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000, -400,1000,-1000, 400, -400,2000,-5600,
2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000, -400,1000,-1000, 400, -400,2000,-5600,
2000,-1000, 400,-1000, 400, -400,1000,-1000, 400,-1000, 400, -400,1000, -400,1000,-1000, 400, -400,2000,-5600]
carrier_frequency: 38kHz
repeat:
times: 5
wait_time: 16ms
I have played a little but it seems I am not on the right path. Do I have to create a template based output and reference that from light? Sorry to be a little confused here.