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

For the missing entities, which value do you have for "disabled_by":?
If it is not null than try it out.
Should look like this:

"disabled_by": null,

Try it with only one entity first and remember the value it had before (set it to the old value if it did not help).

1 Like

I have some progress :slight_smile: All of the missing entities were set to "disabled_by": "user", so I changed them to null and it helped with entities from the single button switch. The right button of the double switch didn’t come back though.

Don’t change it to none, change it to null like I mentioned above.

Yes, sorry, misstype. I changed it to null
But it didn’t help with the stubborn right button :-/

hm ok, strange. I also run out of ideas, sry.

My last idea: search your core.entity_registry file for duplicated entities. So the same as before but with _2 as ending. New entities get added at the end of the file/list.

You know what, after a restart I noticed the right button switch is no longer in the core.entity_registry. I made some changes and decided to reboot again before I try to remove the switch and add it back. But after the reboot the right button switch came back… so weird but it’s fixed now :slight_smile: Thank you so much @h4nc!

1 Like

sorry… didn´t read the config well. removed post.

I have changed the Anonimous value from ‘false’ to ‘true’ in the mosquitto configuration and now the sensors appear as entities, but they appear as unavailable and I cannot use them and the coordinator value appears as ‘unknown’.

Does somebody knows why it could be?

It seems HA can’t access the mqtt broker. If you use the mosquitto add-on, the Anonimous value needs to be ‘false’ and you need to create a user for the mqtt broker.

I have changed anonymous: false
I have created a new user in HA => “mqtteducasa” and now the following appears in the mqtt broker log

 Opening ipv4 listen socket on port 1883.
1581235063: Opening ipv6 listen socket on port 1883.
1581235063: Opening websockets listen socket on port 1884.
1581235063: Opening ipv4 listen socket on port 8883.
1581235063: Opening ipv6 listen socket on port 8883.
1581235063: Opening websockets listen socket on port 8884.
1581235063: Warning: Mosquitto should not be run as root/administrator.
1581235064: New connection from 172.30.32.1 on port 1883.
[INFO] found mqtteducasa on local database
1581235065: New client connected from 172.30.32.1 as mqttjs_63ef271a (p2, c1, k60, u'mqtteducasa').
1581235067: New connection from 172.30.32.1 on port 1883.
[INFO] found educasa on Home Assistant
1581235070: New client connected from 172.30.32.1 as b1980552dc374092acbab85302b4ff56 (p2, c1, k15, u'educasa').
1581235300: Socket error on client mqttjs_63ef271a, disconnecting.
1581235316: New connection from 172.30.32.1 on port 1883.
1581235316: New client connected from 172.30.32.1 as mqttjs_509b87db (p2, c1, k60, u'mqtteducasa').
1581235377: Socket error on client mqttjs_509b87db, disconnecting.
1581235392: New connection from 172.30.32.1 on port 1883.
[INFO] found mqtteducasa on local database
1581235393: New client connected from 172.30.32.1 as mqttjs_d9718dff (p2, c1, k60, u'mqtteducasa').
1581235444: New connection from 192.168.1.111 on port 1883.
1581235444: Socket error on client <unknown>, disconnecting.
1581235449: New connection from 192.168.1.12 on port 1883.
1581235449: New client connected from 192.168.1.12 as f9c094f9e86c4b13917e972ab39970b8 (p2, c1, k60, u'mqtteducasa').
1581235540: Client f9c094f9e86c4b13917e972ab39970b8 disconnected.
1581235601: New connection from 192.168.1.12 on port 1883.
1581235601: New client connected from 192.168.1.12 as 6d77d3c2143247a48617c61b27db1646 (p2, c1, k60, u'mqtteducasa').
1581235603: Socket error on client mqttjs_d9718dff, disconnecting.
1581235619: New connection from 172.30.32.1 on port 1883.
1581235619: New client connected from 172.30.32.1 as mqttjs_6a1a7e74 (p2, c1, k60, u'mqtteducasa').
1581236013: Client 6d77d3c2143247a48617c61b27db1646 disconnected.

I still see the devices and their operation in the zigbee2mqtt addon log, but the entities in HA do not appear either :man_facepalming:

Zigbee2MQTT use for server:

  server: 'mqtt://core-mosquitto'

I had very strange non-random issues when I used something else. It is working flawlessly for a couple of months now.

Furthermore,

zigbee2mqtt has for server:

"server": "mqtt://ipraspberry",

and zigbee2mqtt connection log states:

zigbee2mqtt:info  2020-01-28 22:36:28: Connecting to MQTT server at mqtt://iddelaraspberry

Is there not a typo somewhere?

Do install the Zigbee2mqttAssistant add-on. A Web GUI for the Zigbee2Mqtt software. It helped me enormously.
See https://github.com/yllibed/Zigbee2MqttAssistant#installation

Do you have the Mosquitto broker integration?
Did you check/enable this setting within the mosquitto broker?
image

HA -> Configuration -> Integrations -> Mosquitto broker -> Navigate to upper right hand corner and click on image

Hi rlems! Thanks for your answer.
On the zigbee2mqtt server I tried with:
‘mqtt://homeassistant’
‘mqtt://192.16…’
‘mqtt://core-mosquitto’

With all of them the addon apparently connects to mqtt broker, but then in no case do the devices appear as an entity in HA.
The typo is mine by hiding the raspberry’s ip in the post, sorry.

Yes, I have the zigbee2mqttAssistant addon installed and there is the coordinator and the two devices that I have activated right now, and the connection between them. But I don’t get it to work.

The mosquitto broker integration is correct.

Thanks

Are you using MQTT autodiscover? I long ago decided to take the manual route and I’m very happy with it, though it requieres expanding the configuration.yaml file a lot. How do you plan to get HA to deal with the Mqtt devices?

Yes, I am using mosquitto autodiscover, and also, I have manually zigbee devices in the configuration.yaml file. I don’t know if both are compatible …

binary_sensor:
  - platform: "mqtt"
    name: sensor_movimiento_garaje
    state_topic: "zigbee2mqtt/0x00158d00032bd33c"
    availability_topic: "zigbee2mqtt/bridge/state"
    payload_on: true
    payload_off: false
    value_template: "{{ value_json.occupancy }}"
    device_class: "motion"

  - platform: "mqtt"
    name: sensor_entrada_principal
    state_topic: "zigbee2mqtt/0x00158d0003f1cde6"
    availability_topic: "zigbee2mqtt/bridge/state"
    payload_on: false
    payload_off: true
    value_template: "{{ value_json.contact }}"
    device_class: "door"

But neither do the devices appear in the entities tab

I think the problem may come, as Francis pointed out before, in the connection between HA and mosquitto, but I dont know what I should change.

EDIT:

Well, I removed the mqtt integration, and also commented on the mqtt code in the configuration.yaml file. Now you have re-created the mqtt integration from the integrations panel and the entities are already appearing, but:

1.- The entities appear because they have been added manually in the configuration.yaml file, if I comment that part of the code, HA still does not detect the zigbee devices.

2.- Zigbee2mqtt reads the devices and their changes, that are added in the devices.yaml file, not the devices added manually in the configuration.yaml file.

3.- Mqtt.fx also reads the devices and their changes, added in the devices.yaml file, does not read the devices added manually in the configuration.yaml file.

EDIT2:

Today, finally, after more than three months, zigbee devices work on my HA. :sweat_smile: :star_struck:
I eliminated the mosquitto integration, once again, and this time, HomeAssistant detected that there were mosquitto devices pending to integrate, I made the automatic integration and now if the zigbee devices that I had paired appear as entities.

@aidbish @nickrout @wixoff can anyone confirm the flashing or pairing process? I can’t seem to get it to be interviewed.

/edit Nevermind… found below the 2530_2591 firmware post and it worked like a charm… thanks!

Can you please share examples of database.db and devices.yaml created by hass.io add-on?

I’m trying to migrate a Zigbee2MQTT installation in an hassbian system to the hass.io add-on and noticed that file contents’ structure doesn’t seem to be 100% the same in all cases (enough to check configuration.yaml differences).

Has anyone did this before?

Thanks in advance.

Hi.
Sorry, bur from “configurator” web interface I cannot access the zigbee2mqtt folder.
I can do it tonight at home.

1 Like

Zigbee2MQTT configuration.yaml is YAML and add-on is JSON, just not sure if this is only applicable to configuration and not other files? (devices.yaml, database.db, etc).

Can anyone provide real life examples of all Zigbee2MQTT files when using the add-on?

Thanks in advance.

database.db:

{"id":5,"type":"EndDevice","ieeeAddr":"0x000b57fffe2b4519","nwkAddr":45128,"manufId":4476,"manufName":"IKEA of Sweden","powerSource":"Battery","modelId":"TRADFRI wireless dimmer","epList":[1],"endpoints":{"1":{"profId":260,"epId":1,"devId":2064,"inClusterList":[0,1,3,9,2821,4096],"outClusterList":[3,4,6,8,25,4096],"clusters":{"genBasic":{"attributes":{"modelId":"TRADFRI wireless dimmer","manufacturerName":"IKEA of Sweden","powerSource":3,"zclVersion":1,"appVersion":17,"stackVersion":87,"hwVersion":30,"dateCode":"20160923","swBuildId":"1.1.1.1-5.7.2.0"}}},"binds":[{"cluster":8,"type":"endpoint","deviceIeeeAddress":"0x00124b0012044e08","endpointID":1},{"cluster":1,"type":"endpoint","deviceIeeeAddress":"0x00124b0012044e08","endpointID":1}]}},"appVersion":17,"stackVersion":87,"hwVersion":30,"dateCode":"20160923","swBuildId":"1.1.1.1-5.7.2.0","zclVersion":1,"interviewCompleted":true,"meta":{"configured":1},"lastSeen":1581973851219}

devices.yaml:

'0x000b57fffe2b4519':
  friendly_name: dimmer
  retain: false
'0x000b57fffe658102':
  friendly_name: bed
  retain: false

groups.yaml:

'1':
  devices:
    - '0xd0cf5efffe2ed16g'
    - '0x000b57fffe396652'
  friendly_name: bedlamps
  retain: false
1 Like

Hey all, I replaced CC2531 with a CC2531 which came with the antenna pre installed from ebay and made my original CC2531 a repeater. Since then my zigbee network has become pretty unreliable and generally slow. Before I switch back to the original CC2531 is there anything I should try?

Thanks