Everything Xbee

TL;DR Unless you want to learn MicroPython and Groovy and a large chunk of the Zigbee protocol: You are better off using an ESP32 based controller. The best I have found so far are the TinyPico (~£18 but TINY!) and the DF Robot Firebeetle (~£7 and a steal). Both deep sleep down to 10~20uA and can just about be run on batteries. they use the latest ESP32-WROOM-32E low power processor.

I've been drowning in Zigbee and Xbee configuration for the last week. The main problem with configuring XBee's for ZHA (Home Automation) is that there is no help at all available from Digi. Because of this, there's either the limited support letting the Xbee do all the ZDO and ZCL protocol exchanges and just play around with the transmit command configuration option, or use passthrough and handle all of the ZDO/ZCL traffic yourself. There is a third option in just using the Xbee as the modem and attach it to a standalone processor (e.g. a Raspberry Pi Pico).

The problem with handling the ZDO/ZCL traffic yourself is that there is insufficient memory on the XBee3's to write your own driver library and have your own scripts use it, killing that idea dead in the water.

That leaves hacking about with the transmit command and writing your own HE device handler and writing your own micropython scripts to run on the Xbee. This is what I have chosen to do. Doing this means breaking the Zigbee protocol and hijacking the endpoints and commands to do whatever you want. I have it working where the Xbee3 accepts triggers to switch 3 NPN transistor switches to control a remote for a battery powered window opener. It uses deep sleep to give it some decent battery life. The Xbee reports back confirmation of its actions plus the temperature and voltage to keep track of battery usage.

The other option is to use it solely as a modem and do everything on a separate processor. I'm going to look into this next as I have a Pi Pico sat in front of me plus a few non-programmable Xbee S2C's which this will be ideal for as there are Zigbee libraries available to do it this way.

For anyone who made it this far, apologies for all the acronyms :stuck_out_tongue:

1 Like

My friend David did a TON of work on XBee a while back. He posted it all at:

He has been using it for HA based upon python code he wrote. It just works.
Check it out as I think it may help.
Personally, I have had XBee modules running for several years in my HA. They work really well. Now I am about to embark on a new adventure with Hubitat hub. It is due to arrive tomorrow. I abandoned my Smartthings hub a few years ago when Samsung decided local control was not for them.
I have many items such as OSRAM/Sylania lamps, Wemo switches, Z-Wave devices such as thermostats, wall switches, etc plus Iris plugs and I think that Hubitat will help bring these all together along with all my XBee/Zigbee devices.
Hope this helps.
G.

1 Like

It's an excellent resource that I have gone through eagerly. The difference between that and what we were looking at is using the latest Xbee 3's which are programmable, whereas the wonderful work done there is mostly for using the Xbee as the modem device controlled by a separate MCU such as an arduino or raspberry pi. Programming the Xbee 3 as the MCU and only using it for communications between itself, HE and any GPIO connected peripherals is the challenge.

Although David hasn't done much work recently, I am trying hard to convince him to purchase a Hubitat. That will get him stimulated to create more content on Desert Home I am sure. Glad you found it useful.
I personally just received my C7 yesterday. I got two of my old Iris smartplugs working plus a GE Zigfbee wall switch in my office working. I am pretty happy so far. Now my next challenge it WEMO....oh God.

1 Like

No stage coach to Calgary. It's dog team and without any snow it gets to be a lot slower......It's a lot quicker in Texas.....

Hi! I´m new on all of this. Forgive-me if I do ask something stupid. Is it possible to use an old version of Xbee board (XB24-Z7wit) to connect with the Hubitat?

I don't have one but a quick look at the specs it should connect and work as a router and be able to map your zigbee network.

No such thing as a stupid question only stupid people who don't ask questions.

Hi NoWon. Thanks for your quick reply.
I did follow the basic procedure, settling my old Xbee:
• paste my Hubitat Pan ID number in the XTCU ID settings
• ensure KY is set to 5a6967426565416c6c69616e63653039
• ensure JV is set to 1
• select a NI name
And activate it as a “router” .
(I think this model of Xbee do not support programs (Am I correct?), so I didn’t find a way to save the “main.py”. But this part of the procedure is not necessary for the Hubitat to see the XBee, is it?)

After that, it insist in not appearing as a “zigbee device” after my Hubitat Hub tried to find it.

Is there something Else I can try?
Thanks in advance.

I am assuming you loaded the Xbee router settings

Yes the main.py python code is not supported in that older version of Xbee.

If in Hubitat scanning for new zigbee devices and resetting or power cycling the Xbee does not detect the Xbee.
Then it may already be joined as a ghost device.
To see if it is run XCTU and then scan the zigbee network (top right button and scan). If it shows all your zigbee devices connected then it is already joined to Hubitat network as a ghost device.
If it is the easiest way is just go in Hubitat hub and add a virtual device

  • use the Xbee3 DH posted in the top instruction post.
  • for device network id use the XCTU "MY" setting but add a zero in front of it
  • zigbee id setting in XCTU is "SH" and "SL" with zero zero in front of it
    example if SH = 3412 and SL = 8976 then the zigbee id would be 0034128976
    XCTU displays these settings more correctly with the required zero's if you go to the scan page and click on the Xbee device

done

If your Xbee is not joined as a ghost device try resetting the Xbee in XCTU by doing an Xbee recovery rewriting the Xbee firmware and write all the default settings to the Xbee then start over with all the Xbee3 router settings and your hubitat settings.
Then try and join the Hubitat network again.

1 Like

Hi NoWon, how are you?
I tried several times, unsuccessfully.
There is an extra difficulty with the old version: I do need to work configurations with an old version of XCTU, because the new one, do not recognize such old hardware (there is no firmware available for them ).
I´m attaching a picture of my XBee configs. Taking in consideration it´s old, please, if you can look for some mistaken setup I´ll appreciate.
Just in case we can`t really wok this out, I just ordered a Xbee3 (I´ll probably receive it next Wednesday ) and will definitely solve this.
But it would be very good for me to see my old Xbees speaking with the Hubitat ( I do have 10 of them here, without any foreseeing use ).
Thanks again for your effort in assist-me :wink:

Wow 10 of them I thought I was doing good with 5.
I am sure we can get them working.

here are the settings compared to mine

ZS = 2 (or at least 1 if no option for 2 this is likely the issue)
JN = 1
DL = FFFF
NH = FF
AR = 6
NO = 3
CR = 0
BD = 7 (115200)
AO = 1
SM = 0
SN = 130
SP = AF0
PR = FFFF

1 Like

Hey NoWon, thanks again for your assistance :blush:

I think we made a big progress today! But, unfortunately, not final yet. I´ll keep bothering you a little more…

I did copy the settings you did forward me into my old Xbee, and my Hubitat hub found it!!

But it keep initializing forever.

I tried to repeat the discovering process a few times, restarted the Xbee during the "Hubitat initializing waiting" and nothing made any difference.

Do you have any suggestions ?

using XTCU if you do a scan does it show all the zigbee devices in your Hubitat network?

  • If it does go in the Hubitat zigbee settings and see if there is device with the 64 bit address of 0013A20040B7A145
    If is not in there then add a virtual device with the network and zigbee id

  • if you do not see any devices in the XCTU scan except for the Xbee device
    during the Hubitat discovery does your xbee adapter board have a reset button? if so try pressing that during pairing instead of restarting or the reset is done but momentarily touching pin 5 (reset) and pin 10 (grnd) on the Xbee socket.

Also make sure KY is set to 5a6967426565416c6c69616e63653039 (and write) prior to pairing.

Hi NoWon, sorry the delay on my answer.
I did try everything. No success. The Hubitat Hub sees the Xbee, but refuses to configure it. There is no ghost connections.
I´ll rest my case. For now.
After tomorrow I´ll receive the XBee 3.0 I did buy, and will resume the test with it.
Maybe I´ll be able to see and use the old Bees, through the 3.0 :wink:
After Wednesday I´ll be back with some more infos.

Thanks again!

Np
Not that it should matter but what zigbee channel are you using in Hubitat?
I have found channel 20 to work best for some other difficult devices.

Hi! Matter of fact, I´m running on channel 20 :pensive:

This is completely off topic, but I´m very excited! Please, alow-me to celebrate a little with you!
I just implemented an ESP32 microcontroller, running "Hubduino" from Mr Ogiewon, with: a thermometer; 4 switches and a button. Operating nice and well with my Hubitat!

I´m really beginning to enjoy all these possibilities :wink:

2 Likes

Cool!
Have a ESP32 sitting on my desk just another project on my list.

Regarding the xbee XTCU scan only shows the xbee then correct?

Hi NoWon! Yes. At the scan, only the Xbee appears, no network at all.
My new Xbee 3 arrived. I´ll start the settings and tests in a few hours. I´ll keep you posted on my progress (or not.... hahahaha...).

Hi There!
How cool is that?!?
image

Thanks NoWon for all the assistance!
Now that I have a more friendly device running, I´ll try to include the old Bees as parte of the network.
Any news, I´ll let you know :slight_smile:
Once again, thanks for the help!