TomerFi / aioswitcher

PyPi module integrating with various Switcher devices
https://aioswitcher.tomfi.info
Apache License 2.0
29 stars 18 forks source link

Incorrect parsing of MAC address for Switcher Runner #783

Closed thecode closed 3 months ago

thecode commented 3 months ago

What happened?

Details in https://github.com/home-assistant/core/issues/122715#issuecomment-2254539132, it looks like we have a one byte shift when parsing the MAC address for Switcher Runner. @YogevBokobza you recently checked all runner devices, can you verify that?

Module Version

3.4.3

Device Type

Switcher Runner

Firmware Version

1.79

Relevant log output

39:E8:68:E7:80:3B
3C:E8:68:E7:80:3B
3F:E8:68:E7:80:3B
49:E8:68:E7:80:3B

The real device MAC starts with E8 so the first byte is not related to the MAC

YogevBokobza commented 3 months ago

I personally don't have Switcher Runner the normal one, I have Runner Mini, S11 and S12. To me, it looks like his device needs an update as 1.79 is very old. I am asking the Switcher dev regarding that and I will update..

thecode commented 3 months ago

I personally don't have Switcher Runner the normal one, I have Runner Mini, S11 and S12. To me, it looks like his device needs an update as 1.79 is very old. I am asking the Switcher dev regarding that and I will update..

The parsing error is not related to an update, the MAC is shifted in the packet, even if it does we will have to support both formats.

I thought you tested the Runner since we did changes there, I am afraid we are going to change the logic in the runner without anyone testing it.

YogevBokobza commented 3 months ago

I personally don't have Switcher Runner the normal one, I have Runner Mini, S11 and S12. To me, it looks like his device needs an update as 1.79 is very old. I am asking the Switcher dev regarding that and I will update..

The parsing error is not related to an update, the MAC is shifted in the packet, even if it does we will have to support both formats.

I thought you tested the Runner since we did changes there, I am afraid we are going to change the logic in the runner without anyone testing it.

The MAC is not shifted for any of my devices.. He has old Switcher firmware and an old HA version.. I cannot replicate his issue. I will update you when I get an answer from the Switcher dev guy..

Regarding the new logic, it won't do anything new to the existing devices.. The same logic and the same packets send and receive.. it's only new for the token-based device mainly the Runner S11

aviyaho commented 3 months ago

I've updated HA OS version to the latest one: core-2024.7.4 HA has detected the 5 Switcher Runner devices as new and marked the previous devices as unavailable.

The devices got new unique ids, for example: c6a498-5C:E8:68:E7:80:3B Instead of the previous ID that was: 6a498-49:E8:68:E7:80:3B

while the MAC address is one of the following: ESP ether e8:68:e7:80:3b:1c C enp0s20u2u4 ESP ether e8:68:e7:80:3b:6d C enp0s20u2u4

thus, I can assume that the HA version doesn't solve the issue.

I've tried to update the firmware version according to the manual in Switcher website, but it doesn't work as expected with the new Switcher app - I've contacted Switcher support and waiting for their response.

@YogevBokobza , what is the latest Switcher Runner firmware version?

YogevBokobza commented 3 months ago

I've updated HA OS version to the latest one: core-2024.7.4 HA has detected the 5 Switcher Runner devices as new and marked the previous devices as unavailable.

The devices got new unique ids, for example: c6a498-5C:E8:68:E7:80:3B Instead of the previous ID that was: 6a498-49:E8:68:E7:80:3B

while the MAC address is one of the following: ESP ether e8:68:e7:80:3b:1c C enp0s20u2u4 ESP ether e8:68:e7:80:3b:6d C enp0s20u2u4

thus, I can assume that the HA version doesn't solve the issue.

I've tried to update the firmware version according to the manual in Switcher website, but it doesn't work as expected with the new Switcher app - I've contacted Switcher support and waiting for their response.

@YogevBokobza , what is the latest Switcher Runner firmware version?

@aviyaho I am not sure what is the latest Switcher Runner firmware version.. My Switcher Runner Mini device is at version 2.11.

I will contact the Switcher dev on Sunday. Can you provide your Switcher username (email registered). I can ask the Switcher dev to help update your device.

aviyaho commented 3 months ago

I got switcher response to my query.

The firmware is being updated automatically. I'm using the latest firmware version (1.79)

בתאריך יום ו׳, 2 באוג׳ 2024, 22:21, מאת YogevBokobza ‏< @.***>:

I've updated HA OS version to the latest one: core-2024.7.4 HA has detected the 5 Switcher Runner devices as new and marked the previous devices as unavailable.

The devices got new unique ids, for example: c6a498-5C:E8:68:E7:80:3B Instead of the previous ID that was: 6a498-49:E8:68:E7:80:3B

while the MAC address is one of the following: ESP ether e8:68:e7:80:3b:1c C enp0s20u2u4 ESP ether e8:68:e7:80:3b:6d C enp0s20u2u4

thus, I can assume that the HA version doesn't solve the issue.

I've tried to update the firmware version according to the manual in Switcher website, but it doesn't work as expected with the new Switcher app

  • I've contacted Switcher support and waiting for their response.

@YogevBokobza https://github.com/YogevBokobza , what is the latest Switcher Runner firmware version?

I am not sure what is the latest Switcher Runner firmware version.. My Switcher Runner Mini device is at version 2.11.

I will contact the Switcher dev on Sunday. Can you provide your Switch username (email registered). I can ask the Switcher dev to help update your device.

— Reply to this email directly, view it on GitHub https://github.com/TomerFi/aioswitcher/issues/783#issuecomment-2266006288, or unsubscribe https://github.com/notifications/unsubscribe-auth/AKUINATXLPHDHLI3T5LB5NDZPPL2FAVCNFSM6AAAAABLT3C7O2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENRWGAYDMMRYHA . You are receiving this because you commented.Message ID: @.***>

YogevBokobza commented 3 months ago

I found the issue and was able to replicate that.

For my devices, Power Plugs have the correct MAC address and I am getting the wrong MAC address for those devices Switcher Breeze, Switcher Runner Mini and Switcher Runner S11

The common between the devices as I can see is API1 vs API2 devices.. I will contact the Switcher dev and see what is going on here..