Zigbee2mqtt: getting rid of your proprietary Zigbee bridges (Xiaomi, Hue, TRADFRI)

here’s my automation code which uses an Xiamoi contact sensor and a wemo light both connected through zigbee2mqtt I also have some other conditions based on light level and motion.

- id: '1526613924124'
  alias: Garage Light On
  trigger:
  - entity_id: binary_sensor.contactsensor
    from: 'off'
    platform: state
    to: 'on'
  condition:
  - below: '5'
    condition: numeric_state
    entity_id: sensor.wirelesstag_garage_light
  - condition: state
    entity_id: sensor.aeotec_zw100_multisensor_6_burglar_2
    state: '0'
  - condition: state
    entity_id: light.0x94103ef6bf428aad
    state: 'off'
  action:
  - data:
      entity_id: light.0x94103ef6bf428aad
    service: light.turn_on
1 Like

Yeah, don’t do that.
The idea is MQTT is in the background handling the states/data in the background.
You want to use the HA entity state change to do the automation.

tube0013 has a good example.

1 Like

That makes a lot more sense now! I was over-complicating the MQTT side of it (still new to it) and forgetting the normal HA triggers :slight_smile:

  - alias: Door Open - Light On
    trigger:
      platform: state
      entity_id: binary_sensor.xds1bedroom
      from: 'off'
      to: 'on'
    action:
      service: light.turn_on
      entity_id: light.bedside

Awesome, thanks for the tips guys.

Loving that I can now add Zigbee devices to HA without having a hub.

Ive had a box of Xiaomi stuff that Ive collected during sales just sat doing nothing after realizing I needed the Hub, then had issues with delays and pairings dropping off when using the Hub which can all now be put to some use :smiley:

Hello Scott, is this still up? I would be interested. Many thanks!! :slight_smile:

Have you tried it or do you happen to have any reference to this being compatible with HA out of the box?

Hello, may I ask what do you think about Zigate One Zigbee gateway to rule them all? ? Why are you guys creating a custom hardware when there seems to be a comercial product addressing this? (please don’t kill the messenger if I’m missing something very obvious)

1 Like

Few reasons.
1). ZiGate is 40EU. This is 10USD. (excluding debugger)
2). ZiGate is hard to find & order (I just found kickstarter). The other keys are everywhere. AliExpress, Ebay, Amazon.
3). It’s in French???

Not real reason I see to use that…

i agree with the above

  • these are cheap,
  • run in a docker container,
  • new devices are constantly being added to by the community,
  • easy to add extra routers
  • utilises MQTT for comms
  • it is non-commercial
  • it is cool to be part of the start of something this popular!

Is there a solution, where zig bee stick would be smth like z-wave? Inside the box, on gpio’s. It is not pretty like this

You can 3d-print one: https://www.thingiverse.com/search?q=CC2531

I’m also planning to get a bigger case for RPI. This will include inside this stick and the m2sata disk.

Hi yes it is, just waiting on another batch now, should be here within a week, as soon as they’re in I’ll message you!

I took the plunge and ordered one of the 3D printed cases from Thingverse (first time ordering a 3D print).

Cost me around £10 for both parts delivered.

Quality’s not too bad, needs some sanding and polishing if you want it looking pretty but it all fits together nicely.

One downside is there is no buttons so to rest the stick you will need to take it apart.

Hi,
followed this for a while and just ordered the necessary parts a week ago. The Xiaomi Sensors are priced to good compared to z-wave sensors available in my country.
Anyway since my HA server is on one side of my flat, i will definatly need a zigbee router in the middle to cover my whole apartment.

Can somebody confirm that the Osram Smart+ Plug (AB3257001NJ) will work for this or knows an alternive EU/Germany Plug? A LED Light as Router or the xiaomi power plugs wont work for me.

@All: Thanks for this great project!

I’ve been owning a zigate for few months, and I just moved to zigbee2mqtt.

  • zigate firmware is closed source
  • both zigate & zigate_homeassistant are dead at the moment, no proper updates.
  • zigate is expensive
  • I’m french :wink:

I (and others here) use a CC2531 flashed with the router firmware, it works really well.

Has anyone been able to pull the Voltage out of the Xiaomi stuff correctly?

topic: ‘zigbee2mqtt/xcubebedroom’, payload: ‘{“battery”:“100.00”,“voltage”:3015}’

Battery works:

  • platform: mqtt
    name: Cube Battery Level
    state_topic: “zigbee2mqtt/xcubebedroom”
    unit_of_measurement: ‘%’
    value_template: ‘{{ value_json.battery | int }}’

Voltage doesnt:

  • platform: mqtt
    name: Cube Voltage
    state_topic: “zigbee2mqtt/xcubebedroom"
    unit_of_measurement: ‘V’
    value_template: ‘{{ value_json.voltage }}’

Try using the sensors pushed through discovery mqtt. Then with template sensor

- platform: template
    sensors:
      attic_temperature_sensor:
        friendly_name: 'Attic temperature sensor'
        value_template: '{{ state_attr("sensor.0x00158d0001c164f5_temperature","battery") }}'
        icon_template: mdi:battery
        unit_of_measurement: '%'

Is anyone else having range issues with the CC2531 routers, only seems to be around 5mtrs.

I own several osram smart+ plugs, I can’t confirm the plug really works as a router. My nearby aqara sensors don’t connect thru the osram plugs.

In the mean time, I’ve not been able to connect a cc2531 as a router to my cc2530+cc2591 coordinator.