Knowing which device is which?

I have a working HomeAssistant system up and running and this questions sources from my looking through stuff today. Let’s say that I want to set up a new system and this new system will have two identical SOnOff devices, which have been programmed with the KmanSonoff software, and the devices are to be installed in Locaiton1 and Location2. I create a configuration.yaml file and list in the file Device1 and Device2. I install the devices, power on the computer that runs Home Assistant, and it finds the devices. However, how do I know which device is in Locaiton1 and which is in Locaiton2? Yes, I could power cycle the devices, one at a time, to see which is or still active, but I see nothing in configuration.yaml nor config_sc.h to name the device and I see nothing within HomeAssistant that can show me the name of the device. Am I missing something?

The idea is that you name them so you know which is which…

What are these ‘devices’? If it’s a switch you can toggle it, if it’s a motion sensor you can move in front of it… etc.

I’ve never heard of that before. It looks like you can tell which is which from the unique MQTT_TOPIC you set up for each device:

#define MQTT_SERVER     "192.168.0.100"                      // mqtt server
#define MQTT_PORT       1883                                 // mqtt port
#define MQTT_TOPIC      "home/sonoff/living_room/1"          // mqtt topic (Must be unique for each Sonoff)
#define MQTT_USER       "user"                               // mqtt user
#define MQTT_PASS       "pass"                               // mqtt password
#define WIFI_SSID       "homewifi"                           // wifi ssid
#define WIFI_PASS       "homepass"                           // wifi password

https://github.com/KmanOz/KmanSonoff#configuration

Yes, MQTT_TOPIC can be set, but from the HomeAssistant UI, where is it visible?

If you use the autogenerated UI, they will be added automatically. If you have ‘taken control’, you have to add them to a dashboard yourself.

The sensors have to be added manually, https://github.com/KmanOz/KmanSonoff#homeassistant-integration

When you do this you know which is which by the mqtt topic you use.

Honestly you would be better off flashing firmware that supports discovery. Like ESPHome or Tasmota.

Thanks for showing me ESPHome and Tasmota. I am going to look into ESPHome more deeply, because at the outset, it appears to readily support SOnOff devices.

They both do.

Tasmota is easier, but ESPHome is more powerful.

If all you want is to get your Sonoff device in home assistant then Tasmota has a shallower learning curve. Though Sonoff running ESPhome isn’t that difficult. It is well documented.