Everything Xbee

I'm wondering how to get digital IO pin control through Micropython on the xbee. I think i have the IO pin control figured out on the Xbee side. It's getting those commands to the board via a Driver is what has me very confused. I'm not up on Zigbee.

This could be a Zigbee alternative to the Hubduino device. And since the xbee has much deeper sleep functions, battery operated devices become possible again.

I had this as well, but it was rectified when the battery percentage propogated. I was getting errors when under Current States there was no battery - just presence.

I see you have the scan on for about an hour. That's probably not long enough to get all the end point devices. It's all depending on what type of devices you have.

Thanks @mike. It resolved itself in the end. HE was behaving badly last night so I had to reboot and since that it’s been working fine

I take a look at that but if I remember correctly, the temperature was the internal temperature of the Xbee and not the environmental temperature, that is why didn’t include it

The Xbee processor power is much lower. I am not sure how reliable you get that done. Anyhow, I actually just received an LCD display that I want to hook up to my Xbee to get some feedback on presence detection while driving around. That should give me some data to compare

ok with my Xbee3 routers powered off I was able to get my Xbee3 end device to go present and departed repeatedly after sitting powered off over night.
I would still recommend using an Xbee3 router with the Xbee3 end device but it appears to work without it.
If you add a Xbee3 router device and power cycle the Xbee3 end device it will jump over to the Xbee3 router

You will have to input the ID info from your Hubitat zigbee info when you load the file below

Xbee3 end device

You will have to input the ID info from your Hubitat zigbee info when you load the file below
Xbee3 router

yes documentation says it is internal temp and didn't test it for temp changes it may just be a coincidence that it was within 1-2 degrees of my house.

a little more testing and noticed that after the Xbee3 end device jumped to the Xbee3 router if I powered off all the Xbee3 routers and cycled the Xbee3 end device power it did not want to jump back to the Hubitat hub or any other (non Xbee3) router devices.
but if I powered a different Xbee3 router (I have 3 ) then the Xbee3 end device join automatically again no problem (no prower cycle required). The Xbee3 routers are all programmed the same expect for their NI (node identifier's).
If I power off just the Xbee3 router it is going through the end device will go departed but then will automatically rejoin through another Xbee3 router and change back to present.
If I change the time to depart from 1 minute back to 5 minutes I should not even see this depart and present cycle.
So once the Xbee3 end device uses an Xbee3 router it must go through the hub joining process to use any other type of router it will not jump backwards to them.
odd behavior but not really a big deal.
Still this demonstrates that the Xbee3 end device is automatically rejoining but only to another Xbee3 router. There must still be another setting missing or perhaps we can send a JV or JN request via the micropython but that should not be required.

You are correct
never mind about the temperature reading I thought it was displaying in decimal
it's description says "Read power compensation temperature sensor in units of Celsius degrees."
but it is in Hex so is not relative temp reading compared to room temp.
25 in Hex would be 37 in decimal not quite that hot in my house.

update to improve zigbee mesh for an Xbee3 end device change AR = FE (every 42 minutes)
default had it set to FF which is off.
This way if the router that the end device is going through powers off the Xbee3 end device automatically goes through another Xbee3 router.
you will not see a depart/present cycle
It did not help non Xbee3 routers unfortunately.

I've officially given up trying to get my Xbee presence to work. I was never able to get it to work with any type of consistency. Either router of hub would drop off the network constanly. In the end, it just wasn't worth the hassle trying to get it to work when it appears it just won't. If you ever get it working more reliably, I'll try again. But for now, the Xbee's are going back in the box.

I have been playing with my Xbee3 for the last 2 weeks leaving them powered on 24/7 next to my computer to see how they behave with different settings mainly different report timing from the micro python.
SmartThings arrival sensors report every 20 seconds
Dan.T's default Xbee3 python code reports every 60 seconds
I tested 10 seconds, 30 seconds and 60 seconds
I also last week added a new second hub just for zigbee and reran the tests to confirm what I was seeing.
First make sure you are not getting any errors in your logs for your Xbee3 devices.
I had one that when I added to my new hub was getting a lot of java errors in the logs.
I double checked all of it's settings and rewrote it's python code then removed and re-paired it until it's logs were reporting correctly.
There should be no errors.

I also noticed with 30 second and 60 second reporting I would get 1-2 during a 12 hour period of random depart arrives usually less than 1 second apart you could see in the device event page.
mostly they did not even trigger a rule they were so fast (a couple of times they did trigger a rule).
I found for 30 seconds I had to set the device settings depart time to 2 minutes or more (in device settings) to not see those random depart/arrives and for micro python 60 seconds I had to use 3 minutes or more.

With 10 second micro python transmitting I did not see any random depart/arrive in the events.

I also found I had 1 faulty USB adapter board in my testing (something to watch for).

To change the report time in micro python change this line
time.sleep_ms(60000)

60 seconds = time.sleep_ms(60000)
30 seconds = time.sleep_ms(30000)
10 seconds = time.sleep_ms(10000).

SmartThings arrival sensors use 20 seconds I did not test 20 seconds with the Xbee3.
but I am going to use 10 seconds since mine will only be powered when the car is running.

@dan.t
curious if you have seen the same behavior and what screen and how did you attach to your Xbee3?

last note if you are using multiple Xbee3 routers I also changed Xbee3 setting AR from FE (42 minutes) to 6 (1 minute). Just makes the Xbee3 network update every minute for testing instead of waiting 42 minutes. It is supposed to update when the Xbee3 first boots up but I didn't see that happen but maybe I had to reboot them all for them to update the route. Every 1 minute does not seem to affect their performance.

@Ryan780
You say both the Xbee3 router and end device would drop off you network sounds more like a lot of interference on your zigbee network what channel are you using?
Have you scanned your network with the spectrum analyzer in XTCU or moved your 2.4 home wifi away from your zigbee channel?
or maybe a bad USB adapter.

Believe it or not but I am still working on my general zigbee network with the Xbee's. I have 3 XB3-24Z8ST (RP SMA antenna) but I am not happy with the performance. My upstream LQI is wonderful (255) but my downstream LQI is horrible (110 - 90). I used antennas of an old Wifi router that I still had, now I just received some new 9DBi gain antennas but still don't like the performance. It improved, but not much.... I am getting 2 XB3-24Z8PT (pcb antenna) delivered tomorrow and I am going to compare the performance.

I first want to have a stable good network before I mess too much with the arrival sensor to avoid mixing up results.

Right now my Xbees are set to 42 minutes for AR.

The Router, if powered constantly would never drop off the network. But as soon as my endpoint (presence) device would leave the network for any length of time it would not rejoin automatically. I would have to rediscover it in the HE app in order for it to be recognized into the network again. After doing this 3 times in a row I figured that's just the way that it's going to work. So, I gave up. I have an alternate solution that I've been using for a long time and the new hubitat app seems to work off of whatever location my phone is using. And since I normally have my phone hooked up to my car through Android Auto when I'm driving and normally have Waze running, it updates very quickly. I actually had to make the radius around my house smaller it was tripping so quickly. That combined with my old Home Link button settup I should be fine with what I've got. I just have spent so much time trying to get it to work that it feels like any more would just be wasted. I do appreciate your help though.

pretty much exactly what I am using
three XB3-24Z8ST RP SMA antenna and one XB3-24Z8PT pcb antenna

the PCB antenna definitely appears stronger as you can see from the picture below.
The top right are my Xbee3 routers and end devices and coordinator (hub)
the PCB is 9981 and shows 255/255
the RP SMA with a 12 dbi antenna is 0B8F and shows 255/153
This is as expected as the 12 dbi antenna creates a doughnut like signal with the center being weaker than farther out.
Thus the 12 dbi even though showing a lower signal will transmit farther.

I've just had a similiar problem. My XBee keeps on dropping off the network upon reboot. I've configured it as a router, but upon reboot, the two parameters OP and OI would get deleted. XCTU would say "resetting device", but those were the only two parameters that were deleted - nothing else.

Then I somehow managed to not delete them upon a reboot, not sure how. But I hope it's working again. I'm reticent to try connecting it up to a computer again for scanning zigbee network. Normally it sits by itself connected to a USB hub being a boss on my zigbee network. But it's had a huge dummy spit tonight.

Here is one observation I made with my routers.

a. Set the parameter ID to your PAN ID for Hubitat
b. After joining the Xbee to Hubitat, change the parameter JV to 0.

Once I did that, the router stopped dropping of my Hubitat.

@mike and @Ryan780

I was able to replicate your Xbees dropping off problem
using 2 Xbee3 configured as end devices (same settings) sitting on the desk next to each other on power cycle both would become present but 1 would drop off after a minute or 2.
comparing XTCU readings I noticed AI had changed from 0 to 23 on the one that dropped off.
0 = successful
0x23 - Valid PAN found, but joining is currently disabled

but why would one stay and the other drop off
I assume it is similar to pairing a device to the hub and sometimes they do not pair (join) correctly.
Then disabling joining (JV=0) will not let them repair themselves.
I had to set both my Xbee3 router and end device JV=1 then power cycled (or reset button) all devices.
I tried just setting the end device and router JV=1 separately but did not fix the issue.
I have power cycled both end devices so the say departed and then powered back on several times now and all are staying connected.
I am going to leaving JV=1 for today and take my one Xbee3 end device to work with me and see how it responds when I return.

Tomorrow I will set JV=0 on all of them and again take it work and see how it responds when I come home again.

unfortunately in 2 days I am going overseas for 5 weeks but hopefully this fixes your issues.