First ZigBee tests with python (bellows) forming a network controller

yeah that worked was able to add my lutron bulb remote. Now I have to figure how to add a bulb
(phillps hue) any hints?

if it is already registered to a zigbee/hue network it must leave the old network. i don’t know how to factory reset a hue bulb maybe this helps:

oh I can rest it to default with the lutron I have doe it a few times, will it just join a network after reset?

i think so: just run bellows permit and switch the bulb on.

success …

(bellows) pi@raspberrypi:~ $ bellows devices
Device:
NWK: 0xb31f
IEEE: 00:17:88:01:03:70:10:a3
Endpoints:
242: profile=0xa1e0, device_type=97
Input Clusters:
GreenPowerProxy (33)
Output Clusters:
GreenPowerProxy (33)
11: profile=0xc05e, device_type=DeviceType.EXTENDED_COLOR_LIGHT
Input Clusters:
Basic (0)
Identify (3)
Groups (4)
Scenes (5)
On/Off (6)
Level control (8)
Color Control (768)
LightLink (4096)
Manufacturer Specific (64513)
Output Clusters:
Ota (25)
Device:
NWK: 0x6899
IEEE: ff:ff:00:0f:e7:ff:78:83
Endpoints:
1: profile=0xc05e, device_type=DeviceType.CONTROLLER
Input Clusters:
Basic (0)
LightLink (4096)
Manufacturer Specific (64580)
Manufacturer Specific (65280)
Output Clusters:
Basic (0)
Identify (3)
Groups (4)
Scenes (5)
On/Off (6)
Level control (8)
LightLink (4096)
Manufacturer Specific (65280)

Thanks alot
you the best. So by right I can install HA as a VM and use this as my controller correct?

it seems so. maybe you get some trouble as ha is using an older bellows version. but you can copy the ~/.config/bellows/app.db to the zigbee.db from above. first i would recommend to follow the installation guide from above and try if you get ha running. then you need to get the zha plugin (bellows) working and maybe install node red as addon. ask if you have some questions.

for my own i use node red to switch my light on and off if my tv is turned on. i also use the ha cloud plugin to control my light with an amazon echo.

currently i’m running the docker version of hass.io:

yeah I was looking at node red mostly cause I was leaning toward openhab at first. Can node red be used with bellows ? I was really wanted to use mqtt something like this https://www.npmjs.com/package/node-ezsp-mqtt
but I have had this device for so long I just want to use it.

or maybe this https://community.home-assistant.io/t/zigbee2mqtt-getting-rid-of-your-proprietary-zigbee-bridges-xiaomi-hue-tradfri/52108

i’m running all stuff on the same rpi, so i have no need to use mqtt. home assistant is talking to the devices through the zha plugin. and i can use the node red to control it as normal ha endpoint.

node red could probably be installed on a different server:

image

but homeassistant needs to be installed on the same device as the creator in my setup.

1 Like

HA 0.70.0 got released it now contains the fixed zha (zigpy). so it should work out of the box. the only fix still needed is to disable the em358-program.bash in order to not factory reset the creator zigbee on every startup and so loosing the formed network. (described in the initial post)

I think I broke it…
To test I wiped the whole pi and did everything from scratch. but when run it now
bellows -v debug form
debug: Using selector: EpollSelector
debug: Loading application state from /home/pi/.config/bellows/app.db
debug: Sending: b’1ac038bc7e’

I’m trying to set this up with the latest version of hass(manual install) and latest version of zigbee malos but can’t find following file /usr/share/matrixlabs/matrixio-devices/matrix-init.bash. Also don’t have ttyS0 is there anything changed?

the newest hass has the bellows fixes already included.

i’m currently using hass.io with the following matrix packages installed:

matrixio-creator-init/unknown,now 0.4.13 armhf [installed]
matrixio-kernel-modules/unknown,now 0.1.4 armhf [installed]

reboot the pi and then disable the em358-program.bash, because the init script is still resetting/pruging the zigbee controller on every startup, keep in mind to fix this on every newly installed matrixio-creator-init update, if not the controller config is lost and the zigbee network needs to be reformed:

# comment out em358-program.bash to prevent a device factory reset on reboot or power cycle
# (possible an unwanted behavior in matrix init)
sudo vi /usr/share/matrixlabs/matrixio-devices/matrix-init.bash
# change
./em358-program.bash
to
# ./em358-program.bash

hass.io runs as docker service and can be installed with the following command running as root, i’m not shure if i had to install further packages to get it working (docker, …):

curl -sL https://raw.githubusercontent.com/home-assistant/hassio-build/master/install/hassio_install | bash -s -- -m raspberrypi3

navigate to “http://{DEVICE-IP}:8123”

in hass you can configuere the zigbee under “configuration->integration->ZHA (configure)” use /dev/ttyS0 and EZSP

the ttyS0 should also be visible under Hass.io->System-Hardware:

1 Like

thanks for your reply. I forgot the matrix init packages. It’s all working now but apparently the ikea remote and debugger are not yet supported by Hass. I hoped that I could use one device to control and use all my zigbee devices(hue lamps, tradfri lamps, tradfri remote and dimmer).

I think i’m going to try the zigbee2mqtt bridge

if you ever get the zigbee2mqtt bridge working let me know…

It won’t work with the matrix creator. I’ve bought the hardware to support zigbee2mqtt

hi everyone, I try to connect matrix creator to home assistance but i have this errors in bellows devices:

(bellows) pi@raspberrypi:~ $ bellows permit
Joins are permitted for the next 30s...
Device 0x0436 (00:12:4b:00:10:03:7f:61) joined the network
[0x0436] Discovering endpoints
Tries remaining: 3
[0x0436] Discovered endpoints: [1]
[0x0436:1] Discovering endpoint information
Tries remaining: 3
[0x0436:1] Discovered endpoint information: <SimpleDescriptor endpoint=1 profile  =260 device_type=258 device_version=0 input_clusters=[0, 3, 4, 5, 6, 8, 768] out  put_clusters=[0]>
Done
(bellows) pi@raspberrypi:~ $ bellows devices
Traceback (most recent call last):
  File "/home/pi/.virtualenvs/bellows/bin/bellows", line 8, in <module>
    sys.exit(main())
  File "/home/pi/.virtualenvs/bellows/lib/python3.7/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/home/pi/.virtualenvs/bellows/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/home/pi/.virtualenvs/bellows/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/pi/.virtualenvs/bellows/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/pi/.virtualenvs/bellows/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/home/pi/.virtualenvs/bellows/lib/python3.7/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/home/pi/.virtualenvs/bellows/lib/python3.7/site-packages/bellows/cli/application.py", line 95, in devices
    app = bellows.zigbee.application.ControllerApplication(ezsp, database)
  File "/home/pi/.virtualenvs/bellows/lib/python3.7/site-packages/bellows/zigbee/application.py", line 21, in __init__
    super().__init__(database_file=database_file)
  File "/home/pi/.virtualenvs/bellows/lib/python3.7/site-packages/zigpy/application.py", line 25, in __init__
    self._dblistener.load()
  File "/home/pi/.virtualenvs/bellows/lib/python3.7/site-packages/zigpy/appdb.py", line 223, in load
    ep.manufacturer = value.decode('ascii').strip()
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 0: ordinal not in range(128)

is there any way to fix this problem
also, I tested with python3.5 and I have these errors again
I am using raspberry pi 3 and raspbian buster

I built a python application using bellows to control devices via HTTP. I think its easier to integrate it with Node-Red or other platforms via HTTP.

1 Like

I want to thank everyone that contributed to helping create this guide and software. I started with the Matrix Creator going down the route of setting up Zwave (failed), and after following this guide I was finally able to get my lights hooked up to my smart home with Home Assistant!

1 Like