# ZigStar UZG-01
If you are using a [ZigStar UZG-01](https://uzg.zig-star.com/product/) [[Zigbee]] coordinator, ensure you are using the XZG device firmware and have at least the following configuration. The [[MQTT]] config is optional, as it is only if you want to track the UZG-01 sensors through [[MQTT]].
![[zigbee2mqtt-uzg-01-0.png]]
![[zigbee2mqtt-uzg-01-1.png]]
# Hardware
The minimum hardware required to install and run [[Zigbee2MQTT]] is:
<span class="fieldname">CPU:</span> 1GHz
<span class="fieldname">RAM:</span> 500Mb
<span class="fieldname">HDD:</span> 1Gb
Minimum recommended:
<span class="fieldname">CPU:</span> 2 x 1GHz
<span class="fieldname">RAM:</span> 2Gb
<span class="fieldname">SSD:</span> 8Gb
# [[7. PVE 8.x - Create LXC (CT)#Create LXC using webUI|Create LXCu]]
Follow the [[7. PVE 8.x - Create LXC (CT)#Create LXC using webUI|guide]] using the settings below. [[LXC]]s will only use the resources required, not the resources assigned.
<span class="fieldname">Template:</span> Debian 12
<span class="fieldname">Disk:</span> 32G
<span class="fieldname">CPU:</span> 2
<span class="fieldname">Memory:</span> 2048
<span class="fieldname">Swap:</span> 0
<span class="fieldname">Network:</span> static [[IPv4]]: <code class="o-code">192.168.0.222/24</code>
# [[4. Debian - Setup|Setup Debian]]
<button class="login-root">🖥>login</button> <code class="login-root">root</code> and follow the [[4. Debian - Setup|guide]] for a minimum setup (timezone and update).
# Install [[node.js]]
```cli
apt install curl
```
```cli
curl -fsSL https://deb.nodesource.com/setup_22.x | bash -
```
or
```cli
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
```
```cli
apt install -y nodejs git make g++ gcc libsystemd-dev
```
show installed version - should output `20.x`
```cli
node --version
```
```cli
npm --version
```
```cli
mkdir /opt/zigbee2mqtt
```
# Install [[Zigbee2MQTT]]
install latest version
```cli
git clone --depth 1 https://github.com/Koenkk/zigbee2mqtt.git /opt/zigbee2mqtt
```
```cli
cd /opt/zigbee2mqtt
```
show [[Zigbee2MQTT]] installed version
```cli
cat /opt/zigbee2mqtt/.release-please-manifest.json
```
```cli
npm ci
```
run only if vulnerabilities reported
```cli
npm audit fix
```
```cli
npm run build
```
# Configure [[Zigbee2MQTT]]
```cli
cp /opt/zigbee2mqtt/data/configuration.example.yaml /opt/zigbee2mqtt/data/configuration.yaml
```
> [!cli]+ <code class="g-code">nano /opt/zigbee2mqtt/data/configuration.yaml</code>
>
>```YAML
># Home Assistant integration (MQTT discovery)
>homeassistant: true
>
># Enable the frontend, runs on port 8080 by default
>frontend: true
>
># allow new devices to join; best practice to manually enable from the webUI
>permit_join: false
>
># MQTT settings
>mqtt:
> # MQTT base topic for zigbee2mqtt MQTT messages
> base_topic: zigbee2mqtt
> # MQTT server URL
> server: mqtt://192.168.0.111
> # MQTT server authentication, uncomment if required:
> # user: my_user
> # password: my_password
>
># Serial settings
>serial:
> # Location of CC2531 USB sniffer
> #port: /dev/ttyACM0
> port: tcp://192.168.0.112:6638
> baudrate: 115200
>
># Advanced settings
>advanced:
> # Let Zigbee2MQTT generate a network key on first start
> network_key: GENERATE
> # Let Zigbee2MQTT generate a pan_id on first start
> pan_id: GENERATE
> # Let Zigbee2MQTT generate a ext_pan_id on first start
> ext_pan_id: GENERATE
> transmit_power: 20 # set to max power
> channel: 25 # there might be devices which do not support ch26
> log_level: info # info warn error debug
>```
It is best practice to dedicate wireless channel 11 to Zigbee with channels 1 and 6 dedicated to WiFi. If this is not possible the next best wireless channel to use for Zigbee is channel 26, with the least interference, but check if all your [[Zigbee]] devices can be discovered on this channel; some devices do not support this channel. The next best channels are 25 and 20 in this order of preference.
![[zigbee2mqtt-zigbee-0.png]]
test [[Zigbee2MQTT]] can start without errors
```cli
npm start
```
Proceed to next step only if <code class="g-code">npm start</code> starts with no errors. Errors are in red font, while warnings are in yellow font. Note, warnings are no show stoppers. It can take a bit of time for <code class="g-code">npm start</code> to start.
Press <button class="login-root">ctrl</button><button class="login-root">c</button> to stop [[Zigbee2MQTT]]. We will create a service file to automatically start [[Zigbee2MQTT]] on [[boot]]; using this service file we will also automatically restart [[Zigbee2MQTT]] if it stops; this is important since [[Zigbee2MQTT]] does not restart if it encounters an error with the [[Zigbee]] coordinator, as for example a network disconnection.
> [!cli]+ <code class="g-code">nano /etc/systemd/system/zigbee2mqtt.service</code>
>
>```bash
>[Unit]
>Description=zigbee2mqtt
>After=network.target
>
>[Service]
>Environment=NODE_ENV=production
>Type=notify
>ExecStart=/usr/bin/node index.js
>WorkingDirectory=/opt/zigbee2mqtt
># Zigbee2MQTT messages will not be written to syslog
>StandardOutput=null
>StandardError=inherit
>WatchdogSec=10s
>Restart=always
>RestartSec=2s
>User=root
>
>[Install]
>WantedBy=multi-user.target
>```
start the service
```cli
systemctl start zigbee2mqtt
```
ensure the service starts with no errors
```cli
systemctl status zigbee2mqtt
```
autostart the service at boot time
```cli
systemctl enable zigbee2mqtt.service
```
reboot to test you can access [[Zigbee2MQTT]]
```cli
reboot
```
ensure you can access the [[Zigbee2MQTT]] [[webUI]]
<code class="o-code">
http://192.168.0.222:8080</code>
# Upgrade [[Zigbee2MQTT]]
```cli
cd /opt/zigbee2mqtt
```
```cli
./update.sh
```
![[zigbee2mqtt-update-0.png]]
when updating or making key or channel changes [[Zigbee2MQTT]] might fail to start; in such cases....
```cli
rm /opt/zigbee2mqtt/data/coordinator_backup.json
```
ensure [[Zigbee2MQTT]] starts with no errors
```cli
npm start
```
Press <button class="login-root">ctrl</button><button class="login-root">c</button> to stop [[Zigbee2MQTT]]
```cli
reboot
```
ensure you can access the [[Zigbee2MQTT]] [[webUI]]
<code class="o-code">
http://192.168.0.222:8080
</code>
![[Zigbee2MQTT#References]]
# Follow or Support me -> <a href='https://ko-fi.com/S6S0K9U5Q' target='_blank'><img height='36' style='border:0px;height:36px;float:right; ' src='https://storage.ko-fi.com/cdn/kofi1.png?v=3' border='0' alt='Buy Me a Coffee at ko-fi.com' /></a>