Is this wifi switch supported? ANKUOO / MS6126

OK, you’re in CHCH (I think), I’ll buy one of your two and have a play. Be nice to catch up anyway.

I’m in Auckland. I’m happy to send you one of mine if you like. PM me.

I bought a couple of these wifi switches from Jaycar as well and there has since been a few updates to HA, has anyone had any luck getting them to work?

Any help would be great!
Cheers

I still have the one @xbmcnut kindly loaned me. I’m afraid it is still in the box. I will post when I have done some work on it. Cheers.

I’ve got the ms6126 and have successfully paired using the android app, connected to a unifi network.
Noting the inconsistencies between hass version and working switches, what firmware version is everyone running on the switch itself?

Navigating to the Rec app, under the Edit option of the particular switch,the ip and firmware version should be visible at the bottom of your screen.
I’m using the “default” 1.29

Once my computer is back from repair, I’ll go about adding the switches to hass via configurator and let you know how it goes.
I do know the other wifi mains plug from jaycar does work: MS6122 and MS6124.
however the power monitoring aspect of the MS6124 doesn’t work completely due to price per kWh input constraints

I have 21 of the Ankuoo MS-6126 installed in my house(purchased from Jaycar). 5 have been modified to remove the speaker, (as they beep for 90 seconds when they lose the Wi-Fi AP…normally at 2am in the morning)
I have them configured with the REC android app and have Alexa(x6) controlling them successfully. And via home assistant via the https://www.home-assistant.io/components/switch.command_line/ and the recorded UDP packet streams following this guy’s blog : http://blog.giuliomontagner.com/post/155085663708/trying-to-hack-ankuoo-rec-switch-and-make-it . I have also contacted the manufacturer to enquire about the encryption key, but have been told it is unique and not available.

I also have 5 Ankuoo MS6124 , which are via the Ankuoo Neo app and controllable via HomeAssistant as a broadlink device using MAC and IP address.

1 Like

If you use Node-Red create a function with a msg.payload = new Buffer([0x01,(recorded via wireshark for that switch)}); and sent it to a UDP port 18530 of the ankuoo switch IP address. easy!

I’ve successfully captured 3 packets per on and off transmission, as well as noticing some ‘keep-alive’ packets, but cannot use tcpreplay due to using the Wireshark ‘Promiscuous’ option adding extra flags to the exported packet.

All in all:
Wireshark on a device connected to the main wifi network
Phone connected to the main wifi network
Switch connected to the main wifi network

Capture Filter: ether src <phone MAC> and ether dst <switch MAC>
enable Monitor and Promiscuous checkboxes within Capture Filter.

can anyone recommend how to go about using these raw frames within hass?
I’ve tried all other modes and can’t see the packets sent from my phone to the switch unless its the raw frames.

I just echo the byte steam to nc(netcat) eg. ‘echo -n -e “\x01\x40\xac\blah blah blah” |nc -w1 -u IP address 18530’ in separate bash scripts as I couldn’t get it to work in the configuration.yaml file. Very clunky… but works… The switch sends a status update packet to *.255:18530 after a state change.

can you please run through your process in wireshark to get the packets needed?
I can’t seem to get the packets in a usable format

I had heaps of problems also, I put it down to UDP packets going from source to destination in the WI-FI network and not traversing the LAN network. So I added a second WI-FI AP to my network and connected my phone to that network. I then set my Cisco switch to ‘port mirror mode’ for the new AP switch port, so RX and TX where duplicated to the port Wireshark was listening on. The App sends a UDP packet to the switch on port 18530, the switch then sends a ‘UDP 18530’ back to the App. If the state changes the switch also sends a UDP packet to broadcast. The switches also send a ‘current status’ UDP packet to broadcast every 30 seconds… Without the encryption code the status messages are useless.

In Wireshark, ‘copy’ the data block from the UDP packet . For nc (netcat) you need to convert the byte stream into another format using the ‘\x’ separator .eg for the Wireshark byte stream 0140accf238bfaaffafaaffaaffaaffaaffaaffaaffaaffaaf , The converted stream needs to be \x01\x40\xac\xcf\x23\x8b\xfa\xaf\xfa\xfa\xaf\xfa\xaf\xfa\xaf\xfa\xaf\xfa\xaf\xfa\xaf\xfa\xaf\xfa\xaf
So the final command is ‘echo –n –e “\x01\x40\xac\xcf\x23\x8b\xfa\xaf\xfa\xfa\xaf\xfa\xaf\xfa\xaf\xfa\xaf\xfa\xaf\xfa\xaf\xfa\xaf\xfa\xaf” |nc –w1 –u 10.10.0.1 18530

@MarkPartlett thanks for sharing your experience, you’ve inspired me to go down this path and give this switch a go.

Looks like the learning curve to get this working is steep (I’m not a developer btw). If you don’t mind can you help me through this process and I’ll gladly share my experience on this forum for the benefit of others.

This is an amazing cheap devices and it being AUS compliant is mind blowing. Home Assistant integration… game changer!

Did you guys get this working, looking at them also…seeing as they may have some broadlink compatibility has anyone tried: https://github.com/eschava/broadlink-mqtt Maybe it will have some pointers for you homeassistant code.

I forked this project to make updates for use with mulitple devices,

@psyciknz note the MS6126 device is not a Broadlink device so I don’t think it’ll work (the MS6124 and MS6122 are broadlink devices).

I just bought a MS6126 from Jaycar so looking forward to seeing how these will work via UDP sniffing in the coming days.

Did you manage to get anywhere with that power monitoring version? I’m just trolling to decide if I want one and to hack around, or take the road easier travelled and just extend my zwave network.

The price difference is considerable though. But there is something to be said for convenience - zwave works, no need to block outgoing connections, no need for bridging software etc.

More than willing to help; " http://blog.giuliomontagner.com/post/155085663708/trying-to-hack-ankuoo-rec-switch-and-make-it " has everything you need. if promiscuous mode in wireshark doesn’t work… you might need to setup a “man in the middle” method of capture.

@MarkPartlett thanks for that. I’ve figured that I’m able to issue an ON and OFF command from home assistant using “google assistant webserver” hassio addon. This saves the need for me to wireshark UDP packets.

Did you manage to figure a way to capture the switch’s status? I can see the Google Assistant can ask “is the switch on” and it’ll respond correctly however how do I get status information into home assistant?

I’m a bit confused, what is the message broadcasted with the webserver addon that interacts with a switch on the network?
I can’t use the instructions in the link by MarkPartlett due to using OSX.

@CampbellFabrications refer here Community Hass.io Add-on: Google Assistant Webserver (broadcast messages without interrupting music)