It is uite nomal to move Zigbee2mqtt and Mosquitto outside of HAOS. Then these 2 things will run independently, and not be impacted by HA upgrades and restarts.
Many people installs Node Red outside HA as well, and creates light automation there. Then ligth is fully independent of HA
So I add the devices to z2m and have HA read the MQTT on the Pi zero?
Correct.
Basically, add-ons are just dockers.
And every docker can be run independently from HA (iow, outside HA)
Hm, ok, so I have a pi with Z2M. How do I get the entities into HA? I’m really sorry for the stupid question, but I couldn’t find a matching info on the Internet for my use case
I have installed mosquito addon and mqtt integration on the HA pi. Is that correct? Do I need to listen to some topic in mqtt or mosquito?
It’s explained in the docs. MQTT | Zigbee2MQTT
In your case you would point z2m to talk to your external broker (mqtt://youripaddress:1883)
The mosquito logs say that there’s a connection from 192.168.1.104, which is my z2m pi. But still no devices showing up
show your config.
zigbee2mqtt config? please use preformatted text (button in editor), not pictures.
I’m on the phone, so don’t know how to do that from here. I’ll have to do that someday else I’m so sorry. This is stressing me out so much 🫨
Don’t be stressed. We are getting there. First of all, your Mosquitto broker does not require login, and then your mqtt log is saying all the connection attempts are not authorized.
So, is your DVES_C6B63C the z2m pi @ 192.168.1.104? I would recommend you focus on getting your z2m pi to talk to your mqtt broker.
What else do you have in that z2m pi metal box?
… which is why fleskefjes is asking for your z2m config, which I believe you can get here:
While you are in z2m, it is also a good idea to check what the log say. You might want to provide the logs.
Again, you are getting closer.
if you have a recent mosquitto (>= 2.0) anonymous access is disabled by default.
Ok, I’m in for proper debugging now.
the MQTT integration looks like this:
I have a password and a username set here.
Mosquitto looks like this:
logins: []
require_certificate: false
certfile: fullchain.pem
keyfile: privkey.pem
customize:
active: false
folder: mosquitto
I did not change anything regarding ports:
I now have a new Raspberry Pi 3 setup with IP 192.168.1.105, and a brand-new " SONOFF Zigbee Gateway, ZBDongle-E 3.0 USB Dongle Plus". This website (https://smarthomescene.com/blog/best-zigbee-dongles-for-home-assistant-2023/) said that the CC2652 chip would be good.
I have setup z2m on the pi without docker, because I’m a noob and I don’t understand docker. But Z2M is running and it’s in pairing mode (some of that config stuff came in by itself, the advanced and decive options):
# cat /opt/zigbee2mqtt/data/configuration.yaml
homeassistant: false
permit_join: true
mqtt:
base_topic: zigbee2mqtt
server: mqtt://192.168.1.100
user: mqtt-user
password: *****
serial:
port: >-
/dev/serial/by-id/usb-ITEAD_SONOFF_Zigbee_3.0_USB_Dongle_Plus_V2_20231122135024-if00
advanced:
homeassistant_legacy_entity_attributes: false
legacy_api: false
legacy_availability_payload: false
device_options:
legacy: false
devices:
'0xa4c1389344582510':
friendly_name: '0xa4c1389344582510'
As you can see, 1 device is already paired (one of the 9 identical power sockets I bought, “Silvercrest”/Lidl). It was paired immediately and with a breeze. I can see lots of MQTT/Zigbee packets flying in on the Z2M raspberry pi:
Zigbee2MQTT:info 2024-02-26 21:29:48: Connecting to MQTT server at mqtt://192.168.1.100
Zigbee2MQTT:info 2024-02-26 21:29:49: Connected to MQTT server
Zigbee2MQTT:info 2024-02-26 21:29:49: MQTT publish: topic 'zigbee2mqtt/bridge/state', payload '{"state":"online"}'
Zigbee2MQTT:info 2024-02-26 21:29:50: Zigbee2MQTT started!
Zigbee2MQTT:info 2024-02-26 21:33:16: Device '0xa4c1389344582510' joined
Zigbee2MQTT:info 2024-02-26 21:33:16: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa4c1389344582510","ieee_address":"0xa4c1389344582510"},"type":"device_joined"}'
Zigbee2MQTT:info 2024-02-26 21:33:16: Starting interview of '0xa4c1389344582510'
Zigbee2MQTT:info 2024-02-26 21:33:16: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"friendly_name":"0xa4c1389344582510","ieee_address":"0xa4c1389344582510","status":"started"},"type":"device_interview"}'
Zigbee2MQTT:info 2024-02-26 21:33:17: Successfully interviewed '0xa4c1389344582510', device has successfully been paired
Zigbee2MQTT:info 2024-02-26 21:33:17: Device '0xa4c1389344582510' is supported, identified as: Lidl Silvercrest smart plug with power monitoring (EU, FR) (HG08673)
Zigbee2MQTT:info 2024-02-26 21:33:17: MQTT publish: topic 'zigbee2mqtt/bridge/event', payload '{"data":{"definition":{"description":"Silvercrest smart plug with power monitoring (EU, FR)","exposes":[{"features":[{"access":7,"description":"On/off state of the switch","label":"State","name":"state","property":"state","type":"binary","value_off":"OFF","value_on":"ON","value_toggle":"TOGGLE"}],"type":"switch"},{"access":7,"description":"Recover state after power outage","label":"Power outage memory","name":"power_outage_memory","property":"power_outage_memory","type":"enum","values":["on","off","restore"]},{"access":7,"description":"LED indicator mode","label":"Indicator mode","name":"indicator_mode","property":"indicator_mode","type":"enum","values":["off","off/on","on/off","on"]},{"access":1,"category":"diagnostic","description":"Instantaneous measured power","label":"Power","name":"power","property":"power","type":"numeric","unit":"W"},{"access":1,"category":"diagnostic","description":"Instantaneous measured electrical current","label":"Current","name":"current","property":"current","type":"numeric","unit":"A"},{"access":1,"category":"diagnostic","description":"Measured electrical potential value","label":"Voltage","name":"voltage","property":"voltage","type":"numeric","unit":"V"},{"access":1,"description":"Sum of consumed energy","label":"Energy","name":"energy","property":"energy","type":"numeric","unit":"kWh"},{"features":[{"access":3,"description":"Enables/disables physical input on the device","label":"State","name":"state","property":"child_lock","type":"binary","value_off":"UNLOCK","value_on":"LOCK"}],"label":"Child lock","type":"lock"},{"access":1,"category":"diagnostic","description":"Link quality (signal strength)","label":"Linkquality","name":"linkquality","property":"linkquality","type":"numeric","unit":"lqi","value_max":255,"value_min":0}],"model":"HG08673","options":[{"access":2,"description":"Only the energy value is polled for this device.","label":"Measurement poll interval","name":"measurement_poll_interval","property":"measurement_poll_interval","type":"numeric","value_min":-1},{"access":2,"description":"Calibrates the power value (percentual offset), takes into effect on next report of device.","label":"Power calibration","name":"power_calibration","property":"power_calibration","type":"numeric"},{"access":2,"description":"Number of digits after decimal point for power, takes into effect on next report of device. This option can only decrease the precision, not increase it.","label":"Power precision","name":"power_precision","property":"power_precision","type":"numeric","value_max":3,"value_min":0},{"access":2,"description":"Calibrates the current value (percentual offset), takes into effect on next report of device.","label":"Current calibration","name":"current_calibration","property":"current_calibration","type":"numeric"},{"access":2,"description":"Number of digits after decimal point for current, takes into effect on next report of device. This option can only decrease the precision, not increase it.","label":"Current precision","name":"current_precision","property":"current_precision","type":"numeric","value_max":3,"value_min":0},{"access":2,"description":"Calibrates the voltage value (percentual offset), takes into effect on next report of device.","label":"Voltage calibration","name":"voltage_calibration","property":"voltage_calibration","type":"numeric"},{"access":2,"description":"Number of digits after decimal point for voltage, takes into effect on next report of device. This option can only decrease the precision, not increase it.","label":"Voltage precision","name":"voltage_precision","property":"voltage_precision","type":"numeric","value_max":3,"value_min":0},{"access":2,"description":"Calibrates the energy value (percentual offset), takes into effect on next report of device.","label":"Energy calibration","name":"energy_calibration","property":"energy_calibration","type":"numeric"},{"access":2,"description":"Number of digits after decimal point for energy, takes into effect on next report of device. This option can only decrease the precision, not increase it.","label":"Energy precision","name":"energy_precision","property":"energy_precision","type":"numeric","value_max":3,"value_min":0},{"access":2,"description":"State actions will also be published as 'action' when true (default false).","label":"State action","name":"state_action","property":"state_action","type":"binary","value_off":false,"value_on":true}],"supports_ota":true,"vendor":"Lidl"},"friendly_name":"0xa4c1389344582510","ieee_address":"0xa4c1389344582510","status":"successful","supported":true},"type":"device_interview"}'
Zigbee2MQTT:info 2024-02-26 21:33:17: Configuring '0xa4c1389344582510'
Zigbee2MQTT:info 2024-02-26 21:33:18: Successfully configured '0xa4c1389344582510'
Zigbee2MQTT:info 2024-02-26 21:33:22: MQTT publish: topic 'zigbee2mqtt/0xa4c1389344582510', payload '{"linkquality":240,"voltage":234}'
Zigbee2MQTT:info 2024-02-26 21:33:24: MQTT publish: topic 'zigbee2mqtt/0xa4c1389344582510', payload '{"child_lock":"UNLOCK","indicator_mode":"off/on","linkquality":236,"power_outage_memory":"off","state":"OFF","voltage":234}'
Zigbee2MQTT:info 2024-02-26 21:34:07: MQTT publish: topic 'zigbee2mqtt/0xa4c1389344582510', payload '{"child_lock":"UNLOCK","current":0,"indicator_mode":"off/on","linkquality":236,"power":0,"power_outage_memory":"off","state":"OFF","voltage":233}'
Zigbee2MQTT:info 2024-02-26 21:34:07: MQTT publish: topic 'zigbee2mqtt/0xa4c1389344582510', payload '{"child_lock":"UNLOCK","current":0,"energy":0,"indicator_mode":"off/on","linkquality":236,"power":0,"power_outage_memory":"off","state":"OFF","voltage":233}'
Yet, nothing happens in Home Assistant: the MQTT integration remains empty.
If I’m listening to the topic from the Z2M logs, I receive all of the messages in HA that Z2M is sending:
So, I’m kinda lost again why the integration remains empty. Any idea(s)?
I think you are close. I am not 100% sure but noticed a couple of things:
- Do you want to change this to
192.168.1.100
also?
- This looks like 6 digits:
…but then the password here looks like 5 digits
- Also see above, is there a specific reason why you don’t specify port 1883 after
server: mqtt://192.168.1.100
? - For the mosquitto config, is there a reason why you don’t specify username and password?
For the purpose of debugging, you might want to use the mqtt explorer add-on on the Home Assistant, which is 192.168.1.100
and supposedly your mqtt broker.
-
Change IP address: I mean, the broker and the integration are both running on the same device, so localhost should work.
-
That was my fault when I removed the clear text password. It is correct in the application. Well spotted though!
-
No, there’s no reason. I added it now.
-
Errrr, no, no reason. Changed that, too.
I’ll post an update on if it works soon
You have homeassistant: false
at the top of your z2m config
Genius works instantly