tony-fav / tasmota-blerry

GNU General Public License v3.0
96 stars 29 forks source link

use first 12 bytes of mac to fix "BRY: Exception> 'key_error' - F98336xxxxxx/1" #80

Closed gmparis closed 10 months ago

gmparis commented 10 months ago

I tried to use the WoSensorTHO driver with Tasmota 13.2.0(bluetooth), which did not work, giving the type of error message in the title. The MAC gets a spurious "/1" tacked on, causing the key_error. (I don't get this error with the GVH5075 devices I have, so this is mysterious.) This hack just lops off anything after 12 bytes. The Berry language is a bit foreign to me, so I didn't go beyond solving my problem. Surely the true fix is somewhere else, but this works and should be harmless to all other devices. I left debugging code in here that you'll probably want to delete. Hope this is helpful.

tony-fav commented 10 months ago

Normally for the /1 devices, you just add that into the json configuration and it works fine. Does this not work in your case?

gmparis commented 10 months ago

Oh, I guess that would be easier. Did not see that tip anywhere. Where does the /1 come from?

On Sat, Nov 18, 2023, 11:58 PM tony @.***> wrote:

Normally for the /1 devices, you just add that into the json configuration and it works fine. Does this not work in your case?

— Reply to this email directly, view it on GitHub https://github.com/tony-fav/tasmota-blerry/pull/80#issuecomment-1817746389, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF37LINTQKKDJBP22OMR2NTYFGGYNAVCNFSM6AAAAAA7RNCRJ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJXG42DMMZYHE . You are receiving this because you authored the thread.Message ID: @.***>

tony-fav commented 10 months ago

So there's a good description of the different types of Bluetooth addresses here: https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-2-bluetooth-le-advertising/topic/bluetooth-address/

In Tasmota, public addresses get no marker, "random static addresses" get the /1. BLEAddrFilter is the Tasmota command to see more address types in the BLE page.

gmparis commented 10 months ago

Thanks, Tony, for taking the time to give me a private lesson! I'll back out my change and set up again using the /1.

Thanks for your work on this project; it is really great. I made some BLE devices in the past that have provided me great service, but they don't integrate with home automation. I'm going to revamp those to take advantage of your project.

On Sun, Nov 19, 2023 at 9:49 AM tony @.***> wrote:

So there's a good description of the different types of Bluetooth addresses here: https://academy.nordicsemi.com/courses/bluetooth-low-energy-fundamentals/lessons/lesson-2-bluetooth-le-advertising/topic/bluetooth-address/

In Tasmota, public addresses get no marker, "random static addresses" get the /1. BLEAddrFilter is the Tasmota command to see more address types in the BLE page.

— Reply to this email directly, view it on GitHub https://github.com/tony-fav/tasmota-blerry/pull/80#issuecomment-1817876858, or unsubscribe https://github.com/notifications/unsubscribe-auth/AF37LINLE77LH6HGAILWMXDYFIMAJAVCNFSM6AAAAAA7RNCRJ2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJXHA3TMOBVHA . You are receiving this because you authored the thread.Message ID: @.***>

tony-fav commented 10 months ago

My suggestion would be to try and follow the BTHome standard! https://bthome.io/ That way your devices will be supported by quite a lot of projects.

Anyways, I think I'll close this PR now. I'm 99% sure this would break blerry for folks with the /1 in their configurations already.