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


#734

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 }}'

#735

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 %}`

#736

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.


#737

Wow, great work!


#738

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?


#739

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.


#740

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!


#741

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


#742

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)


#743

yeah silly me. See edit if interested in helping


#744

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.


#745

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%


#746

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.


#747

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

#748

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.


#749

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

#750

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.


#751

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


#752

In order to add it follow this

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


#753

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.