Zigbee2mqtt revisited: No more ugly transformations

Does this plug directly to USB? Or do you need to solder special connectors to get it up and running? Thanks.

1 Like

it has an micro usb port, you need to solder one smb if you want to use an external antenna with the CC1352P-2, default it use an internal like the CC2531.
The other one has only an internal antenna, but more powerfull like the CC2531 if you need it.

It is often the case that there are always new devices and with the time you have so many that an upgrade is better or invested in better hardware before.

there is nothing worse than when the network is overloaded and problems start

This is not soldering work that can be done with normal equipment. The soldering joint is much too small for that. I gave it to a work colleague who also printed a case for a bottle of gin. I would have certainly screwed it up.

yes that is true, it is not easy, i have also asked which equipment is the best to resolder this smb in the zigbee2mqtt forum.
with an normal soldering iron it is not possible without to damage the board.

this should be only an info that it is possible, i was thinking i only need to plug an external antenna to the plug on the board and it is working, but no :neutral_face:

But also with the internal antenna, this board can handle 200 direct connected devices (without router devices), and this is much more than the CC2531.

It is expensive - but it is worth it. You save 30 Dollar and you spent days with the CC2531 and you are never really happy with it - his puts the costs into perspective, especially since you can save a lot of money with the cheap Xiaomi devices.

1 Like

Hi, I think I have this working.

I have the TRÅDFRI LED bulb E14 400 lumen which was paired with zigbee2mqtt and appeared as 0x086bd7fffe210efc

zigbee2mqtt configuration.yaml

homeassistant: false
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://localhost'
serial:
  port: /dev/ttyACM0
  disable_led: true
advanced:
  log_level: error
devices:
  '0x086bd7fffe210efc':
    friendly_name: 'swUpstairsHallwayLight'
experimental:
  output: attribute

lights.things

Bridge mqtt:broker:MosquittoMqttBroker "Mosquitto MQTT Broker" [host="192.168.1.92", secure=false]
{

	//Upstairs hallway
	Thing mqtt:topic:swUpstairsHallwayLight "Upstairs Hallway Light" {
	  	Channels:
	    		Type switch:switch "Power Switch" [
				stateTopic="zigbee2mqtt/swUpstairsHallwayLight/state", 
				commandTopic="zigbee2mqtt/swUpstairsHallwayLight/set",
				on="ON",
				off="OFF"  
			]
	    		Type dimmer:dimmer "Dimmer" [
				stateTopic="zigbee2mqtt/swUpstairsHallwayLight/brightness",
				commandTopic="zigbee2mqtt/swUpstairsHallwayLight/set/brightness", 
				min=1, 
				max=255, 
				step=1
			]
	}
}

lights.items

Switch sUpstairsHallwayLight "Upstairs Hallway Light"  { channel="mqtt:topic:swUpstairsHallwayLight:switch" }
Dimmer dUpstairsHallwayLight "Upstairs Hallway Light" { channel="mqtt:topic:swUpstairsHallwayLight:dimmer", autoupdate="false" }

Sitemap

Switch item=sUpstairsHallwayLight label="Upstairs hallway" icon="light"
Slider item=dUpstairsHallwayLight label="Upstairs hallway [%d %%]" sendFrequency=500

I have no idea why this all works, because the slider is 0-100%, but the bulb seems to receive 0-255 via MQTT - something somewhere is transforming the 0-100 from the slider to 0-255 for the bulb, but I don’t know what.

Let me know if this works out for you!

Edit: tagging @Brignoud as they also asked about the same thing

2 Likes

I bought a CC2531 from a guy at Z2M forum, he has 3D-printed cases with mounted antenna, preflashed to sell for a reasonable price. I can recommend him.
But my CC2531 broke (not really clear on why) and I went to a localshop and bought a ConbeeII. Right after Z2M announced they now have support for ConbeeII sticks as well so I think I will connect that to Z2M (was planning to run without Z2M, but I havent had time to test it yet.

Thanks
Mine was similar even if lower value was 254 but your hints are appreciated
Didn’t you arrange the colour temperature also?

What a surprise the item with sendFrequency in Sitemap.
What’s the puropose for this parameter?

Did you notice that even at the lower command for the slider lamp doesn’t really switch off?

The Tradfri bulb I have doesn’t have variable colour temperature.

I found that without setting sendFrequency the slider would jump around by itself for a bit after it has been manually adjusted.

Yes, at 0% the bulb is still on for me. I suppose you could have a rule which sends the OFF command to the switch (for me, sUpstairsHallwayLight) when the dimmer value (for me, dUpstairsHallwayLight) has changed to 0.

1 Like

That’s correct. Zigbee2MQTT makes an automatic transition, if you have active the experimental functon with attribute, this also works with color values and so on.
If you want more informations about the functions, you should read some posts on the github site.
On zigeebee2mqtt.io you find only a flat information of the functions.

I wondered that, but then adjusted my dimmer thing max=255 to max=150 and the bulb does not go to full brightness. This would suggest that openHAB itself is transmitting values greater than 100, so I think in this case something in openHAB is doing the transformation.

You can proof it, if you look into the logs from zigbee2mqtt, here you see the transformation. :slight_smile:

Hello,
could you guys maybe share your item definitions for the door/window sensors aswell ?

This is my current configuration:

Thing topic XiaomiContactSensorTerasse "XiaomiContactSensorTerasse"
    {   
        Channels:
            Type contact : contact "Contact" [ stateTopic = "zigbee/XiaomiContactSensorTerasse/contact", on = "false", off = "true" ]
            Type number : voltage "voltage" [ stateTopic = "zigbee2mqtt/XiaomiContactSensorTerasse/voltage" ]     
            Type number : battery "battery" [ stateTopic = "zigbee2mqtt/XiaomiContactSensorTerasse/battery" ]     
            Type number : linkquality "linkquality" [ stateTopic = "zigbee2mqtt/XiaomiContactSensorTerasse/linkquality" ]
    }

These are my items:

Contact XiaomiContactSensorTerasse_status      "Terasse [%s]"                    (gAll) {channel="mqtt:topic:broker:XiaomiContactSensorTerasse:contact"}
Number XiaomiContactSensorTerasse_voltage    "Sensor Volt [%d mV]"               (gAll) {channel="mqtt:topic:broker:XiaomiContactSensorTerasse:voltage"}
Number XiaomiContactSensorTerasse_battery    "Sensor bat [%.1f %%]"  <battery>   (gAll) {channel="mqtt:topic:broker:XiaomiContactSensorTerasse:battery"}
Number XiaomiContactSensorTerasse_linkquality "Sensor linkquality [%d]"          (gAll) {channel="mqtt:topic:broker:XiaomiContactSensorTerasse:linkquality"}

Every item is updating correctly but only my Contact item does not update/change when the door is opened/closed.

What am I missing?

The contact contact channel definition is wrong. You are using the base topic “zigbee” instead of “zigbee2mqtt” like with your other channels.

1 Like

Thank you for the tip. I did change that but my item is still not updating.

This is what I see in zigbee2mqtt log/journal:

Apr 21 20:41:39 openhab npm[24303]: zigbee2mqtt:info  2020-04-21 20:41:39: MQTT publish: topic 'zigbee2mqtt/XiaomiContactSensorTerasse/battery', payload '80'
Apr 21 20:41:39 openhab npm[24303]: zigbee2mqtt:info  2020-04-21 20:41:39: MQTT publish: topic 'zigbee2mqtt/XiaomiContactSensorTerasse/voltage', payload '2965'
Apr 21 20:41:39 openhab npm[24303]: zigbee2mqtt:info  2020-04-21 20:41:39: MQTT publish: topic 'zigbee2mqtt/XiaomiContactSensorTerasse/linkquality', payload '81'
Apr 21 20:41:39 openhab npm[24303]: zigbee2mqtt:info  2020-04-21 20:41:39: MQTT publish: topic 'zigbee2mqtt/XiaomiContactSensorTerasse/contact', payload 'false'
Apr 21 20:41:42 openhab npm[24303]: zigbee2mqtt:info  2020-04-21 20:41:42: MQTT publish: topic 'zigbee2mqtt/XiaomiContactSensorTerasse/battery', payload '80'
Apr 21 20:41:42 openhab npm[24303]: zigbee2mqtt:info  2020-04-21 20:41:42: MQTT publish: topic 'zigbee2mqtt/XiaomiContactSensorTerasse/voltage', payload '2965'
Apr 21 20:41:42 openhab npm[24303]: zigbee2mqtt:info  2020-04-21 20:41:42: MQTT publish: topic 'zigbee2mqtt/XiaomiContactSensorTerasse/linkquality', payload '81'
Apr 21 20:41:42 openhab npm[24303]: zigbee2mqtt:info  2020-04-21 20:41:42: MQTT publish: topic 'zigbee2mqtt/XiaomiContactSensorTerasse/contact', payload 'true'

Thing:

Thing topic XiaomiContactSensorTerasse "XiaomiContactSensorTerasse"
    {   
        Channels:
            Type contact : contact "Contact" [ stateTopic = "zigbee2mqtt/XiaomiContactSensorTerasse/contact", on = "false", off = "true" ]
            Type number : voltage "voltage" [ stateTopic = "zigbee2mqtt/XiaomiContactSensorTerasse/voltage" ]     
            Type number : battery "battery" [ stateTopic = "zigbee2mqtt/XiaomiContactSensorTerasse/battery" ]     
            Type number : linkquality "linkquality" [ stateTopic = "zigbee2mqtt/XiaomiContactSensorTerasse/linkquality" ]
    }

These are my items:

Contact XiaomiContactSensorTerasse_status      "Terasse [%s]"                    (gAll) {channel="mqtt:topic:broker:XiaomiContactSensorTerasse:contact"}
Number XiaomiContactSensorTerasse_voltage    "Sensor Volt [%d mV]"               (gAll) {channel="mqtt:topic:broker:XiaomiContactSensorTerasse:voltage"}
Number XiaomiContactSensorTerasse_battery    "Sensor bat [%.1f %%]"  <battery>   (gAll) {channel="mqtt:topic:broker:XiaomiContactSensorTerasse:battery"}
Number XiaomiContactSensorTerasse_linkquality "Sensor linkquality [%d]"          (gAll) {channel="mqtt:topic:broker:XiaomiContactSensorTerasse:linkquality"}

EDIT: After a reboot of the rpi it works now

I am now trying to add my Osram bulb (https://www.zigbee2mqtt.io/devices/AC03641.html) but I am not sure where I messed up this time:

This is the zigbee2mqtt log:

Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: Coordinator firmware version: '{"type":"zStack3x0","meta":{"transportrev":2,"product":1,"majorrel":2,"minorrel":7,"maintrel":1,"revision":20191106}}'
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: Currently 3 devices are joined:
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: XiaomiTestSwitch (0x00158d0002562ee3): WXKG01LM - Xiaomi MiJia wireless switch (EndDevice)
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: XiaomiContactSensorTerasse (0x00158d0002c62998): MCCGQ01LM - Xiaomi MiJia door & window contact sensor (EndDevice)
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: OsramLightifyTest (0x7cb03eaa0a03b520): AC03641 - OSRAM LIGHTIFY LED Classic A60 clear (Router)
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:warn  2020-04-22 14:26:34: `permit_join` set to  `true` in configuration.yaml.
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:warn  2020-04-22 14:26:34: Allowing new devices to join.
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:warn  2020-04-22 14:26:34: Set `permit_join` to `false` once you joined all devices.
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: Zigbee: allowing new devices to join.
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: Connecting to MQTT server at mqtt://localhost
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: Connected to MQTT server
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload 'online'
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: MQTT publish: topic 'zigbee2mqtt/XiaomiTestSwitch/battery', payload '100'
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: MQTT publish: topic 'zigbee2mqtt/XiaomiContactSensorTerasse/battery', payload '80'
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: MQTT publish: topic 'zigbee2mqtt/OsramLightifyTest/update_available', payload 'false'
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: MQTT publish: topic 'zigbee2mqtt/XiaomiTestSwitch/voltage', payload '3082'
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: MQTT publish: topic 'zigbee2mqtt/XiaomiContactSensorTerasse/voltage', payload '2965'
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: MQTT publish: topic 'zigbee2mqtt/XiaomiTestSwitch/linkquality', payload '15'
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: MQTT publish: topic 'zigbee2mqtt/XiaomiContactSensorTerasse/linkquality', payload '93'
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: MQTT publish: topic 'zigbee2mqtt/XiaomiContactSensorTerasse/contact', payload 'true'
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info  2020-04-22 14:26:34: MQTT publish: topic 'zigbee2mqtt/bridge/config', payload '{"version":"1.12.2","commit":"911cd58","coordinator":{"type":"zStack3x0","meta":{"transportrev":2,"product":1,"majorrel":2,"minorrel":7,"maintrel":1,"revision":20191106}},"log_level":"info","permit_join":true}'

This is my Thing:

Thing topic Leselicht "Leselicht" 
    {
        Channels:
            Type switch : power "Power Switch" [ stateTopic = "zigbee2mqtt/OsramLightifyTest/state", commandTopic = "zigbee2mqtt/OsramLightifyTest/set", on = "ON", off = "OFF" ]
            Type dimmer : dimmer "Dimmer" [ stateTopic = "zigbee2mqtt/OsramLightifyTest/brightness", commandTopic = "zigbee2mqtt/OsramLightifyTest/set/brightness", min = 1, max = 255, step = 1 ]
            Type number : linkquality "linkquality" [ stateTopic = "zigbee2mqtt/OsramLightifyTest/linkquality" ]

    }

This are my items:

Switch OsramLightifyTest_Switch "Leselicht Switch"  { channel="mqtt:topic:broker:OsramLightifyTest:switch" }
Dimmer OsramLightifyTest_Dimmer "Leselicht Dimmer" { channel="mqtt:topic:broker:OsramLightifyTest:dimmer", autoupdate="false" }
Number OsramLightifyTest_linkquality "Leselicht linkquality [%d]" {channel="mqtt:topic:broker:OsramLightifyTest:linkquality"}

The weird thing is that the Osram Bulb only shows up once in MQTT Publish:

Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info 2020-04-22 14:26:34: MQTT publish: topic 'zigbee2mqtt/OsramLightifyTest/update_available', payload 'false''

Unfortunately at least for color there is only the XY option to send as attribute. I don’t know if there is another channel for brightness as an atttribute, but for the color I know it for sure (there is a long thread on githung where they discuss this - can’t find it right now).
Therefore I have set in the config to accept both json and attribute. For color items (this includes the brightness in my case), I still send the commands in json format. For receiving stuff, I let the broker listen to the attribute channels only

Type dimmer : dimmer "Dimmer" [ stateTopic = "zigbee2mqtt/OsramLightifyTest/brightness", commandTopic = "zigbee2mqtt/OsramLightifyTest/set/brightness", min = 1, max = 255, step = 1 ]

use this one:

Type dimmer : dimmer "Dimmer" [ stateTopic = "zigbee2mqtt/OsramLightifyTest/brightness", commandTopic = "zigbee2mqtt/OsramLightifyTest/set/brightness_percent", min = 0, max = 100, step = 1 ]

for the information commit:
Apr 22 14:26:34 openhab npm[18328]: zigbee2mqtt:info 2020-04-22 14:26:34: MQTT publish: topic ‘zigbee2mqtt/OsramLightifyTest/update_available’, payload ‘false’’

that’s correct, if it’s ‘true’ you’ve a old firmware on your Zigebee-Device. It is ‘false’ you running the newest firmware.

Thank you
I just changed it as you advised. Still it does not work right now.

That I am aware of but what I meant is that there is not a single other entry of the OsramLightifyTest device in the logs.

No linkquality or any other state reported.
Any idea why ?

EDIT: I now get the linkquality, state and brightness reported. Everything works now

Hi guys,

I just paired a 9290012573A - Philips Hue white and color ambiance E26/E27/E14 bulb with zigbee2mqtt
but this error shows:

Apr 24 01:28:02 openhab npm[3839]: zigbee2mqtt:error 2020-04-24 01:28:02: Failed to setup reporting for '0x001788010278badc' - Error: ConfigureReporting 0x001788010278badc/11 genOnOff([{"attribute":"onOff","minimumReportInterval":0,"maximumReportInterval":300,"reportableChange":0}], {"timeout":6000,"manufacturerCode":null,"disableDefaultResponse":true}) failed (Error: Timeout - 47266 - 11 - 2 - 6 - 7 after 6000ms)
Apr 24 01:28:02 openhab npm[3839]:     at Endpoint.<anonymous> (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:326:23)
Apr 24 01:28:02 openhab npm[3839]:     at Generator.throw (<anonymous>)
Apr 24 01:28:02 openhab npm[3839]:     at rejected (/opt/zigbee2mqtt/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:6:65)

Did you guys ever encounter an error like this, what do I need to do in such a case ?

I can control the light via mqtt but I do not get any reports of link quality etc.