AlexxIT/XiaomiGateway3

Control non Xiaomi Zigbee devices

AlexxIT opened this issue · 93 comments

This issue to discuss the feature of adding third-party Zigbee devices to the Mi Home ecosystem.

It is important to understand that only devices similar to Xiaomi devices will work this way!

You must add devices by calling the remote.send_command service with the specified model.

Tested devices:

@AlexxIT impressive! But what means "similar to Xiaomi devices"?

@Zuz666 the device must support the same protocol, have the same number of channels and the same functions as one of the Xiaomi devices.
For example, Xiaomi does not have an analogue of a two-channel dimmer. Or a 5 channel relay.
But they have relays for 1-3 channels and bulbs with brightness.

l0ckk commented

Try to add led power supply ikea (with wireless reciever) model : icpshc24-10eu-1l-1. in HA detected in eventes as new device (
model: TRADFRI Driver 10W
version: 17
zb_ver: 3.0
)
but gateway sounds 3 times...

Tested
Müller Licht
tint LED 2700-6500 K added as ikea.light.led1546g12 (on/off brightness color temp)
https://www.mueller-licht.de/produktinformationen/artikel/404004/

Ikea TRÅDFRI LED- E27 806 lm ww added as ikea.light.led1623g12 (on/off brightness)
https://www.ikea.com/de/de/p/tradfri-led-leuchtmittel-e27-806-lm-kabellos-dimmbar-warmes-tageslicht-warmes-tageslicht-rund-opalweiss-90408797/

@l0ckk Are you adding through the remote.send_command service? I think the model ikea.light.led1623g12 will be suitable.

l0ckk commented

@AlexxIT
Trying to add this code to automation.yaml, but when i check configuration HA flashed an error ( Invalid config for [automation]: [service] is an invalid option for [automation]. Check: automation->service. (See ?, line ?).) What i'm doing wrong? New to HA....

  • alias: Ligts
    service: remote.send_command
    entity_id: remote.0xnnnnnnnn_pair
    device: ikea.light.led1623g12
    command: pair

@l0ckk check demo video in readme. You can call service from GUI

l0ckk commented

@AlexxIT thanks!

You can also add Ikea tradfri outlet to supported devices (https://www.zigbee2mqtt.io/devices/E1603_E1702.html). No power meter, only on/off. Paired as lumi.plug.mmeu01.

Aqara Smart Plug EU (SP-EUC01, lumi.plug.maeu01) paired as lumi.plug.mmeu01.
No power measurement, on/off only.

Can you please tell me if it is possible to add colored lamps?

for example:
https://www.ikea.com/gb/en/p/tradfri-led-bulb-e14-600-lumen-wireless-dimmable-colour-and-white-spectrum-globe-colour-and-white-spectrum-opal-white-50411565/

what to use the device?

Thanks!

agmaq commented

I was able to add IKEA Tradfri LED 1000 lm E27 (id: LED1732G11) as ikea.light.led1623g12. on/off & brightness work! Thx @AlexxIT

I'm trying to control Ikea E1743 (https://www.zigbee2mqtt.io/devices/E1743.html) switch without success. It has 2 buttons.
I tried to pair it as lumi.sensor_switch.aq2 and lumi.remote.b286opcn01. I see no actions when i press buttons. When it's paired as b286opcn01 it shows battery level. Any idea how to debug it? Button press is visible in debug mode? I enabled debug but don't see anything when I press it.

@AlexxIT
It would be great to add IKEA Zigbee2 dimmer as well, since z2m support works quite bad for it (Koenkk/zigbee2mqtt#4609).

Добрый день! Один Blitzwolf BW SHP-13 добавлен как lumi.plug.mmeu01. Работает и в НА и в MiHome, но без измерений мощности.
Второй попробовал добавить как lumi.plug.mitw01. В НА работает также как первый. А в MiHome устройство вне сети. Возможно его теперь добавить в MiHome как lumi.plug.mmeu01? Пробовал удалять - не помогло.

@fedkevichan Нельзя. Я предупреждал, что в Mi Home есть только 1 шанс.

Sonoff ZigBee motion sensor (SNZB-03) paired successfully as lumi.sensor_motion but no motion is detected (always clear) only battery readings work.

@fedkevichan Нельзя. Я предупреждал, что в Mi Home есть только 1 шанс.

@AlexxIT, а где можно про это подробнее прочитать?

@scoobypt yes. Sonoff motion sensor is very different from Xiaomi / Aqara

@fedkevichan Нельзя. Я предупреждал, что в Mi Home есть только 1 шанс.

Я видел. Не готов был, что он вообще не будет доступен в MiHome, хоть и добавился. В инструкции, про такой вариант тоже не было.

Hi, how can I use xiaomi gateway 3 integration to control Yeelight M2 spotlights mesh (YLTS02YL model) ? i can see yeelight mesh spotlights in xiaomi smart gateway BLE connection, but I am unable to see any in HA with the xiaomi gateay 3 installed. Anyone can help?

@scoobypt yes. Sonoff motion sensor is very different from Xiaomi / Aqara

One question if I change to zha component do you think it will work?

@Zuz666 readme https://github.com/AlexxIT/XiaomiGateway3#add-third-party-zigbee-devices

Thanks, but it's not clear to me! Deleting device from MiHome later will not help to change the device model?

mijia cloud remembers device model forever after first registration (per region).

@scoobypt it seems to have worked for ZHA. I have such a sensor. But no time for tests

@biscuitee There are other issues about mesh. No need to discuss it here.

@scoobypt it seems to have worked for ZHA. I have such a sensor. But no time for tests

I already test it and it works perfectly in fact I change half of my aqara presence sensors, aqara temperature sensors and some sonoff presence sensors to this gateway with zha component and all work great. I will buy another type of sonoff ZigBee sensors and some ZigBee tuya and will test also.

Hi. I have problem with zigbee tuya switch 1 gang and 2 gang (with neutral wire). I added them using Aquara switch device:
lumi.switch.b1nacn02
and
lumi.switch.b2nacn02

The Xiaomi Gateway 3 found them and I can control them from HA (of/off)

New device:
did: lumi.ec1bbdfffed0fe57
mac: ec1bbdfffed0fe57
model: lumi.switch.b1nacn02
version: 66
zb_ver: 1.2

and

New device:
did: lumi.ec1bbdfffed0ed96
mac: ec1bbdfffed0ed96
model: lumi.switch.b2nacn02
version: 66
zb_ver: 1.2

However, HA cannot read current state of these switch (if turn on/off switch by hand)
Here is the log file
log101120.txt
Could you please and help me solve this problem. Thanks

I think the current state is not supported for all devices added this way. You can use ZHA mode or another stick.

I think the current state is not supported for all devices added this way. You can use ZHA mode or another stick.

I tried ZHA mode following the instruction in your video but not success. It says failed to connect. Same result with me account or token key. Any suggestion? Thanks

Try restart gateway and config ZHA again

I added a Lonsonho Double Switch Wall - lumi.switch.b2lacn02, but I can't control it.
image

I added a Lonsonho Double Switch Wall - lumi.switch.b2lacn02, but I can't control it.
It fully works in ZHA mode.

I'm trying to control Ikea E1743 (https://www.zigbee2mqtt.io/devices/E1743.html) switch without success. It has 2 buttons.
I tried to pair it as lumi.sensor_switch.aq2 and lumi.remote.b286opcn01. I see no actions when i press buttons. When it's paired as b286opcn01 it shows battery level. Any idea how to debug it? Button press is visible in debug mode? I enabled debug but don't see anything when I press it.

Did you manage to make it work?

I added a Lonsonho Double Switch Wall - lumi.switch.b2lacn02, but I can't control it.
It fully works in ZHA mode.

i added Lonsonho Double Switch Wall (with out N) like lumi.switch.b2lacn02, when i turned on the 1 switch - turned on 2 switch, when i turned on the 2 switch - nothing turned on. chanels are shifted?

When i added switch in ZHA mode, both channels work well, but automatically turn off 2 minutes after turning on

I added switch in usual mode like lumi.ctrl_ln2.aq1 QBKG12LM - both channels work well, after 2 minutes it does not turn off, everything is fine. lumi.ctrl_ln2.aq1 have power meter and, of course, it is not available with this method

Great feature for Zigbee!

Can same feature be added for BlueTooth Mesh? eg. I have a 3rd party BLE Mesh Switch, worked in Mi Home, in Mi IoT Debugger display as Switch, but appear in HASS as Light, model name 3015, on/off button greyed out. Apparently this component default all Mesh device as light and not support Switch yet, but I'm hoping if I can use the same approach as ZigBee to disguise it as a XiaoMi BLE Switch...

Please Help.
Who did pairing with Lonsonho Single Wall Switch no-neutral Switch
What model name should I use ?

lumi.ctrl_ln1, lumi.ctrl_ln2 ande other Aquara wall switched doesnt work

Please Help.
Who did pairing with Lonsonho Single Wall Switch no-neutral Switch
What model name should I use ?

lumi.ctrl_ln1, lumi.ctrl_ln2 ande other Aquara wall switched doesnt work

I used lumi.ctrl_ln2.aq1

Please Help.
Who did pairing with Lonsonho Single Wall Switch no-neutral Switch
What model name should I use ?
lumi.ctrl_ln1, lumi.ctrl_ln2 ande other Aquara wall switched doesnt work

I used lumi.ctrl_ln2.aq1

It works, but I have 1 button, and now I cannot change it to lumi.ctrl_ln1.aq1 ?
After update integration deleting entity and reboot, I changed it to 1 button version. Thanks a lot !!!

@dmytroaskuma Use ZHA. It's stable for me and all my non-xiaomi devices work. I have lonsonho (3 button with neutral), ikea (bulbs,sockets,switch), sonoff (zbmini) and more, everything works great. Even zigbee network map works.

@dmytroaskuma Use ZHA. It's stable for me and all my non-xiaomi devices work. I have lonsonho (3 button with neutral), ikea (bulbs,sockets,switch), sonoff (zbmini) and more, everything works great. Even zigbee network map works.

How it works with HomeKite bridge ?

may be time to make a summary table of third-party devices, with which xiaomi device model it was possible to manage this third-party devices?

its any option how control sonoff zigbee devices over Xiaomi Gateway 3?
I have sonoff snzb-02

Thanks

@Soused19 use ZHA

@AlexxIT thanks, i will try it

PTPWW commented

Hello,
adding 3rd party devices (such as zigbee plug) works well, they are also visible and usable in the MiHome App. Xiaomi Gateway is in "Mi Home" mode.
But after some hours they appear as OFFLINE, and only a DELETE, restart of HASS and new adding works then to re-activate them in MiHome App - and only again for a few hours. In HASS they keep on working.
@AlexxIT Is this bug known, and is there a way to keep those devices "alive" in the MiHome app?
Thanks

Does anybody know if Osram Lightify lightbulbs can be paired?

PTPWW commented

@AlexxIT
Hi, I just want to ask you about the sentense "The devices added in this way will work even after the Gateway is restarted. They will continue to work without Hass. And they can be used in Mi Home automations." Like I wrote in 2 comments before, for me it works for a few hours and after that they suddenly turn grey and "offline" in the Mi Home automation. ZHA is not being used. Is that behviour known, and what can I do to re-activate the devices in the Mi Home app, and to keep it there usable?
Thank you for your great work here!

Some devices go offline after some time when using this method. I don't know why one devices works without problem and other go offline.

Добрый день!!! Sonoff ZBMINI можно подключить?

@TRibyn yes. Need to wait component update

Has anyone attempted to get the IKEA Symfonisk remote working? Could be an awesome universal knob for adjusting anything.

hello, thanks for the great work. I can confirm TRÅDFRI
Signal repeater work as light ikea.light.led1623g12. and repeat all my devices. till now work as expected

@TRibyn yes. Need to wait component update

I've tried to to add Sonoff ZBMINI as Ikea light and it worked for 5-10 seconds. Then it was removed from the device list. Any chance you have updated this part? Thanks.

Хочу попробовать добавить такой выключатель https://aliexpress.ru/item/4000298926256.html
Какую модель лучше указать?

@dmatora можно попробовать

'lumi.ctrl_ln1': ["Aqara", "Single Wall Switch", "QBKG11LM"],
'lumi.ctrl_ln1.aq1': ["Aqara", "Single Wall Switch", "QBKG11LM"],
'lumi.switch.b1nacn02': ["Aqara", "Single Wall Switch D1", "QBKG23LM"],
'lumi_spec': [
['0.12.85', 'load_power', 'power', 'sensor'],
['0.13.85', None, 'energy', 'sensor'],
['4.1.85', 'neutral_0', 'switch', 'switch'], # or channel_0?
['13.1.85', None, 'button', None],
[None, None, 'action', 'sensor'],
]
}, {
# dual channel on/off, power measurement
'lumi.ctrl_ln2': ["Aqara", "Double Wall Switch", "QBKG12LM"],
'lumi.ctrl_ln2.aq1': ["Aqara", "Double Wall Switch", "QBKG12LM"],
'lumi.switch.b2nacn02': ["Aqara", "Double Wall Switch D1", "QBKG24LM"],

Приветствую. Извините за глупый вопрос: а перед отправкой remote.send_command устройство соотвественно нужно перевести в режим сопряжения, зажать там что-то и пр? ))

I can pair this dimmer, but I am not able to get it working so that I can control hass.

In first pairing I pair it as ikea.light.led1623g12. I can delete it and hear the 3 beebs for successful deletion.

In subsequent pairings it always appears as ikea.light.led1623g12 LED1623G12 by IKEA - in both hass and Xiaomi Home app, even I have used various different device names like lumi.sensor_switch.

Is there a way to completely delete the device after 1st pairing?

Trying to pair Aqara Double Wall Switch H1 (WS-EUK02) to xiaomi gateway 3: Fails every time.

Gateway integration: lumi.gateway.mgl03 ZNDMWG03LM, by Xiaomi, Firmware: 1.5.0_0102, EU server.
HA: core-2021.11.5, OS ver. 6.6; fixed IP via reserved dhcp, connected/online, Mi Home mode, all other xiaomi gadgets (previously integrated via Mi Home app) work fine.

Pairing in Mi Home fails; tried:
[1] add switch in app via regular procedure: not possible (hub grayed out, unselectable);
[2] tried to add via the suggested 'add mi wireless switch' then reset (long press switch ~8 seconds - fails.

[3] Pairing as suggested in yotube demo video, from HA, also fails (although I understand the syntax changed a bit since the new UI is available - posted YAML content):

service: remote.send_command
data:
  command: pair
  device: lumi.switch.l2aeu1
target:
  entity_id: remote.0x588e81fffee69aac_pair

(gateway LED blinks fast - pair mode, switch LEDs twinkle blue for a while)

either way the gateway beeps 3 times and fails to pair. Even relocated the hub ~1m from te wall switch, but with the same result.

best result so far was when trying option [2]: I got a notification in HA:

New device:
did: lumi.54ef4410000f5651
mac: 54ef4410000f5651
model: lumi.switch.l2aeu1
version: 11
zb_ver: 3.0
joined_type: 1

but no new entity / device shows up in HA / Mi Home.

any suggestions please? if i'm doing something wrong, kindly point me in the right direction, please.
bought the switch specifically for the integration within xiaomi GW3 based on 'compatible zigbee' list

zb3 sensors use special xiaomi cloud bind method. it works only in cn region (exception mi light sensor and aqara eu plug).

zb3 sensors use special xiaomi cloud bind method. it works only in cn region (exception mi light sensor and aqara eu plug).

Thanks for the fast reply, @rezmus!
So what you're suggesting is to either change server to cn, or change the switch, or maybe wait until (if) the switch is allowed in EU?

LE: was planning on fiddling with zigbee2mqtt later on (bought a conbee2 for this purpose, might succed that way to use the switch later, i remember finding some references to successful integration that way).

it has no official mijia support. you can bind it on cn region and use in HA, but not mi home.

thanks again @rezmus!
is there a way to do the binding to cn on the same hub without re-adding the devices already in the zigbee network?
Its probably faster to order/integrate a second hub (or maybe figure out the mqtt route) than to reconfigure everything (including automations etc.) since I've got about 20 xiaomi devices on EU server involved in a couple dozen automations :-)

in HA i dont know, but mi home keeps devices/scenes. hub 10s button press (wifi reset), connect to cn, pair zb3 sensor, wifi reset hub again, connect to eu. maybe new version 2.x of this integration will let zb3 bind on any region, at least for HA.

Hi.
Does anyone know if it's possible to add the IKEA button type devices?

Any 3rd party buttons won't work with this method. You may:

  • use ZHA mode
  • use z2m mode
  • wait 2.0 version of this integration

Hi @AlexxIT.

Thanks for the reply. Ok, understood. I would like to try to keep the mi home still functional so I will try to buy compatible devices for now. I've read about the ZHA and Z2M modes, but what will come with 2.0 version? Which type of new features can we expect?

Thanks.

@dsimoes You can check and already try beta versions
https://github.com/AlexxIT/XiaomiGateway3/releases

Hi @AlexxIT.
I have an IKEA LED1837R5 GU10 Bulb. Simple dimmable with 400lm.
I've used the custom pair with a similar bulb from your zigbee.py file: ikea.light.led1650r5.
Pair works, but on the Xiaomi App it shows the child device as a generic device and I'm not able to manipulate the bulb on the app, only on HA.

If I use mainland china servers this will work. The device will get added as an IKEA bulb and I can manipulate the device on the app and on the HA. But china servers are very slow for me. I went back to the europe server and tried to fool the app by choosing on of the available bulbs from the app. Example: lumi.light.aqcn01 - Aqara LED Light Bulb(Dimmable).
But you don't have the aqcn01 defined on zigbee.py and the pairing fails. If I use aqcn02 the pairing works but it's the same issue on the app, it will not recognize it.

Do you know if I can do this? Fool the app somehow? Or should I just give up on this scenario.
Thank you for the help.

@dsimoes,

Do you know if I can do this? Fool the app somehow? Or should I just give up on this scenario. Thank you for the help.

Personally I gave up pairing to the hub since I needed it in Mi mode & EU server.
Had a cc2531 laying around, set up zigbee2mqtt and everything works smooth. Keep in mind, if going this way, that there are newer and better dongles around (=better power/range), but this works for me since I hand only planned max 10 gadgets in direct view of the dongle (<10m,no walls). If needed will reconfigure for updated dongle or add repeaters.

@dsimoes Maybe MiHome vevs mod can work with this bulb on EU servers. I don't know

@rzv-trsc You don't need any stick to use z2m or ZHA. The gateway has an excellent zigbee chip

@rzv-trsc You don't need any stick to use z2m or ZHA. The gateway has an excellent zigbee chip

@AlexxIT good to know, thanks.
Z2m was already configured and running on cc for testing purposes. Needed something functional and didn't wanna fiddle with existing integrations, will research reconfiguring z2m to use with gw3.

Great work, many thanks for all your efforts! Silently profiting from it for quite a while!

@AlexxIT great work.
I've bought a IKEA TRADFRI LED 1055lm 9.5W E27 - LED2003G10, with brightness and temperature adjustment.

The system only identifies as ikea.light.led1650r5 LED1650R5, even when I send the remote command as ikea.light.led1545g12. So far it's working the on/off & brightness setup. Temperature adjustment isn't working.

Also @AlexxIT, could please clarify what are the firmware mod's that you have done, I've upgraded via telnet but select the original firmware. I couldn't find that information.

I have not done any firmware mod. The component works with the gateway on the original Xiaomi firmware. All info in readme:
https://github.com/AlexxIT/XiaomiGateway3#requirements

The option from 1 to 6 what are they? image

@Eduadel
You can read the modifications on the readme of each of the modded firmware here: https://github.com/zvldz/mgl03_fw/tree/main/firmware/custom

Hi. Any chance to get the IKEA button working? it's the simple switch button (E1812).
I've paired it with the lumi.sensor_switch device code, but there are no events/communication when I press it.
Will this only work in ZHA mode? Thanks

Maybe it will work in release 2.0 in MiHome mode. But I don't have such a button for tests

I'm trying to pair an Ikea Tradfri E14 LED1733G7 under ikea.light.led1536g5. Was originally able to pair, but after removing it from Mi Home I am no longer able to repair it. Calling the service results in a single beep from the gateway.

Does anyone know what I'm doing wrong?

@nicholaslimck your bulb not enter in pair mode https://youtu.be/07fhNCIjQDs

@AlexxIT I already put it into pairing mode the same way that I did the first time. Tried the suggestion in the video but the result was the same: one beep from the gateway.

Hello,
I'm desperately trying to add Aqara Smart Plug EU (SP-EUC01) to my Xiaomi Gateway 3 (ZNDMWG02LM).
After I quickly realised that I cannot simply do it on Mi Home I found this brilliant guide (huge thanks @AlexxIT !)
I managed to integrate HASS, HACS with Xiaomi Gateway 3 based on this guide, and also managed to pair Aqara SP-EUC01 with the gateway, I can control it from HASS GUI. I also have a working automation in place in HASS with Aqara SP-EUC01 and an Aqara Water Leak sensor. However the automation works only as long as HASS is up and running, once HASS is down, automation does not work any more. And unfortunately I cannot use the paired Aqara SP-EUC01 in Mi Home automations.

The guide says:
"The devices added in this way will work even after the Gateway is restarted. They will continue to work without Hass. And they can be used in Mi Home automations."

Question #1: What could I do wrong?
Question #2: It would be a simple salvation to my problem to buy another piece of Xiaomi Plug EU (ZNCZ04LM), but this model is out of stock (or maybe end of sale / end of life) everywhere. Anyone knows any alternative Zigbee EU plug model that is available and compatible with Mi Home (EU server) and Xiaomi Gateway 3 ?

Any suggestion is welcome!

Xiaomi Gateway 3 Firmware version: 1.5.0_0102, EU server.
HASS version: 2022.2.3
HACS version: 1.22.0

Latest Aqara Zigbee devices has regional restrictions
https://github.com/AlexxIT/XiaomiGateway3#regional-restrictions

this plug can be paired on any region, but it is not supported by stock app. search for vevs mod if you want to control/automate it in mi home.

@rezmus are there any other devices with the same problem (can be paired in any region, but supported only by vevs)?

SP-EUC01 проблема возникла с этой розеткой, раньше что бы она корректно работало, нужно было обновить прошивку через aqara home до версии 0.0.0_0032. После можно было подключать к xiaomi gateway через mi home vevs. Но сейчас в aqara home обновляет до версии 0.0.0_0041 и к к xiaomi gateway через mi home vevs больше не подключается. Точнее подключается работает пору секунд, видит розетку в home assistant, после шлюз пищит и розетка отваливается,
google translate:
SP-EUC01 a problem arose with this socket, earlier, in order for it to work correctly, it was necessary to update the firmware via aqara home to version 0.0.0_0032. After that, it was possible to connect to xiaomi gateway via mi home vevs. But now in aqara home it updates to version 0.0.0_0041 and it no longer connects to xiaomi gateway via mi home vevs. More precisely, it connects for a while, it sees the socket in the home assistant, after the gateway beeps and the socket falls off.

@jimmygrin73 This is a known problem with the latest socket firmware. There is no solution yet

Thank you all for your replies. Actually I gave it up after realising that Xiaomi Gateway v3 cannot perform any automation either without internet connection or available HASS. I started my little home project with Zigbee devices for two reasons:

  1. I'm only aware of Zigbee type water leak sensors (obviously because of the battery power supply)
  2. I had the assumption that once the automation is saved on the gateway it will work even without internet or LAN connection ,so the availability of the router or the internet service is not a dependency for the automation
    and when the Zigbee water leak sensor triggers the automation the zigbee smart plug will power off.
    Now that it is clearly not the case I can bought a Xiaomi wifi smart plug and use stock Mi Home app. This automation anyway requires the router and internet connection.

@bldevcode download vevs mod, connect aqara eu plug and setup local mijia automation. it will work without wifi.

@bldevcode local gateway automation (from MiHome) works fine without Hass and Internet.

Zigbee and BLE devices works fine with Hass without Internet. But Hass automations won't work without Hass...

There is a problem with the status of Mesh devices without Internet.

Hi,
the integration into Home Assistant works nice. I am able to control my devices within the GUI.
The only issue I have is to connect Zigbee devices in the dev tools. The service remote.send_command is just not available. Do I need to add it manually first?
Already tried different versions v2.1.0, v2.0.10 and v2.0.09 none seem to let me add Zigbee devices to Mi Home

Hub firmware 1.5.0_0102 cn server
core-2022.5.5
Home Assistant OS 8.1
supervisor-2022.05.2
HACS 1.24.5

Thanks!