Package Details: zigbee2mqtt 1.17.1-1

Git Clone URL: https://aur.archlinux.org/zigbee2mqtt.git (read-only, click to copy)
Package Base: zigbee2mqtt
Description: A Zigbee to MQTT bridge
Upstream URL: https://www.zigbee2mqtt.io
Licenses: GPL3
Conflicts: zigbee2mqtt
Provides: zigbee2mqtt
Submitter: buckket
Maintainer: buckket
Last Packager: buckket
Votes: 5
Popularity: 0.49
First Submitted: 2020-03-30 00:32
Last Updated: 2021-02-21 12:54

Latest Comments

1 2 Next › Last »

buckket commented on 2020-12-15 19:17

I've bumped the version and updated the package to include the suggestions @BrainDamage made previously. Thank you very much for helping!

The package now follows the a more standard approach and the configuration file is now located in /etc/zigbee2mqtt. The runtime data files now are stored in /var/lib/zigbee2mqtt.

You have to manually copy your config file from the old location to the new one. When upgrading a notice should appear with an example command.

If you encounter any problems, please let me know.

BrainDamage commented on 2020-11-22 20:30

I have some suggestions to improve the PKGBUILD:

npm start is a bad way to launch the program; all it does is two tasks:

  • update the libraries according to the package file

  • launch node index.js

the first part is problematic, if it creates new files they may conflict on a package update, if one wants to update the libs, they can always rebuild the package

the second part, well, we can do it ourselves without involving npm, so we can drop the dependency at runtime and make it compile time only

moreover, having program, program runtime data and configuration all in the same place goes against security practices, package guidelines and backup ease, instead of dumping all in /opt, one could use ZIGBEE2MQTT_DATA to redirect the RW dir to the user's home

finally, the configuration, should belong to /etc, and then symlinked to work around the program's deficiency in reading a separate config location ( ZIGBEE2MQTT_CONFIG is deprecated ).

accounting for all the changes, the PKGBUILD would look like:

$ cat PKGBUILD

pkgname=zigbee2mqtt
pkgver=1.16.1
pkgrel=2
pkgdesc='A Zigbee to MQTT bridge'
arch=('x86_64' 'arm' 'armv6h' 'armv7h' 'aarch64')
url='https://www.zigbee2mqtt.io'
license=('GPL3')
depends=('nodejs>=10.0')
makedepends=('npm')
optdepends=(
  'cc-tool: To flash Texas Instruments CC2531 debugger'
  'mosquitto: MQTT broker')
source=("https://github.com/Koenkk/${pkgname}/archive/${pkgver}.tar.gz"
  'zigbee2mqtt.service'
  'zigbee2mqtt.sysusers'
  'zigbee2mqtt.tmpfiles')
sha256sums=('e4313c798f10638e728da75388aaa3fad89c9f6f73b2ccb7a042611d8ed64722'
        '36fdca9c274fc143a85cc57d70a36e0ec9455cf86b85d0690ccf0090ee8d682d'
        '777e374fca1d4cc81790649e91bd9b62cf3fa5a1e0e36f1deeafbcd49a955185'
        '359f74d08339dafac841a651fa2ee5be64aaa3fa03c9fe2f8b4838f8d0a6528e')

package() {
  cd "${pkgname}-${pkgver}"
  npm install --cache "${srcdir}/npm-cache" --user root

  install -d "${pkgdir}/usr/lib/node_modules/${pkgname}"
  cp -dpr --no-preserve=ownership "${srcdir}/${pkgname}-${pkgver}/." "${pkgdir}/usr/lib/node_modules/${pkgname}"

  install -Dm644 data/configuration.yaml "${pkgdir}/etc/${pkgname}/configuration.yaml"

  install -Dm644 "${srcdir}/${pkgname}.service" "${pkgdir}/usr/lib/systemd/system/${pkgname}.service"
  install -Dm644 "${srcdir}/${pkgname}.sysusers" "${pkgdir}/usr/lib/sysusers.d/${pkgname}.conf"
  install -Dm644 "${srcdir}/${pkgname}.tmpfiles" "${pkgdir}/usr/lib/tmpfiles.d/${pkgname}.conf"
}

$ cat zigbee2mqtt.service

[Unit]
Description=zigbee2mqtt
After=network.target

[Service]
ExecStart=node /usr/lib/node_modules/zigbee2mqtt/index.js
Environment=ZIGBEE2MQTT_DATA=/var/lib/zigbee2mqtt
StandardOutput=inherit
StandardError=inherit
Restart=always
User=zigbee2mqtt

[Install]
WantedBy=multi-user.target

$ cat zigbee2mqtt.sysusers

u zigbee2mqtt - "zigbee2mqtt service user"
m zigbee2mqtt uucp

$ cat zigbee2mqtt.tmpfiles

z /etc/zigbee2mqtt/configuration.yaml 0640 zigbee2mqtt zigbee2mqtt
L /var/lib/zigbee2mqtt/configuration.yaml - - - - /etc/zigbee2mqtt/configuration.yaml

mantielero commented on 2020-11-08 10:23

For the zigbee2mqtt.service, zigbee2mqtt.sysusers, zigbee2mqtt.tmpfiles I made some changes that can be useful: 1. I moved zigbee2mqtt.service to /etc/system.d/system/ (rather than in /usr/lib/system.d/system. 2. Probably it is needed to: a. To create the zigbee2mqtt user and zigbee2mqtt group. b. To include that user in the group uucp, given that: ls -la /dev/ttyACM0 shows:

crw-rw---- 1 root uucp 166, 0 Nov  8 10:21 /dev/ttyACM0

mantielero commented on 2020-11-06 21:39

It is failing in my RPi 1B. I installed manually following:

# Clone Zigbee2MQTT repository
sudo git clone https://github.com/Koenkk/zigbee2mqtt.git /opt/zigbee2mqtt
sudo chown -R alarm:alarm /opt/zigbee2mqtt

# Install dependencies (as user "alarm")
cd /opt/zigbee2mqtt
npm ci

I don't know why it fails, but I get an error similar to:

npm ERR! cb() never called! 

linxpert commented on 2020-10-15 19:38

@sD810: script doesn't stop on my Pi4 (aarch64) at this step of the build process but takes a very long time though before it continues.

dS810 commented on 2020-10-14 22:34

Script stopts on this line:

-> Stripping unneeded symbols from binaries and libraries...

Hardware: RaspberryPi 4

OS: Archlinux ARM latest version

buckket commented on 2020-10-12 23:21

Fixed the unnecessary comma, PKGBUILD should now work with pikaur. Thanks for pointing it out.

linxpert commented on 2020-10-12 14:54

I can confirm the issue reported by @Smokie with pikaur and flawless build just using makepkg. Compared to other packages in AUR, the comma seems indeed not to be correct.

Smokie commented on 2020-10-11 21:25

For me, pikaur fails to install this pkg. I suspect the comma in depends is invalid, even it seems to not hurt makepkg. Can you adjust depends=('nodejs>=10.0', 'npm') to depends=('nodejs>=10.0' 'npm')

buckket commented on 2020-10-07 14:46

Thanks for your feedback. I’ve included the ARM architectures to the PKGBUILD.