#Changing Zigbee channels
1 messages ยท Page 1 of 1 (latest)
I can't get Zigpy to work on HA core
Save this script as something like change_network_channel.py within your /config/ folder: https://dpaste.org/KOAHo
@quasi cliff then run it just like you did the energy scan tool: python /config/change_network_channel.py -v --channel 20 /dev/serial/by-id/...
None of your battery operated devices will migrate (though some could!) but I just tested it with a small network of a ZNP coordinator and a few bulbs and they all switched channels after ZHA was restarted
If you have any battery-powered devices that are practically impossible to rejoin due to location (and aren't Aqara) it's in theory possible to modify the script to migrate them as well, but it'll require a ton more effort
@sudden quiver thanks! I've saved it, I'll let you know how it went
and it's great, if this works, It'd save me a lot of effort anyway
Sounds good. There's no way to view the current channel within ZHA so run a network backup afterwards just to triple check
rejoining a few sensors is not that much of a bother in comparison
will do!
tbh most of my sensors are aqara lol
Yeah you're out of luck with those sensors, they're effectively send-only devices after they join and don't implement this part of the spec to begin with ๐
lovely!
But now that they've joined it should be very easy to re-join them, since ZHA knows all it needs to know about the device
just the matter of finding them physically.
One thing to watch out for is that they can get into a state where their battery has just enough juice to send periodic reports, but not enough to actively scan for and join a new network. You may have to change batteries if you've been using them for a few years if they don't seem to reliably re-join.
yes, I did notice weird pairing behaviours depending on battery level...
welp, a round of general maintenance with fresh batteries for the network won't hurt
thanks again
And Aqara sensors don't have reliable battery reporting to begin with so you just gotta check by feel and how alive the blue LED looks ๐
No problem, let me know how it turns out
Worked, thank you!
2022-06-12 23:30:09 DEBUG (MainThread) [zigpy_znp.nvram] Read NVRAM["LEGACY"][0x0021] = NIB(SequenceNum=139, PassiveAckTimeout=5, MaxBroadcastRetries=2, MaxChildren=51, MaxDepth=15, MaxRouters=51, dummyNeighborTable=0, BroadcastDeliveryTime=30, ReportConstantCost=0, RouteDiscRetries=0, dummyRoutingTable=0, SecureAllFrames=1, SecurityLevel=5, SymLink=1, CapabilityFlags=143, TransactionPersistenceTime=7, nwkProtocolVersion=2, RouteDiscoveryTime=13, RouteExpiryTime=30, nwkDevAddress=0x0000, nwkLogicalChannel=20, nwkCoordAddress=0x0000, nwkCoordExtAddress=00:00:00:00:00:00:00:00, nwkPanId=4620, nwkState=<NwkState.NWK_ROUTER: 8>, channelList=<Channels.CHANNEL_15: 32768>, beaconOrder=15, superFrameOrder=15, scanDuration=4, battLifeExt=0, allocatedRouterAddresses=1, allocatedEndDeviceAddresses=1, nodeDepth=0, extendedPANID=f8:df:0f:0f:e1:f5:64:4d, nwkKeyLoaded=<Bool.true: 1>, spare1=NwkKeyDesc(KeySeqNum=0, Key=00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00), spare2=NwkKeyDesc(KeySeqNum=0, Key=00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00), spare3=0, spare4=0, nwkLinkStatusPeriod=15, nwkRouterAgeLimit=5, nwkUseMultiCast=<Bool.false: 0>, nwkIsConcentrator=<Bool.true: 1>, nwkConcentratorDiscoveryTime=120, nwkConcentratorRadius=10, nwkAllFresh=1, nwkManagerAddr=0x0000, nwkTotalTransmissions=2, nwkUpdateId=1
lost all battery operated buttons, aqara opple and ikea, a couple of thermo sensors, and a single bulb, for some reason
a tuya battery operated thermostat held out though
the only reliable way to get them back for me is to delete the device from the integration and rejoin, but still, not a big deal all in all
thanks again ๐
Thanks for the feedback!
You should be able to just permit joins and reset the device, without having tor remove it
i tried handle_join and misc_reinitialize from the zha toolkit, calling the devices via ieee, but that didn't work
ah, i see, there's zha.permit
Just the + Add Device button is fine
yup, worked fine ๐