MAC address into variable

Hi!

I am looking to run multiple esphome boards running the same firmware, and it would be nice if they could differentiate themselves automatically.

The boards all have wifi chips with mac addresses that have the last 6 characters that are unique. Can I get those characters into a variable?

I use CANBUS to send data between them, it would be nice to differentiate data coming from multiple sources automatically.

Else I would have to flash the boards each with a unique Yaml file, and that would be hard…

Read. The. Docs

@nickrout beat me to it.

esphome:
  # Automatically add the mac address to the name
  # so you can use a single firmware for all devices
  name_add_mac_suffix: true  

Yes that is another way.

Thanks!

I knew about this one, but I needed the unique mac characters for the CAN id-s too!

Thanks! :man_bowing:

This should help me a lot! I will try to put this into the CANbus extended id!

I will write if it is successful!

This might help. I make a text_sensor that contains my MAC:

# Get the WiFi details
text_sensor:
  - platform: wifi_info
    mac_address:
      name: ${friendly_name} Mac Address  

You could probably use the sensor state in assembling your CAN message.

But, I know so little about CAN that I don’t know the meaning of the TLA.