jesserockz / wizmote-esphome

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Do you know how to get the MAC address for the wizmote?

jesserockz opened this issue Β· comments

Do you know how to get the MAC address for the wizmote?

Originally posted by @leovilela2 in #2 (comment)

@leovilela2 If you have the component set up, then it will be included in the event payload to Home Assistant.

...
mac: !lambda 'return format_hex(data.bssid, 6);'

Pardon my ignorance but does one need a ESP32 board dedicated to capture the wizmote packets or can Home Assistant's ESPHome do that?

Pardon my ignorance but does one need a ESP32 board dedicated to capture the wizmote packets or can Home Assistant's ESPHome do that?

did you manage to find out? I can't wrap my head around how to make this work

Just asking:
how to set up the component the correct way?
Is there a guide for beginners like me somewhere?`
I installed the blueprint to my HA Installation > I created a blank ESPHome configuration with my nodeMCU32 and have no button Presses seen here.

#edit: and which format does the mac adress need? AA:BB:CC:DD:EE:FF; aabbccddeeff or aa-bb-cc-dd-ee-ff

Found it:
We need to install the snippet in the README.md inside of our ESPHome configuration.
I created a PullRequest to get this clarified:
#10

After I installed the new ESP Configuration i could see in the log output of my ESP the MAC from the Wizmote.

It comes as A1.B2.C3.D4.E5.F6 but i converted it to A1B2C3D4E5E6 and added it inside the Blueprint Config
Now I can Control the devices.

@PlanetSmasher

Could You explain how to do it well step by step - for total beginner with esp? Perhaps you could share your remote file "wizmote.yaml" and other things you did.

Will sure do.
Maybe this weekend, when i got more time to spare

I'm still waiting patiently :)

Hi,
sorry it took me longer to get a free timeslot.

I try my best to get you started.

This is the way I was doing it. You can adapt it to your style.

I used Home Assistant with the following Addons installed:
- ESPHome

You can edit the Configuration file later with the Buildin Editor of ESPHome or via VSCode or SSH.

Installation of the blueprint

Open your Home Assistant instance and show the blueprint import dialog with a specific blueprint pre-filled.

Installation on ESP32 boards (e.g. NodeMCU-ESP32, Wemos D1 mini, and so on...)

In the ESPHome WebUI (Settings -> Add-ons -> ESPHome -> Start WebUI) I started with the Secrets File in the upper right corner.
There I Defined my IoT WiFi for all ESP Devices:

# Your Wi-Fi SSID and password
wifi_ssid: "ExampleWiFi"
wifi_password: "Use-only-secure-Passwords!"

Next, I pressed "New Device" gave it a Name, selected the Processor, Copied the encryption key and opened the new created config file.

On the WiFi Part I use:

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

After all prefilled configuration parts goes the config from here: ESPHome configuration snippet

Then it is time to plug the esp to the Computer and Install the configuration.
Keep in mind that this will not work with Firefox as only Chrome supports Web Serial. :-( 😒

Getting the MAC from the Wizmote

After the successful installation of the ESP device you can go into the logs and then after the first Part of the device config you can press one button on your Wizmote.

Example output:

INFO ESPHome 2023.12.3
INFO Reading configuration /config/esphome/testconfiguration.yaml...
INFO Starting log output from 123.456.789.203 using esphome API
INFO Successfully connected to wiz-test2 @ 123.456.789.203 in 0.024s
INFO Successful handshake with wiz-test2 @ 123.456.789.203 in 0.101s
[13:50:38][I][app:102]: ESPHome version 2023.10.3 compiled on Oct 26 2023, 12:15:19
[13:50:38][C][wifi:546]: WiFi:
[13:50:38][C][wifi:382]:   Local MAC: 12:34:56:78:9A:BC
[13:50:38][C][wifi:383]:   SSID: 'ExampleWiFi'[redacted]
[13:50:38][C][wifi:384]:   IP Address: 123.456.789.203
[13:50:38][C][wifi:386]:   BSSID: 11:22:33:44:55:66[redacted]
[13:50:38][C][wifi:387]:   Hostname: 'testconfiguration'
[13:50:38][C][wifi:389]:   Signal strength: -73 dB β–‚β–„β–†β–ˆ
[13:50:38][C][wifi:393]:   Channel: 1
[13:50:38][C][wifi:394]:   Subnet: 255.255.248.0
[13:50:38][C][wifi:395]:   Gateway: 123.456.789.1
[13:50:38][C][wifi:396]:   DNS1: 123.456.789.1
[13:50:38][C][wifi:397]:   DNS2: 0.0.0.0
[13:50:38][C][logger:416]: Logger:
[13:50:38][C][logger:417]:   Level: DEBUG
[13:50:38][C][logger:418]:   Log Baud Rate: 115200
[13:50:38][C][logger:420]:   Hardware UART: UART0
[13:50:38][C][copy.sensor:015]: Copy Sensor 'WiFi Signal Percent'
[13:50:38][C][copy.sensor:015]:   Device Class: 'signal_strength'
[13:50:38][C][copy.sensor:015]:   State Class: 'measurement'
[13:50:38][C][copy.sensor:015]:   Unit of Measurement: 'Signal %'
[13:50:38][C][copy.sensor:015]:   Accuracy Decimals: 0
[13:50:38][C][captive_portal:088]: Captive Portal:
[13:50:38][C][mdns:115]: mDNS:
[13:50:38][C][mdns:116]:   Hostname: testconfiguration
[13:50:38][C][ota:097]: Over-The-Air Updates:
[13:50:38][C][ota:098]:   Address: testconfiguration.local:3232
[13:50:38][C][ota:101]:   Using Password.
[13:50:38][C][api:138]: API Server:
[13:50:38][C][api:139]:   Address: testconfiguration.local:6053
[13:50:38][C][api:141]:   Using noise encryption: YES
[13:50:38][C][wifi_signal.sensor:009]: WiFi Signal 'WiFi Signal dB'
[13:50:38][C][wifi_signal.sensor:009]:   Device Class: 'signal_strength'
[13:50:38][C][wifi_signal.sensor:009]:   State Class: 'measurement'
[13:50:38][C][wifi_signal.sensor:009]:   Unit of Measurement: 'dBm'
[13:50:38][C][wifi_signal.sensor:009]:   Accuracy Decimals: 0
[13:50:38][C][esp_now:085]: esp_now:
[13:50:40][D][esp_now:072]: mac: 6C.29.90.AA.BB.CC (6), data: 81.FE.07.00.00.20.10.01.07.3E.F2.49.A1 (13)
[13:50:40][D][esp_now:072]: mac: 6C.29.90.AA.BB.CC (6), data: 81.FE.07.00.00.20.10.01.07.3E.F2.49.A1 (13)
[13:50:40][D][esp_now:072]: mac: 6C.29.90.AA.BB.CC (6), data: 81.FE.07.00.00.20.10.01.07.3E.F2.49.A1 (13)
[13:50:43][D][sensor:094]: 'WiFi Signal dB': Sending state -74.00000 dBm with 0 decimals of accuracy
[13:50:43][D][sensor:094]: 'WiFi Signal Percent': Sending state 52.00000 Signal % with 0 decimals of accuracy

And now we can start creating our automation using the Blueprint from the beginning.

Hi,

Thank you PlanetSmasher for the detailed instructions! Everything is clear except the part about connecting the ESP to the computer. Do you mean opening the remote control and connecting to the motherboard - GND, VCC, TX, RX, DO0 with a programmer (e.g. USB - UART to ESP8266 converter)?

Hi,
I've figured it out. We need an additional ESP device that will act as a gateway for wizmote. Thank you PlanetSmasher for your tips.