I am trying to use 6-8 Sonoff Basic R2 switches throughout my house to control lights and appliances. I flashed ALL with SAME firmware using esphome. They all connect to WiFi and are assigned ip addresses.
I can integrate and control the first switch without any problem. When adding the second switch, HA complains:
“Platform esphome does not generate unique IDs. ID sonoff_basic_switchbinary_sensorsonoff_basic_button already exists - ignoring binary_sensor.lab_lights_button”, etc.
To clarify: lab_lights was the ID I used when renaming the first device and its associated entities.
Questions:
Is there a way to use the devices as currently flashed (same firmware and ids)?
If different IDs are required, how do I generate separate firmware for each device while reusing the common libraries and tools?
Is it possible to flash them OTA (including different IDs – see 2.) using esphome at this point?
Initially, I tried to generate separate firmware using substitutions and !include. I stopped doing it at the second device because the esphome tool kept downloading the same libraries. I could not figure out how to reuse the platformio.ini so I thought I could get away with just flashing the same fw.
As you can probably tell, I’m a newbie HA and ESPhome user. Any suggestions/ideas are appreciated.
I think 2 will be addressed by 1. I think you will need to create a node in esphome for each of your switches e.g. node 1 = switch1, node 2 = switch2, etc. It looks to me like your current approach will result in all of your devices attempting to be the same single node/entity e.g. node 1 = switch 1, node 1 = switch 2.
I just generated a couple of different firmwares on a dev machine. I’m not a big fan of mixing production with dev so I do not use ESPHome in HA. If I can’t flash them OTA I’ll try using your method.