Installing zigbee2mqtt

Having said that, I just noticed this Out of memory when Zigbee2mqtt starts - I’ll be keeping an eye on it!

Is this documentation the best to follow?

After pairing is it then possible to rename the name of a light, sensor etc. before they are discovered by HA so that the names are equal to the ones already used in HA when connected through hue bridge and so on?
Must MQTT discovery be set to true in HA?

1 Like

All the docs are linked off here https://www.zigbee2mqtt.io/

Home assistant integration has a link there too.

Thanks :slight_smile:
Still I´m not quite sure whether it is possible to rename the entities BEFORE they are discovered by HA. I would like to have the same names as now so that I don´t have to change the automations.

I don’t think so, but you can change them in the ui once discovered.

There is a way. In theory.
I’ve not done this, however I believe it should work.

I Think the procedure would be something like such:

  • Disable Home Assistant integration (MQTT discovery) by adding :
homeassistant: false

To Z2M’s configuration.yaml. So devices do not get auto added.

  • Then add/pair all your zigbee devices to Z2M.

  • Then once you have added/paired stop Z2M to edit configuration.yaml. You well need to follow the steps in this post: Zigbee2mqtt: show the networkmap in home assistant To rename your devices.

  • Then once you have all your devices renamed edit configuration.yaml with:

homeassistant: true

And start up Z2M.

I Think it should pick up and add then renamed devices at that point.
However this is theory as I have not tested.

Hope it helps.

I know :slight_smile:

I will have this in mind when beginning to pair.
What is normal? Always having HA integration in Z2M set to true and discovery to true in HA? Or better disable both and only enable them when adding new devices? Just to be sure nothing accidently gets added.

Yes. On is normal .

I had a chance to rename a few devices on my system. However It seems as my theory is a bit off. I don’t believe it is necessary to disable Hass Discovery. Or anything at all.

Heck, I did’t even restart Hass and noticed the changes . So it seems just editing the Z2M device list and restarting z2m is enough.

Hope it helps.

thanks :slight_smile:

so there should be no reason of using a separate pi for zigbee2mqtt?

Where can I find this device list of paired devices?

zigbee2mqtt’s configuration.yaml

:+1: okay thanks

I have now tried to add a Philips Hue Bulb and it is shown in the Z2M conf.yaml.
I then tried to change the friendly name like here.
devices:
‘0x0017880100be4261’:
friendly_name: light.test
retain: false

In Home Assistant the entity ID shows up strange though.
“light.0x0017880100be4261_light”
Friendly name in HA says “light.test_light”

I thought that HA would take over the friendly name of Z2M conf.yaml. as entity id.

After pairing a Philips Hue bulb I have noticed that there is no transition time when changing brightness or color with a Hue bulb from HA. It changes instantly and doesn´t look nice.
With the Philips Hue bridge there is a soft transition between brightness and color changes.
Is this not possible with Zigbee2mqtt?

Within the directory structure of zigbee2mqtt there is a database, for your network of known devices. That files name is “database.db” . That’s the master list.

It should. Not sure whats happening there.
This is a snip from my Devices.yaml:

'0x7ce524000011af6a':
  friendly_name: 'GEbulb_Hall_celing'
  retain: false
'0x7ce5240000125b57':
  friendly_name: 'Drafting_lamp'
  retain: false
'0x841826000007878a':
  friendly_name: 'Bed_lamp(RGBW)'
  retain: false

Maybe you tried to rename from within Hass at a point and it’s remembering that change?

I’m not sure.
This is how I transition one lamp I have. it’s not a Hue bulb though. I don’t think it matters.:

- id: tvlamp-to-40
  alias: TV lamp to 40ish%
  initial_state: True
  hide_entity: False
  trigger:
    platform: time
    at: '22:00:00'
  action:
    data:
      brightness: 111
      transition: 4
      color_temp: 350
    service: light.turn_on
    entity_id:  light.0xf0d1b80000032faa_light

This has a nice transition form state to state.

Hope its of help.

Within the directory structure of zigbee2mqtt there is a database, for your network of known devices. That files name is “database.db” . That’s the master list.
But you change the names in Z2M configuration.yaml?

It should. Not sure whats happening there.
This is a snip from my Devices.yaml:
Is your entity in HA like this then: light.GEbulb_Hall_celing?
I don´t think I ever renamed this entity from within Hass so it is strange.
update: Strangely when turning the light on or off from the frontend it has a soft transition.

I’m not sure.
This is how I transition one lamp I have. it’s not a Hue bulb though. I don’t think it matters.:
The transition I think of is when you change state from the frontend. With a bulb connected through the Hue bridge I get a soft transition when chaning brightness or color.
In the log it says transition time=0 but Wonder if this a general setting that can be changed

7/14/2019, 10:22:20 AM - info: Zigbee publish to device ‘0x0017880100be4261’, genLevelCtrl - moveToLevelWithOnOff - {“level”:7,“transtime”:0} - {“manufSpec”:0,“disDefaultRsp”:0} - null

7/14/2019, 10:22:17 AM - info: Zigbee publish to device ‘0x0017880100be4261’, lightingColorCtrl - moveToColor - {“transtime”:0,“colorx”:29098,“colory”:33882} - {“manufSpec”:0,“disDefaultRsp”:0} - null

In configuration.yaml I have: devices: devices.yaml
All the renaming is done in the file: devices.yaml

It looks like this in Hass.
Capture
The drafting and bed lamp I renamed again from with in Hass.
Capture2

I don’t know enough about Z2M device configuration to offer help. I would think there would be a place to override default device configuration. However I’m unsure.

In configuration.yaml I have: devices: devices.yaml
** All the renaming is done in the file: devices.yaml**

I can´t find a file called devices.yaml in the same folder as my configuration.yaml but devices are mentioned in configuration.yaml. Is this what you mean by devices.yaml?

homeassistant: true
permit_join: true
mqtt:
  base_topic: zigbee2mqtt
  server: 'mqtt://192.168.1.13:1883'
  user: xxx
  password: xxx
serial:
  port: /dev/ttyACM0
devices:
  '0x0017880100be4261':
    friendly_name: lamp
    retain: false
  '0x00158d0002af6b02':
    friendly_name: '0x00158d0002af6b02'
    retain: false

It seems that it is not possible to change the entity id BEFORE it is imported into Hass. I thought the friendly name in Z2M config.yaml would be used as entity id in Hass but it seems not to be the case.