Code Monkey home page Code Monkey logo

Comments (11)

lociii avatar lociii commented on August 25, 2024

Test to forward the Zigbee coordinator from a Pi Zero W to the NUC using usbip, see thread.

from homeassistant-config.

lociii avatar lociii commented on August 25, 2024

This is just a copy of the contents of the aforementioned thread in case it gets deleted.
All credits to luma

On the Pi Zero W (USB host) running latest Raspberry Pi OS

Get the USB ID of the coordinator device

lsusb
>> Bus 001 Device 002: ID 0451:16a8 Texas Instruments, Inc.

0451:16a8 is the ID we're looking for.

Set up usbip

Install usbip, load the kernel module and set it up to load on boot

sudo -s
apt-get install usbip
modprobe usbip_host
echo 'usbip_host' >> /etc/modules

Add a service definition to expose the device in /lib/systemd/system/usbipd.service

[Unit]
Description=usbip host daemon
After=network.target

[Service]
Type=forking
ExecStart=/usr/sbin/usbipd -D
ExecStartPost=/bin/sh -c "/usr/sbin/usbip bind --$(/usr/sbin/usbip list -p -l | grep '#usbid=0451:16a8#' | cut '-d#' -f1)"
ExecStop=/bin/sh -c "/usr/sbin/usbip unbind --$(/usr/sbin/usbip list -p -l | grep '#usbid=0451:16a8#' | cut '-d#' -f1`); killall usbipd"

[Install]
WantedBy=multi-user.target

Make the service known, load and start it

sudo systemctl --system daemon-reload
sudo systemctl enable usbipd.service
sudo systemctl start usbipd.service

On the client

Set up usbip

On Ubuntu usbip is part of the generic tools package, install it and load the virtual USB host controller module

sudo -s
apt-get install linux-tools-generic -y
modprobe vhci-hcd
echo 'vhci-hcd' >> /etc/modules

Add a service definition to make the remote device available in /lib/systemd/system/usbip.service

[Unit]
Description=usbip client
After=network.target

[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/bin/sh -c "/usr/lib/linux-tools/$(uname -r)/usbip attach -r 10.10.10.10 -b $(/usr/lib/linux-tools/$(uname -r)/usbip list -r 10.10.10.10 | grep '0451:16a8' | cut -d: -f1)"
ExecStop=/bin/sh -c "/usr/lib/linux-tools/$(uname -r)/usbip detach --port=$(/usr/lib/linux-tools/$(uname -r)/usbip port | grep '<Port in Use>' | sed -E 's/^Port ([0-9][0-9]).*/\\1/')"

[Install]
WantedBy=multi-user.target

Replace 10.10.10.10 by your IP address and 0451:16a8 by the ID of your USB device

Make the service known, load and start it

sudo systemctl --system daemon-reload
sudo systemctl enable usbipd.service
sudo systemctl start usbipd.service

from homeassistant-config.

lociii avatar lociii commented on August 25, 2024

Switch done. Everything working as expected except for Philips outdoor motion sensor SML002. See zigpy/zigpy-cc#57

from homeassistant-config.

lociii avatar lociii commented on August 25, 2024

ZHA light groups aren't working as well. Using HA light groups as a workaround.

from homeassistant-config.

lociii avatar lociii commented on August 25, 2024

Group control fixed in zigpy/zigpy-cc#58 and waiting for release

from homeassistant-config.

Hedda avatar Hedda commented on August 25, 2024

@lociii Seen you posted in zigpy/zigpy-cc#58 and got other alternative serial-over-network tips if don't want to move your NUC:

The first tip is to use ESP8266 with Jeelabs ESP-LINK firmware instead of a Pi Zero W. Function is same if can connect via serial:

  1. https://github.com/jeelabs/esp-link

The second cutting-edge tip is to buy the new Sonoff ZBBridge and run Tasmota with its serial-bridge, it is an all-in-one device:

  1. https://www.digiblur.com/2020/07/how-to-use-sonoff-zigbee-bridge-with.html
    2b. https://www.youtube.com/watch?v=dC1AEyFhmnc

PS: Regarding your Bitron AV2010/32 wall thermostat, open new issue on -> https://github.com/zigpy/zha-device-handlers/issues
PPS: Somewhat related issue posted here but that is not quite on-topic zigpy/zha-device-handlers#357

from homeassistant-config.

lociii avatar lociii commented on August 25, 2024

Oh wow. Thanks @Hedda

I got USBIP running on a Pi 3 since a while and it's working like a charm. Will check out your other proposals nevertheless.
However I'd prefer not to buy another zigbee coordinator as the CC26X2R1 I'm currently using was quite expensive :-)
For the group support it's just a matter of time until @sanyatuning changes are published.

For the Bitron AV2010/32 I just didn't update the list. They're working flawlessly.

So the last thing that's not working yet, is the SML002 Philips outdoor motion sensor from zigpy/zigpy-cc#57

Will all work out sooner or later. People are spending their spare time to make all of this work, so I will have to be calmly waiting :-)

from homeassistant-config.

Hedda avatar Hedda commented on August 25, 2024

Cool! If you have the skill then you too can help with quirks for devices, checkout -> https://github.com/zigpy/zha-device-handlers

from homeassistant-config.

lociii avatar lociii commented on August 25, 2024

Based on the discussion in zigpy/zigpy-cc#57 it seems like the Philips SML002 needs some changes either to zigpy-cc or zigpy core. At least with my amateur knowledge of how zigbee communicates, it cannot be fixed in a quirk.
Even if I would love to help, this goes way beyond what I'm currently capable of :)

from homeassistant-config.

lociii avatar lociii commented on August 25, 2024

Group support merged into HA core master home-assistant/core#39318

from homeassistant-config.

lociii avatar lociii commented on August 25, 2024

Switched now from zigpy-cc to zigpy-znp and everything is working properly!

from homeassistant-config.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.