ESPHome and Sonoff D1 platform unknown light sonoff_d1

Hi i’m trying to program my sonoff d1 with esphome. Al goes wel if i don’t add the light part from the example at the esphome page.

# And finally the light component
# gamma correction equal to zero gives linear scale,
# exactly what's needed for this device
light:
  - platform: sonoff_d1
    use_rm433_remote: False
    name: sonoff-dimmer-1
    restore_mode: RESTORE_DEFAULT_OFF
    gamma_correct: 0.0
    default_transition_length: 1s  

When i add this part i get the error platform unknown. light.sonoff_d1

Does someone have some directions of how to fix this. I’ve flashed from my homeassistant gui from my pc where i connected the D1 to flash. This flashing is gone well without the light part. Then i can see the status of the D1 in the gui of home assistant esphome part en view the logs from the esphome flashed D1.

problem fixen. It was that the esphome integration was marked deprecated and a new version. Added the new version and all build as expected

would be nice to have a link to the new version.

Hi

First uninstall the old version of the esphome integration.
Next goto settings->addons->add-on store
then add a new repository via the three dots on the right upper corner.
and add the following

then you have the following items in the addon store (select the version you need. Normally the first version)