Skip to content

Instantly share code, notes, and snippets.

@bahamas10
Last active April 4, 2024 08:01
Show Gist options
  • Save bahamas10/dfac91f6a33c8e75d4b778cd1db89d87 to your computer and use it in GitHub Desktop.
Save bahamas10/dfac91f6a33c8e75d4b778cd1db89d87 to your computer and use it in GitHub Desktop.
Home Assistant on SmartOS LX Zone
{
"alias": "hass",
"brand": "lx",
"autoboot": true,
"quota": 20,
"delegate_dataset": true,
"kernel_version": "4.3.0",
"image_uuid": "7b5981c4-1889-11e7-b4c5-3f3bdfc9b88b",
"max_physical_memory": 1024,
"nics": [
{
"nic_tag": "admin",
"ip": "10.0.1.42",
"netmask": "255.255.255.0",
"gateway": "10.0.1.1",
"primary": true
}
],
"resolvers": [
"10.0.1.2",
"10.0.1.3"
]
}
# add device to zone
https://docs.oracle.com/cd/E19044-01/sol.containers/817-1592/z.conf.start-73/index.html
zonecfg -u <uuid>
> add device
> set match=/dev/cua/0
> end
> exit
# fix zwave thing
./simple--wave.d
test with:
echo -e -n "\x01\x08\x00\xF2\x51\x01\x00\x05\x01\x51" > /dev/cua/0
# bootstrap zone
apt-get update
apt-get upgrade -y
>>> idk if all of this is necessary
apt-get install -y build-essential
apt-get install -y git
apt-get install -y libyaml-0-2
apt-get install -y pkg-config
apt-get install -y libudev-dev
# install python3.6
add-apt-repository ppa:deadsnake/ppa
apt-get update
apt-get install -y python3-pip
apt-get install -y python3.6
apt-get install -y python3.6-venv
apt-get install -y python3.6-dev
# create user
# i don't think dialout is necessary cuz zone owns the device 0666
useradd -rm homeassistant -G dialout
# put data in right place
ln -s "/zones/$(zonename)/data" /data
# install hass
mkdir /data/homeassistant # where the source lives
mkdir /data/.homeassistant # where the config will live
ln -s /data/.homeassistant /home/homeassistant/.homeassistant
cd /data/homeassistant
sudo -Hsu homeassistant
python3.6 -m venv .
. bin/activate
python3.6 -m pip install --upgrade pip
python3.6 -m pip install wheel
python3.6 -m pip install homeassistant
# run hass
(in that dir as that user with the venv setup)
hass
(ctrl-d twice to get back to root)
#!/usr/sbin/dtrace -qs
usbsacm_ds_set_port_params:entry {
this->acmp = (usbsacm_state_t *)arg0;
this->acm_port = (usbsacm_port_t *)&this->acmp->acm_ports[arg1];
print(this->acm_port);
printf("acm_cap = %d\n", this->acm_port->acm_cap);
printf("run the following in mdb -kw if cap != 2: 0x%p/W 2\n",
&this->acm_port->acm_cap);
}
@blackwood821
Copy link

blackwood821 commented May 17, 2020

This worked great with the Aeotec Z-Stick Gen5 (https://www.amazon.com/gp/product/B00X0AWA6E/ref=ppx_yo_dt_b_asin_title_o03_s00?ie=UTF8&psc=1) for Z-Wave only but I just swapped that stick out for the HUSBZB-1 USB (https://www.amazon.com/gp/product/B01GJ826F8/ref=ppx_yo_dt_b_asin_title_o08_s00?ie=UTF8&psc=1) since it supports both Z-Wave and Zigbee which I need. On the Z-Wave stick it was /dev/cua/0 as shown in this post but the new stick is supposed to show up as two different serial ports but I don't see any /dev/ttyUSB* serial ports:

[root@headnode (neptune) ~]# find /dev/cua* /dev/tty* -mtime -1 -ls
2621383827    1 drwxr-xr-x   3 root     root          512 May 17 20:59 /dev/cua
2621383793    1 lrwxrwxrwx   1 root     root           43 May 17 20:59 /dev/cua/a -> ../../devices/pci@0,0/isa@1f/asy@1,3f8:a,cu
2621383861    1 lrwxrwxrwx   1 root     root           40 May 17 20:59 /dev/cua0 -> ../devices/pci@0,0/isa@1f/asy@1,3f8:a,cu
2621383997    1 lrwxrwxrwx   1 root     root           37 May 17 20:59 /dev/tty00 -> ../devices/pci@0,0/isa@1f/asy@1,3f8:a
2621384031    1 lrwxrwxrwx   1 root     root           37 May 17 20:59 /dev/ttya -> ../devices/pci@0,0/isa@1f/asy@1,3f8:a
2621383895    1 lrwxrwxrwx   1 root     root           40 May 17 20:59 /dev/ttyd0 -> ../devices/pci@0,0/isa@1f/asy@1,3f8:a,cu

When I run simple-zwave.d I get this error:

[root@headnode (neptune) /opt]# ./simple-zwave.d 
dtrace: failed to compile script ./simple-zwave.d: line 4: syntax error near ")"

Here is a link to the details about the USB stick: https://www.nortekcontrol.com/pdf/manuals/husbzb-1-instructions.pdf

Any help is much appreciated. Thanks.

@blackwood821
Copy link

blackwood821 commented May 17, 2020

I noticed that /dev/usb/device0 is present when the USB is in but when I pass that device through to the LX Ubuntu zone ZHA in Home Assistant doesn't recognize it. It should be presented as two different serial ports so I wouldn't expect /dev/usb/device0 to work anyway.

@blackwood821
Copy link

I see this in dmesg:

2020-05-17T22:57:09.759385+00:00 headnode usba: [ID 349649 kern.info] usba:#011no driver found for interface 1 (nodename: 'interface') of Silicon Labs HubZ Smart Home Controller 81300CC8

Anyone know where I can get the driver for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment