core icon indicating copy to clipboard operation
core copied to clipboard

Switcher Touch - discovered but no action from HA (related to home-assistant / core #91215)

Open adizag opened this issue 1 year ago • 7 comments

The problem

A new switcher touch was not discovered by HA, found this issue in HA/CORE [https://github.com/https://github.com/home-assistant/core/pull/91215].

I noticed it was merged into DEV release of HA, but I can't comment there...

So I installed the DEV version and the new switch was discovered. it also got the sensors working and was updated in HA when triggered by the physical/app switch. The problem is that it can't be controlled from within HA. It seems like communication is passing from the switch to HA but not the other way around. please see the video:

https://user-images.githubusercontent.com/17390016/235326351-69ee2903-7bb8-499e-9e37-b6f0aef66ddf.mp4

What version of Home Assistant Core has the issue?

core-2023.5.0.dev20230423

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Container

Integration causing the issue

switcher

Link to integration documentation on our website

https://www.home-assistant.io/integrations/switcher_kis/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

adizag avatar Apr 29 '23 22:04 adizag

Hey there @tomerfi, @thecode, mind taking a look at this issue as it has been labeled with an integration (switcher_kis) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of switcher_kis can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Renames the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign switcher_kis Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


switcher_kis documentation switcher_kis source (message by IssueLinks)

home-assistant[bot] avatar Apr 29 '23 22:04 home-assistant[bot]

attached the integration debug diagnostics config_entry-switcher_kis-963494e84b7783a15d68ef28184c752b.json (2).txt

adizag avatar Apr 30 '23 06:04 adizag

@TomerFi anything else I can contribute to assist you with debugging it?

adizag avatar May 02 '23 07:05 adizag

Unfortunately I haven't been using HA for a while nor have I actively maintained this integration for the last couple of years. @thecode will probably be able to provide better answers than me on this.

TomerFi avatar May 02 '23 09:05 TomerFi

The problem originates at https://github.com/home-assistant/core/pull/91215 or more precisely at https://github.com/TomerFi/aioswitcher/pull/642 The reason I was waiting with adding additional port was that my install tests with adding this port did not work.

I don't have time to do reverse engineering now to understand what is different in these devices nor I didn't get any information from the vendor about what is needed to be updated to control them.

We can either revert this bump, leaving these devices not detected as they were before but not broken or keep it like and wait for someone to fix it.

thecode avatar May 02 '23 11:05 thecode

I have this switch, and of course HA. Is there anything I can do to assist with the reverse engineering with your guidance? Im not the right man to do it alone, but I can be your ears and eyes and i really want to help solving it...

adizag avatar May 02 '23 14:05 adizag

I can try to help too. I have a new switch (version 5.03), I did exactly what you did (manually override the integration from github). I started to debug it, maybe together we can fix it

YuvalWS avatar May 02 '23 14:05 YuvalWS

@YuvalWS Im here for any need. But I can't code.... If you need anything to check, sniff, etc, just give me instructions! 🙌

adizag avatar May 02 '23 18:05 adizag

I started to test it today, and I noticed a strange thing - a short time after the switcher connect to the network I can control it via the integration (at least turn it on and off), and after a few minutes it stops working. after a few minutes I could control it again. @thecode - I don't see a reason to revert, this state is better than nothing. I will try to look deeply into it later

YuvalWS avatar May 03 '23 09:05 YuvalWS

I found that if I'm changing some unknown data in the packet it is working (only when I close the Switcher App)

Wireshark - Switcher App requests headers:

        00 01 02 03 04 05 06 07  08 09 0A 0B 0C 0D 0E 0F
Open App
Login - fe f0 52 00 02 32 a1 00  5e a2 a7 2c ed 03 01 00 
On    - fe f0 5d 00 02 32 01 02  5e a2 a7 2c ec 03 01 00
Off   - fe f0 5d 00 02 32 01 02  5e a2 a7 2c ee 03 01 00
On    - fe f0 5d 00 02 32 01 02  5e a2 a7 2c f1 03 01 00
Off   - fe f0 5d 00 02 32 01 02  5e a2 a7 2c f2 03 01 00
Restart App
Login - fe f0 52 00 02 32 a1 00  a8 a2 a7 2c ed 03 01 00
On    - fe f0 5d 00 02 32 01 02  a8 a2 a7 2c ec 03 01 00
Off    -fe f0 5d 00 02 32 01 02  a8 a2 a7 2c ee 03 01 00

Header[08:0B] is the session_id Header[0C:0C] is the unknown data that looks like some index

I tested it with the change below:

REQUEST_FORMAT_TYPE1     = "{}ec0001000000000000000000{}00000000000000000000f0fe"
REQUEST_FORMAT_TYPE1_NEW = "{}ed0001000000000000000000{}00000000000000000000f0fe"

...

# format value just timestamp (initial session id is "00000000")
LOGIN_PACKET_TYPE1 = (
    "fef052000232a10000000000" + REQUEST_FORMAT_TYPE1_NEW[2:] + "1c" + PAD_72_ZEROS + "00"
)

...

# format values are local session id, timestamp, device id, command, timer
SEND_CONTROL_PACKET = (
    "fef05d0002320102" + REQUEST_FORMAT_TYPE1 + "{}" + PAD_72_ZEROS + "000106000{}00{}"
)

zVaz avatar May 08 '23 23:05 zVaz

any update?

adizag avatar May 15 '23 10:05 adizag

For me it's been 2 weeks and it works perfectly. Switcher 5.03, HA 2023.5.1

YuvalWS avatar May 15 '23 11:05 YuvalWS

@YuvalWS what did you do to solve it?

adizag avatar May 15 '23 11:05 adizag

I have the same issue.. Switcher Touch with 5.15 Firmware and HA 2023.06.2

Kili4ka avatar Jun 15 '23 13:06 Kili4ka

I had this issue 3 days ago, now i wanted to start diving in but... I wanted to verify there is no something new on the onboarding process. So maybe there is something (maybe token generation, idw) but it is working now. so reonboard your device and update us if its working for you as well.

Yogranov avatar Jun 17 '23 09:06 Yogranov

I removed the integration , installed it again, still the same behavior

Kili4ka avatar Jun 17 '23 19:06 Kili4ka

I removed the integration , installed it again, still the same behavior

Not the integration, but the switcher device from switcher app and add it again to switcher app. I didnt touch HA at all.

Yogranov avatar Jun 17 '23 19:06 Yogranov

I just tried that. Removed the device from the Switcher app and then onboarded it again. Then removed again the integration in HA and installed it again. Still the same behaviour.

Kili4ka avatar Jun 17 '23 19:06 Kili4ka

Quick update, Switcher support asked me to enable the "local" toggle on the Switcher app. At first, it didn't help, but I did a power reset and reinstalled the integration in HA and it started working.

Kili4ka avatar Jun 19 '23 06:06 Kili4ka

Quick update, Switcher support asked me to enable the "local" toggle on the Switcher app. At first, it didn't help, but I did a power reset and reinstalled the integration in HA and it started working.

@Kili4ka Can you confirm the switch model and fw version?

adizag avatar Jun 19 '23 07:06 adizag

Switcher Touch (3 gewiss), FW 5.15

Kili4ka avatar Jun 19 '23 07:06 Kili4ka

I can go ahead and approve this is fixed now.

the steps for getting it to work again in HA:

  1. upgrade to 5.15 FW
  2. delete the device from the switcher app
  3. delete switcher integration from HA (I did this step, but I'm not sure it is necessary for the process)
  4. change the switcher app to work in LOCAL mode
  5. add the device again
  6. add the HA integration again

Thanks to SWITCHER for supporting this issue!

adizag avatar Jun 21 '23 07:06 adizag