This is currently not possible, but there is an issue open to add this for Tradfri: https://github.com/Koenkk/zigbee2mqtt/issues/151
Here also my Zigbee2mqtt working on Hass.IO and got my Philips Ledstrip connected, now I got my Philips Hue Dimmer Switch Paired. Any thoughts on this how to add this as a sensor or switch within Hass.IO?
Hi Guys!
Foremost, this is an incredible project and it is perfectly working with Xiaomi and HUE devices! Congratulations!
Now Im trying to improve my setup by creating scenes on HA with HUE lights, but something doesnāt seem correct since when triggered the scene only turn the lights on but doesnt change collors or set the bright level.
Anyone had success with this kind of setup?
Edit: Ive noticed that trying to command more than one light at time crashes the Z2M at the point that I have to restart the raspberry. Actually Ive created a Light Group (https://www.home-assistant.io/components/light.group/). Controlling lights individually isnt a problem, but grouped Z2M crashes every time.
I think thats related with MQTT payload format sent by HA while lights are in group is different when sent to a single light. Simple commands as turn on and off doesnāt trigger this issue, only changing brightness or collors.
Thanks in advance!
Troitino
Trying to add a new device - AliExpress sourced WF321 single colour LED strip controller (and WF323 for RGB).
But neither of them appear to even connect to the network - followed pairing instructions, status light on the device seems to light up but no dice. Also tried pushing buttons to keep it awake like some of the Xiaomi devices require. Nothing showing in debug log eitherā¦ thoughts on where to from here?
Googled version of the manual: https://www.kiwilighting.com/user-guide/KW-WF320-ZigBee/KW-WF321.pdf
Further to this, just tested by trying to get a Hue Dimmer Switch to pair, and I get the expected āWARN Device with modelID āRWL021ā is not supported.ā Error, so suspecting itās an issue with these AliExpress devices.
Hello everyone,
I think Iāve managed to install all the different components. Big shout out to @scottdarby for taking care of the dongle
So far I do see MQTT messages comming into Mosquitto server
zigbee2mqtt/0x00158d000252b7a5 {"click":"single"}
zigbee2mqtt/0x00158d000252b7a5 {"click":"single"}
zigbee2mqtt/0x00158d000252b7a5 {"click":"single"}
But I know one can display de device in Home Assistant. Unfortuntally I donāt see any entity in my entity list in HA and this feels a bit weird.
Could somebody provide some guidance on how to represent the paired device in HA?
Thanks a million and sorry if Iām overlooking something very obvious
You need to add them to your config file,
this page should help get you started out
Thanks @Cee,
I missed that one!! Not sure how by I definitely missed it. I would swear I followed all the nested steps but nowhere did I see I reference to that chapter. Will take a look and reach back in case it didnāt work, but Iām confident it will work
One question, why would someone want to manually setup the different device profiles and not have the system provision the devices through autodiscovery?
Many thanks again!
I personally setup all mine manually, then if they drop out, they are just unavailable, or if you restart, and something isnāt working, its easier to see that is has failed, rather trying to look for something that isnāt there. Well, thatās my view anyway, donāt take it as anything more than that. I am still very new to HA as well.
What is the use of FRIENDLY NAME in
state_topic: "zigbee2mqtt/<FRIENDLY_NAME>"
in the configuration you pointed me to? Is it mqtt topic? What do you use in your case, or how do you structure this data?
Thanks
Come on guys! Read the wiki. Yes, you could give the zigbee device a friendly name.
If I have been able to come this far by myself, it is not because I have not read the wiki, believe me.
from this page in the wiki,
I donāt have mine setup and running at the moment, as the hive devices I bought it for arenāt supported, and are beyond my scope of adding them in, and the person that was working on them seemās to have gone quiet, but an example from the page above,
devices:
'0x00158d0001d82999':
friendly_name: 'my_occupancy_sensor'
retain: true
occupancy_timeout: 20
qos: 1
But if you havenāt set up a friendly name then,
friendly_name: Used in the MQTT topic of a device. By default this is the device ID (e.g. 0x00128d0001d9e1d2).
Hope this helps out again.
It does! I now only seem to have a conflict with mqtt, but will investigate into it later on when Iām back at my desk. Thanks @Cee
Check entity_registry.yaml on double entries.
Thanks @kitus,
Just received the latest batch if anyoneās interested in a pre-flashed device PM me!
I love when one accomplishes something relevant. Iāve now just managed to switch on and off a Tradfri bulb using a xiaomi button, with no gateways in between!!!
I feel however that there is some room for improvement. I hope you guys can help me figure out a couple of things:
- I just paired the bulb, and configuration.yaml (zigbee2mqtt) did already display the new device with the friendly unfriendly name. I then edited the name but the entity in HA showed of course the previous unfriendly name. Do I really need to restart HA everytime I add a new device?
- When the system came up, it showed the Xiaomi button with state unknown and the tradfri light as off. Neither of both states was right because as soon as I clicked on the button, the light went off. This leads me to the main question: How do you guys harden your configuration (not only for this add-on but generally speaking) so that when you reboot your system, you reach a known state before accepting newer updates from the world?
Many thanks and congratulations to @Koenkk and the team. This is AWESOME!!
Well, it seems I was lucky enough with the two first devices I tried to add to Zigbee2mqtt because, as reported just above, it worked very well. However, Iāve decided to add two additional devices and it seems they donāt work:
-
Xiaomi PIR: It seems the system sees it during pairing, and does embrace it a little bit different than with the Xiaomi switch (thatās at least my humble interpretation if I compare the log they both generated during the pairing process. And zigbee2mqtt is not fully recognizing the PIR based on what the log suggests:
2018-7-29 02:09:14 INFO Currently 4 devices are joined:
2018-7-29 02:09:14 INFO pulsador_xiaomi_test (0x00158d000252b7a5): WXKG01LM - Xiaomi MiJia wireless switch (EndDevice)
2018-7-29 02:09:14 INFO kitchen_bulb (0x000b57fffedc1058): LED1623G12 - IKEA TRADFRI LED bulb E27 1000 lumen, dimmable, opal white (Router)
2018-7-29 02:09:14 INFO tradfri.bulb-corridor (0x90fd9ffffe4bf6fd): LED1545G12 - IKEA TRADFRI LED bulb E26/E27 980 lumen, dimmable, white spectrum, opal white (Router)
2018-7-29 02:09:14 INFO xiaomi.movement-kitchen (0x00158d000251f830): unkown - undefined unknown (EndDevice)
And, regarless what I try, the PIR detector will simply not appear on the entity view in States (Entities) view, whereas the other 3 do appear in there
-
The second tradfri bulb that I just added to the system, canāt seem to be commanded by Home Assistant (it does not react when I turn it on or off in HA interface. If I review the log I see warning messages:
2018-7-29 02:12:25 WARN Cannot handle MQTT message with topic āzigbee2mqtt/tradfri.bulb-corridor/setā and message ā{āstateā: āONā}ā
2018-7-29 02:12:31 WARN Cannot handle MQTT message with topic āzigbee2mqtt/tradfri.bulb-corridor/setā and message ā{āstateā: āONā}ā
2018-7-29 02:13:17 WARN Cannot handle MQTT message with topic āzigbee2mqtt/tradfri.bulb-corridor/setā and message ā{āstateā: āONā}ā
On this note, Iāve seen there is a PR created for addressing a similar case TRADFRI bulb E27 opal 1000lm Ā· Issue #21 Ā· Koenkk/zigbee2mqtt Ā· GitHub with a very similar IKEA bulb, but it looks like it was solved in May. Does anybody have an āIKEA TRADFRI LED bulb E26/E27 980 lumenā and is successfully using it with Z2MQTT?
Iām also attaching the full log I see in the add-on in case it helped understand what is going on:
>[Info] Configuration file found. Will overwrite configurable fields with values from add-on configuration
[Info] Configuration written to /share/zigbee2mqtt/configuration.yaml
[2018-07-29T02:08:58.721Z] PM2 log: Launching in no daemon mode
[2018-07-29T02:08:59.639Z] PM2 log: Starting execution sequence in -fork mode- for app name:npm id:0
[2018-07-29T02:08:59.746Z] PM2 log: App name:npm id:0 online
> [email protected] start /app
> node index.js
2018-7-29 02:09:09 INFO Starting zigbee2mqtt version 0.1.1 (commit #738c31c)
2018-7-29 02:09:09 INFO Starting zigbee-shepherd
2018-7-29 02:09:14 INFO zigbee-shepherd started
2018-7-29 02:09:14 INFO Currently 4 devices are joined:
2018-7-29 02:09:14 INFO pulsador_xiaomi_test (0x00158d000252b7a5): WXKG01LM - Xiaomi MiJia wireless switch (EndDevice)
2018-7-29 02:09:14 INFO kitchen_bulb (0x000b57fffedc1058): LED1623G12 - IKEA TRADFRI LED bulb E27 1000 lumen, dimmable, opal white (Router)
2018-7-29 02:09:14 INFO tradfri.bulb-corridor (0x90fd9ffffe4bf6fd): LED1545G12 - IKEA TRADFRI LED bulb E26/E27 980 lumen, dimmable, white spectrum, opal white (Router)
**2018-7-29 02:09:14 INFO xiaomi.movement-kitchen (0x00158d000251f830): unkown - undefined unknown (EndDevice)**
2018-7-29 02:09:14 WARN `permit_join` set to `true` in configuration.yaml.
2018-7-29 02:09:14 WARN Allowing new devices to join.
2018-7-29 02:09:14 WARN Set `permit_join` to `false` once you joined all devices.
2018-7-29 02:09:14 INFO Zigbee: allowing new devices to join.
2018-7-29 02:09:14 INFO Connecting to MQTT server at mqtt://core-mosquitto:1883
2018-7-29 02:09:14 INFO zigbee-shepherd ready
2018-7-29 02:09:14 INFO Connected to MQTT server
2018-7-29 02:09:14 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/state', payload: 'online'
2018-7-29 02:09:14 INFO MQTT publish, topic: 'homeassistant/sensor/0x00158d000252b7a5/click/config', payload: '{"icon":"mdi:toggle-switch","value_template":"{{ value_json.click }}","json_attributes":["battery","voltage","action","duration"],"state_topic":"zigbee2mqtt/pulsador_xiaomi_test","availability_topic":"zigbee2mqtt/bridge/state","name":"pulsador_xiaomi_test"}'
2018-7-29 02:09:14 INFO MQTT publish, topic: 'homeassistant/light/0x000b57fffedc1058/light/config', payload: '{"brightness":true,"platform":"mqtt_json","command_topic":"zigbee2mqtt/kitchen_bulb/set","state_topic":"zigbee2mqtt/kitchen_bulb","availability_topic":"zigbee2mqtt/bridge/state","name":"kitchen_bulb"}'
2018-7-29 02:09:14 INFO MQTT publish, topic: 'homeassistant/light/0x90fd9ffffe4bf6fd/light/config', payload: '{"brightness":true,"color_temp":true,"platform":"mqtt_json","command_topic":"zigbee2mqtt/tradfri.bulb-corridor/set","state_topic":"zigbee2mqtt/tradfri.bulb-corridor","availability_topic":"zigbee2mqtt/bridge/state","name":"tradfri.bulb-corridor"}'
spinlock: false []
spinlock: true []
2018-7-29 02:09:21 INFO Device incoming...
**2018-7-29 02:09:21 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"device incoming"}'**
** 2018-7-29 02:09:26 INFO Device incoming...**
2018-7-29 02:09:26 INFO MQTT publish, topic: 'zigbee2mqtt/bridge/log', payload: '{"type":"pairing","message":"device incoming"}'
2018-7-29 02:10:54 INFO Zigbee publish to '0x000b57fffedc1058', genOnOff - on - {} - null
2018-7-29 02:10:54 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"ON"}'
2018-7-29 02:10:55 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"ON"}'
2018-7-29 02:10:57 INFO Zigbee publish to '0x000b57fffedc1058', genOnOff - off - {} - null
2018-7-29 02:10:58 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"OFF"}'
2018-7-29 02:10:58 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"OFF"}'
2018-7-29 02:10:59 INFO Zigbee publish to '0x000b57fffedc1058', genOnOff - on - {} - null
2018-7-29 02:10:59 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"ON"}'
2018-7-29 02:11:00 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"ON"}'
2018-7-29 02:11:00 INFO Zigbee publish to '0x000b57fffedc1058', genOnOff - off - {} - null
2018-7-29 02:11:00 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"OFF"}'
2018-7-29 02:11:01 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"OFF"}'
**2018-7-29 02:11:38 WARN Cannot handle MQTT message with topic 'zigbee2mqtt/tradfri.bulb-corridor/set' and message '{"state": "ON"}'**
2018-7-29 02:11:47 WARN Cannot handle MQTT message with topic 'zigbee2mqtt/tradfri.bulb-corridor/set' and message '{"state": "ON"}'
2018-7-29 02:11:50 INFO Zigbee publish to '0x000b57fffedc1058', genOnOff - on - {} - null
2018-7-29 02:11:50 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"ON"}'
2018-7-29 02:11:51 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"ON"}'
2018-7-29 02:11:52 INFO Zigbee publish to '0x000b57fffedc1058', genOnOff - off - {} - null
2018-7-29 02:11:52 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"OFF"}'
2018-7-29 02:11:52 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"OFF"}'
spinlock: false []
device already in network
2018-7-29 02:12:25 WARN Cannot handle MQTT message with topic 'zigbee2mqtt/tradfri.bulb-corridor/set' and message '{"state": "ON"}'
2018-7-29 02:12:31 WARN Cannot handle MQTT message with topic 'zigbee2mqtt/tradfri.bulb-corridor/set' and message '{"state": "ON"}'
2018-7-29 02:13:17 WARN Cannot handle MQTT message with topic 'zigbee2mqtt/tradfri.bulb-corridor/set' and message '{"state": "ON"}'
2018-7-29 02:13:44 INFO Zigbee publish to '0x000b57fffedc1058', genOnOff - on - {} - null
2018-7-29 02:13:44 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"ON"}'
2018-7-29 02:13:45 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"ON"}'
2018-7-29 02:13:47 INFO Zigbee publish to '0x000b57fffedc1058', genOnOff - off - {} - null
2018-7-29 02:13:47 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"OFF"}'
2018-7-29 02:13:48 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"OFF"}'
2018-7-29 02:16:37 INFO MQTT publish, topic: 'zigbee2mqtt/kitchen_bulb', payload: '{"state":"OFF"}'
Does anybody have any idea what may be going on with the PIR detector and the second IKEA bulb? The fact that I managed to pair and command the first IKEA bulb almost effortlessly, and now the second bulb is not propperly working is a bit weird.
-
I see these messages poping up every now and then
2018-7-29 10:56:34 INFO MQTT publish, topic: āzigbee2mqtt/kitchen_bulbā, payload: ā{āstateā:āOFFā}ā
2018-7-29 10:56:48 INFO Device incomingā¦
2018-7-29 10:56:48 INFO MQTT publish, topic: āzigbee2mqtt/bridge/logā, payload: ā{ātypeā:āpairingā,āmessageā:ādevice incomingā}ā
2018-7-29 10:59:35 INFO MQTT publish, topic: āzigbee2mqtt/pulsador_xiaomi_testā, payload: ā{āclickā:āsingleā}ābut I donāt really know what they mean. Any ideas?
Thanks in advance everyone,
I can pick up the battery level through the gateway, are you saying it doesnāt come through for Zigbee2mqtt?
kitchen_window_battery: value_template: '{{ states.binary_sensor.door_window_sensor_158d0001a4e17b.attributes.battery_level }}'
Just ordered my parts from AliExpress, and definitely looking forward to removing the Hub.
Thanks @Koenkk and team!!
Yeah so the switches show the battery level but the door sensors (binary sensors) and also the motion sensor (just added this weekend) dont show hte battery levels within HA.
They do present over MQTT just not in HA:
Received message on zigbee2mqtt/xds1bedroom: b'{"battery":"100.00","voltage":3035,"contact":true}'
Door and Motion:
Sensors:
This will display a seperate sensor for the battery within HA for the Sensor:
- platform: template
sensors:
xiaomi_rb1_battery_sensor:
friendly_name: 'Xiaomi Round Button 1 - Battery'
value_template: '{{ states.sensor.xrb1bedroom.attributes.battery }}'
unit_of_measurement: '%'
But the same wont work for the binary sensors:
- platform: template
sensors:
xiaomi_ds1_battery_sensor:
friendly_name: 'Xiaomi Door Sensor 1 - Battery'
value_template: '{{ states.binary_sensor.xds1bedroom.attributes.battery }}'
unit_of_measurement: '%'
Yes, I am seeing the same.
I have a Xioami human presence and illuminance sensor (giving a HA binary sensor and a HA sensor) and a Xiaomi leak detection sensor (giving a HA binary sensor).
Both devices publish battery level and voltage to MQTT (although in an inconsistent fashion - not usually for a while after a restart), but only the HA sensor shows them.