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

Hi @MrPete, Did you manage to get it working yet? This is my automation:

- alias: Dimmer waarde`
  trigger:
    platform: mqtt
    topic: 'zigbee2mqtt/0x000b57fffe902bb0'
  action:
    service: light.turn_on
    data:
      entity_id:
        - light.0x000b57fffed6d66c
        - light.0x000b57fffed5bca9
        - light.0x000b57fffed70940
    data_template:
      brightness: '{{ states.sensor["0x000b57fffe902bb0"].state | int }}'

Hi @nldroid, yes I did manage to get it working. Thank you for your automation, I tried it and it worked fine, except light does not switch off completely. I am using Ikea dimmer with Ikea light.
Here is my automation:

- alias: Ikea Dimmer 2      
  trigger:
  - platform: state
    entity_id: sensor.ikea_dimmer
  action:
  - service: mqtt.publish
    data_template:
      topic: zigbee2mqtt/ikea_light_1/set
      payload_template: >
        {% if is_state('sensor.ikea_dimmer', '0') %}
          {"state":"OFF"}
        {% else %}
          {"state":"ON","brightness": {{ states("sensor.ikea_dimmer") }} }
        {% endif %}`
2 Likes

Ah, thatā€™s a nice addition.

I just want to use the dimmer for dimming. All my lights are in a group that i switch off together so i didnā€™t have the need of it.

Took me a while to figure out that the template function doesā€™t like numbers in the name so thats why i thought of sharing it here.

Wow, great work!

Is the on/off status of Hue bulbs not supported?
I have paired a Hue bulb and I can control it from Home Assistant, but i see no entries in the log when I turn off the bulb using the wall switch nor when I turn it on using the wall switch and therefore Home Assistant has no idea whether or not the bulb is actually onā€¦ is that normal?

ATM yes. Once you power the bulb, they make an announce but that announce packet doesnā€™t show the current state (which should be on). I have osram bulbs and the same happens. At github they have asked if using the proprietary hub has the same behaviour or they actually go to ā€œonā€. I have a xiaomi gw, but there are no zigbee bulbs in the xiaomi line.

Hey all,

How do I reset the power consumption for a Xiaomi Zigbee Power outlet?

It seems to show real time power and total consumption but I canā€™t see how to reset the total consumption.

Also I get this error on 1 of my 2 Honeywell smoke alarms, is this anything I need to address:

ā€œNo matching payload found for entity: 0x00158d0001e64139 with state_topic: zigbee2mqtt/0x00158d0001e64139ā€

Thanks!

Whenever my temp sensor publishes data is does it 3 identical times in the same second. Never does it once or twice, always 3 times. see below

is this normal?

zigbee2mqtt:info 2018-10-15 14:34:33 MQTT publish, topic: 'zigbee2mqtt/0x00158d0002391a06', payload: '{"temperature":7.97,"linkquality":10,"humidity":58.58,"pressure":1004.81,"battery":"81.67","voltage":2945}'
  zigbee2mqtt:info 2018-10-15 14:34:33 MQTT publish, topic: 'zigbee2mqtt/0x00158d0002391a06', payload: '{"temperature":7.97,"linkquality":7,"humidity":57.45,"pressure":1004.81,"battery":"81.67","voltage":2945}'
  zigbee2mqtt:info 2018-10-15 14:34:33 MQTT publish, topic: 'zigbee2mqtt/0x00158d0002391a06', payload: '{"temperature":7.97,"linkquality":7,"humidity":57.45,"pressure":1004,"battery":"81.67","voltage":2945}'

EDIT: Xiaomi Aqara Temperature Humidity Sensor - https://www.gearbest.com/access-control/pp_626702.html?wid=1433363

I guess it depends on your sensor. Youā€™ll have to provide some more info.

(i donā€™t have any Zigbee temperature sensors but i guess nobody can give you a sensible answer without the sensor name)

yeah silly me. See edit if interested in helping

this is because of the cache system, the sensor doesnā€™t always send all its attributes in one zigbee message.
The cache merges the old attributes before sending the mqtt message.
so in your case, looking at your log, the first message is probably a temperature update (humidy & pressure are merged from previous messages), the second message it probably receives a humidity update, and then a pressure update.

without the cache, here is how it looks:

Oct 16 09:32:04   zigbee2mqtt:info 2018-10-16 09:32:04 MQTT publish, topic: 'zigbee2mqtt/aqara_09', payload: {"temperature":-17.39,"linkquality":39,"ts":1539 675124609,"ls":212269}'
Oct 16 09:32:04   zigbee2mqtt:info 2018-10-16 09:32:04 MQTT publish, topic: 'zigbee2mqtt/aqara_09', payload: '{"humidity":50.72,"linkquality":36,"ts":1539675124617,"ls":8}'
Oct 16 09:32:04   zigbee2mqtt:info 2018-10-16 09:32:04 MQTT publish, topic: 'zigbee2mqtt/aqara_09', payload: '{"pressure":1009,"linkquality":33,"ts":1539675124626,"ls":9}'

ignore the ts and ls attributes, those are timestamp and last_seen attributes Iā€™m playing with

unless you want to have to manually configure sensors in homeassistant itā€™s a requirement to use the cache.

1 Like

Ok thanks. I thought it might have paired wrong and repeated publications were a result. Will this affect battery? I have had mine for 2 weeks and the battery is 75%

I think thereā€™s nothing we can do about this behavior.
I donā€™t know if aqara devices get firmware updates from the xiaomi software shi^W^Wtack, or even better if thereā€™s an alternative opensource firmware.

So I bought a pair of these - Innr B22 Smart LED Bulb (BY 265). As far as I can tell they are idenitcal to this but packaged as a pair.

The Single BY165 is a supported device and can be found here (see code below)

    {
        zigbeeModel: ['BY 165'],
        model: 'BY 165',
        vendor: 'Innr',
        description: 'B22 Bulb dimmable',
        supports: generic.light_onoff_brightness().supports,
        fromZigbee: generic.light_onoff_brightness().fromZigbee,
        toZigbee: generic.light_onoff_brightness().toZigbee,
    },

How can I add support for these/get these to work? I am using hass.io and pretty confident that I do not have the technical knowhow or the ability(due to hassio) to follow this guide - How to support new devices

Help would be awesome (sorry for all the links :dizzy_face:)

 zigbee2mqtt:info 2018-10-16 21:41:04 New device with address 0x00158d0001d0c6f6 connected!
  zigbee2mqtt:info 2018-10-16 21:41:04 MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"device_connected","message":"0x00158d0001d0c6f6"}'
  zigbee2mqtt:warn 2018-10-16 21:41:04 Device with modelID 'BY 265' is not supported.
  zigbee2mqtt:warn 2018-10-16 21:41:05 Please see: https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices
  zigbee2mqtt:warn 2018-10-16 21:41:05 Device with modelID 'BY 265' is not supported.
  zigbee2mqtt:warn 2018-10-16 21:41:05 Please see: https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices

1st question, what model number does it give when you try to pair it? ie part one of the howto support new devices guide you pointed to.

Hi, the model is BY 265

 zigbee2mqtt:info 2018-10-16 21:41:04 New device with address 0x00158d0001d0c6f6 connected!
  zigbee2mqtt:info 2018-10-16 21:41:04 MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"device_connected","message":"0x00158d0001d0c6f6"}'
  zigbee2mqtt:warn 2018-10-16 21:41:04 Device with modelID 'BY 265' is not supported.
  zigbee2mqtt:warn 2018-10-16 21:41:05 Please see: https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices
  zigbee2mqtt:warn 2018-10-16 21:41:05 Device with modelID 'BY 265' is not supported.
  zigbee2mqtt:warn 2018-10-16 21:41:05 Please see: https://github.com/Koenkk/zigbee2mqtt/wiki/How-to-support-new-devices

I am no expert, but if the bulb is really identical to the 165 in all other respects that an identical setup should work, ie

 {
    zigbeeModel: ['BY 265'],
    model: 'BY 265',
    vendor: 'Innr',
    description: 'B22 Bulb dimmable',
    supports: generic.light_onoff_brightness().supports,
    fromZigbee: generic.light_onoff_brightness().fromZigbee,
    toZigbee: generic.light_onoff_brightness().toZigbee,
},

I guess @Koenkk will be able to confirm.

Yeah, thatā€™s what Iā€™m guessing but how do I add that code to my add-on?

In order to add it follow this

Once you are sure it works, correspond with @Koenkk so it gets added permanently.

Does anyone still have a stock of flashed CC2531ā€™s in the UK?
Planning on getting the debugger and downloader cable anyway but was hoping someone has the sniffer itself that can be shipped quicker so i can start testing stuff sooner.