Recognising Pis by MAC address and bulk-adding them via CSV
Translated from Türkçe by AI ·
We are setting up home automation for the flats in a friend’s building, one Pi per flat (a mix: a few 3B+, mostly Pi 4, and two Pi 5). They all boot from the same image and connect to the same local network. To find out which IP belongs to which Pi, I am checking the DHCP list on the modem, but the list also includes printers, TVs and phones.My idea: pick out the Pis from the list using the first three bytes of the MAC address (the OUI), build a CSV from them, and use that CSV to add the devices in Hermetry, with the flat number as the name and the MAC next to it. I have been working with electronics for 19 years, but I have never fully known the OUI list for Pis. Which prefixes exist? And does Hermetry’s import store the MAC address?
Bir arkadaşın sitesindeki dairelere ev otomasyonu kuruyoruz, her daireye bir Pi (karışık: birkaç 3B+, çoğu Pi 4, iki tane Pi 5). Hepsi aynı imajla açılıyor ve aynı yerel ağa bağlanıyor. Hangi IP’nin hangi Pi olduğunu bulmak için modemin DHCP listesine bakıyorum ama listede yazıcılar, TV’ler, telefonlar da var.
Düşündüğüm şu: MAC adresinin ilk üç baytından (OUI) Pi’leri ayıklayıp bir CSV yapayım, o CSV’yi de Hermetry’de cihaz eklemek için kullanayım, isim olarak daire numarası, yanına MAC. 19 yıldır elektronikle uğraşıyorum ama Pi’lerin OUI listesini hiç tam bilmedim. Hangi önekler var? Bir de Hermetry’nin içe aktarması MAC’i saklıyor mu?
Translated from Türkçe by AI ·
As far as I know, B8:27:EB and DC:A6:32. Both are Raspberry Pi.
B8:27:EB ve DC:A6:32 bildiğim kadarıyla. İkisi de Raspberry Pi.
Translated from Türkçe by AI ·
Will you use the MAC as the device name or as a separate field? It won’t be very readable as a name.
MAC’i cihaz adı olarak mı kullanacaksın yoksa ayrı bir alan mı? İsim olarak pek okunaklı olmaz.
Translated from Türkçe by AI ·
Be careful, the Wi-Fi and Ethernet MAC of the Pi are different. If the Pi’s connect over Wi-Fi, you will see the wlan0 MAC in the DHCP list.
Dikkat, Wi-Fi ile Ethernet MAC’i farklı. Pi’ler Wi-Fi’dan bağlanıyorsa DHCP listesinde wlan0 MAC’i görürsün.
Translated from Türkçe by AI ·
The name will be the apartment number (like d-12), I want it to stay next to the MAC. They are all connected via Wi-Fi, good thing you mentioned it Derya.
İsim daire numarası olacak (d-12 gibi), MAC yanında dursun istiyorum. Hepsi Wi-Fi’dan bağlı, iyi ki söyledin Derya.
Translated from Türkçe by AI ·
Last term, while compiling an inventory of the Pis in the lab, I had searched for this same list.Prefixes I know: B8:27:EB for older Pis (including Pi 3), DC:A6:32, E4:5F:01, 28:CD:C1, D8:3A:DD and 2C:CF:67 for newer models. A new prefix may have been added, so look up the manufacturer in the IEEE’s public OUI list to check. As Derya said, the Ethernet and Wi-Fi MACs of the same Pi differ, but both usually share the same prefix.A more reliable approach is to have the Pi report its MAC itself: cat /sys/class/net/wlan0/address. If a script prints this somewhere on first boot, you won’t need to guess.On the Hermetry side, the import accepts a mac column and stores it in the device’s extra information. Example:
name,label,profile,mac,attr:daire
d-01,Daire 1,Ev Pi,dc:a6:32:1a:2b:3c,1
d-02,Daire 2,Ev Pi,e4:5f:01:4d:5e:6f,2
Never put a token in the file; it already rejects columns that look like secrets. The import runs a check first and then applies. The access tokens of new devices are provided in a single file, which can be downloaded only once, within 15 minutes after the import. If you miss it, get a new one from the device page with Rotate secret.Bulk importing devices
Geçen dönem laboratuvardaki Pi’lerin envanterini çıkarırken aynı listeyi aramıştım.
Bildiğim önekler: B8:27:EB eski Pi’ler (Pi 3 dahil), DC:A6:32, E4:5F:01, 28:CD:C1, D8:3A:DD ve 2C:CF:67 daha yeni modeller. Yeni önek eklenmiş olabilir, IEEE’nin herkese açık OUI listesinde üreticiyi aratıp kontrol et. Derya’nın dediği gibi aynı Pi’nin Ethernet ve Wi-Fi MAC’i farklı, ama ikisi de genelde aynı önekten.
Daha sağlamı Pi’nin MAC’i kendisinin söylemesi: cat /sys/class/net/wlan0/address. İlk açılışta bir betikle bunu bir yere yazdırırsan tahmine gerek kalmaz.
Hermetry tarafında içe aktarma mac sütununu kabul ediyor, cihazın ek bilgilerinde tutuluyor. Örnek:
name,label,profile,mac,attr:daire
d-01,Daire 1,Ev Pi,dc:a6:32:1a:2b:3c,1
d-02,Daire 2,Ev Pi,e4:5f:01:4d:5e:6f,2
Dosyaya asla token koyma, gizli bilgi gibi görünen sütunları zaten reddediyor. İçe aktarma önce bir kontrol yapıyor, sonra uyguluyor. Yeni cihazların erişim token’larını tek bir dosyada veriyor, o dosya içe aktarmadan sonra 15 dakika içinde ve bir kez indirilebiliyor. Kaçırırsan cihaz sayfasından Rotate secret ile yenisini alıyorsun.
Translated from Türkçe by AI ·
I collected each Pi’s wlan0 MAC and apartment number with the first-boot script, uploaded the CSV, and the check step said 25 rows are ready. I downloaded the token file right away; I had just copied the wrong token to one Pi, and I fixed it with Rotate secret. The MAC of two Pi 5s starts with 2C:CF:67, I noted the list too.
İlk açılış betiği ile her Pi’nin wlan0 MAC’ini ve daire numarasını topladım, CSV’yi yükledim, kontrol adımında 25 satır hazır dedi. Token dosyasını hemen indirdim, bir Pi’ye yanlış token kopyalamışım sadece, onu da Rotate secret ile düzelttim. İki Pi 5’in MAC’i 2C:CF:67 ile başlıyormuş, listeyi ben de not aldım.
- You must be logged in to reply to this topic.
Join the conversation
Sign in to ask and answer, like helpful posts and mark the reply that solved your problem. Every contribution earns points and levels.

