tesla-local-control / tesla-local-control-addon

Control your Tesla locally from HomeAssistant
Apache License 2.0
20 stars 2 forks source link

Regex error when adjusting configuration after installing 0.1.1 #92

Closed vdiogo closed 1 month ago

vdiogo commented 1 month ago

After installing version 0.1.1 of the add-on, I'm not able to save the configuration: I tried updating the configuration both from UI and from YAML, but same outcome.

I get the following REGEX error: Ocorreu um erro ao guardar a configuração do add-on, does not match regular expression ^([0-9A-Fa-f]{2}(:[0-9A-Fa-f]{2}){5})(\|[0-9A-Fa-f]{2}(:[0-9A-Fa-f]{2}){5})*$. Got {'vin_list': 'XP7YGCEK5PB153946', 'ble_mac_list': 'SDA39A3EE5E6B4B0DC', 'mqtt_server': '192.168.86.249', 'mqtt_port': '1883', 'mqtt_username': 'mqtt', 'mqtt_password': 'MYSECRETPASSWORD', 'presence_detection_ttl': 240, 'presence_detection_loop_delay': 120, 'ble_cmd_retry_delay': 5}

raphmur commented 1 month ago

Hi, This is due to the config you have provided for the MAC Address. It should be in the format AA:BB:CC:DD:EE:FF.

You supplied "SDA39A3EE5E6B4B0DC" which does not look like a MAC address... The MAC is 12 characters (numbers or capital letters from A to F), separated by ":"

What did you use to get "SDA39A3EE5E6B4B0DC" ?

raphmur commented 1 month ago

This is planned to be fixed in the next release (0.1.2 soon)

vdiogo commented 1 month ago

Hi, This is due to the config you have provided for the MAC Address. It should be in the format AA:BB:CC:DD:EE:FF.

You supplied "SDA39A3EE5E6B4B0DC" which does not look like a MAC address... The MAC is 12 characters (numbers or capital letters from A to F), separated by ":"

What did you use to get "SDA39A3EE5E6B4B0DC" ?

Thanks for prompt reply I got it from here: https://github.com/tesla-local-control/tesla_ble_mqtt_docker/issues/23 I have tried with:

raphmur commented 1 month ago

I understand your issue then You have used what is called the "BLE Local Name" which for a Tesla looks like this: Sda39a3ee5e6b4b0dC This is a not the MAC address...

I suggest you do the following:

  1. Edit your current addon configuration and provide a "dummy" MAC address, like this one: FF:FF:FF:FF:FF:FF. Keep all your settings as they are image

  2. Start the addon

  3. Once started, you can, Press the "Scan bluetooth" button in device "Tesla_BLE_XP7YGCEK5PB153946"

image

  1. Then go to the addon logs, and you should see an output telling you if the MAC address has been detected or not:

image

  1. Edit again your configuration with the detected MAC address and restart the addon
baylanger commented 1 month ago
* SD:A3:9A:3E:E5:E6:B4:B0:DC

Just to make it clear, what you have above is not a BLE MAC address. The MAC address format is AA:BB:CC:DD:EE:FF - no more than 6 consecutive "2 letters" separated w/ a :

Like @raphmur mentioned, press the "Scan Bluetooth" button and then check the add-on's log. The MAC address of your car will show up.

vdiogo commented 1 month ago

Thanks, this worked!