Husbzb-1 Zigbee2mqtt

1 view
Skip to first unread message

Giordano Thibault

unread,
Aug 4, 2024, 4:43:55 PM8/4/24
to trogemdefne
DescriptionThis scene switch is powered by battery,which is developed under for zigbee communication After connecting for zigbee gateway and adding on smart app,it allows you to quickly "set the scene'' for a particular...

All profiles use the same cluster definition so can normally work together, and in general, the binding will support multiple profiles. . There are some exceptions - eg Smart Energy Profile has additional security requirements that may prevent some devices being used on a ZHA network unless the ZHA network supports the SEP security concept, but that will not impact you here.


Progress. I was pressing the wrong button for pairing. It pairs now, but none of the switch channels show. I remember reading about this somewhere, so I need to do some more digging.

image728433 32.5 KB


That thread applies to the TS004x where x is a number, not the TS004F. Apparently the 4F is more flexible and requires a configuration message from the controller to put it in the desired operating mode.


It reports the correct buttons and the type of action (single, double, hold), the battery state and the link quality.

What I have not figured out yet is how to setup single channel per button + action, as zigbee2mqtt publishes everything a a single topic. My target would be to have separate channel per button at least,

best would be a channel per button+action.


Solved it on my own.

The trick is to use a proper transformation of the incoming value.

With a regular expression on the value of interest this can be achieved:

Example (React only on a single button press of button 1):


Here some example.

I have glued one of those switches under our dining table to be able to control the lights and other things in the room from where I am sitting without using Alexa, which can be disturbing during a conversation.

The example toggles the lights above the table using a blockly script (Item linked to the actor is called EG_EZ_Tischleuchte_Switch ) when performing a single short click on button 1 of the Tuya switch.

Your thingUID and channelUID will obviously be different.


Thanks for the additional info. I ended up getting it working in a different way by eliminating the transformations, using only only the universal button press trigger and using a switch statement in Rules-DSL.


I should note that you can use both sides of the stick at the same time (Zigbee via ZHA or zigbee2mqtt as well as ZWave via one of the ZWave integrations such as ZWave-JS) In either case you can only have one integration utilizing one side of the stick at a time.


If you've been using your Zigbee bridge with the ZHA integration and don't like some of the oddities of buttons using ZHA Events, etc or simply just want to detach from HA, or even enable support more devices; it's time to jump on over to Zigbee2MQTT. Previously there wasn't the ability to use Zigbee2MQTT if you were using the Sonoff Zigbee Bridge. It is currently in the development branch of Zigbee2MQTT if you want to give it spin. Trust me, it's well worth it!!


iTead also is now selling their USB 3.0 dongle that uses the same chip as the Zigbee Bridge. It is preflashed with correct firmware out of the box that can also be used with ZHA and Zigbee2MQTT using the same procedure as below with the USB port.


If you are using the ZHA integration at this time I would suggest removing all your devices from the ZHA integration and then remove the integration itself as you can not point two integrating pieces of software at the bridge at the same time. If you were using TasmotaZigbee or using a newly flashed Sonoff Zigbee Bridge, follow the guide to set the correct template and rules to start the TCP server on the bridge. Once you get to the Home Assistant part adding it as ZHA, stop following the guide.


"Supervisorless" installs of Home Assistant, you'll simply need to pull the docker container for zigbee2mqtt, a recent production or developer build is fine.. More info can be found here.


The configuration to use the bridge will be very similar for both Supervisor and non-Supervisor installs. Either in the add-on configuration or the configuration.yaml file for the docker container, the adapter configuration is (replace the IP address with your local bridge IP):


If this is your first install I would highly recommend skimming through the docs for additional setup options at and please remember to secure your network by by setting the network key as GENERATE. Sorry Supervisor users you'll need to make up your own random key as it doesn't seem to be supported by the supervisor yet. See more here - -zigbee2mqtt/issues/41


Once you have it configured, start up the container/add-on and fingers crossed...check the logs to see if everything started correctly. If not, be sure your bridge rule is still enabled to start the TCP server on port 8888 and your network can reach it.


Enjoy! Open the GUI interface and start pairing up your devices. If you have some additional info to post in order to help with the testing and development of this adapter type, you can share it here: -herdsman/issues/319

3a8082e126
Reply all
Reply to author
Forward
0 new messages