How to manage paired devices with Tasmota ZB-GW03 hub in Home Assistant

You need to manually create MQTT entities in configuration.yaml,

See

and

Thanks Francis, these are useful suggestions. Now I have working via the console of the zigbee bridge to turn on and off the plug via:
ZbSend { “device”:“0x57XX”, “send”:{“Power”:“1”} }
ZbSend { “device”:“0x57XX”, “send”:{“Power”:“0”} }
However how can I create a button in HA to integrate this plug via these commands? So far I have not understood this via the ‘Instructions on how to setup MQTT within Home Assistant’. Can you point me in the right direction?

There are examples here:
https://thehelpfulidiot.com/how-to-use-zigbee2tasmota-with-home-assistant

I have updated HA to 2024.3.3 which was needed to be able to use mqtt in the configuration.yaml config file. However I have tried different templates but unfortunately I still not managed to add a switch symbol in HA which I can use to toggle my power-plug with device ID:“0x57XX” to turn this power plug on and off, what I can manage via the console of the Tasmota brige with
ZbSend { “device”:“0x57XX”, “send”:{“Power”:“1”} }
ZbSend { “device”:“0x57XX”, “send”:{“Power”:“0”} }

install mqtt-explorer ( https://mqtt-explorer.com/ ) and show exactly what topic and message is received
(text, not a screenshot, that is to difficult to type over without mistakes)

Hi, hereby:

10.10.10.209

▼tele

▼tasmota_2D3B58

LWT = Online

SENSOR = {“ZbReceived”:{“0x57C5”:{“Device”:“0x57C5”,“CurrentSummationDelivered”:“0x000000000001”,“RMSVoltage”:231,“RMSCurrent”:0,“ActivePower”:0,“Endpoint”:1,“LinkQuality”:42}}}

▼tasmota

▼discovery

▼08D1F92D3B58

config = {“ip”:“10.10.10.203”,“dn”:“Ali-bridge”,“fn”:[“Ali-bridge”,null,null,null,null,null,null,null],“hn”:“tasmota-2D3B58-7000-eth”,“mac”:“08D1F92D3B58”,“md”:“ZB-GW03”,“ty”:0,“if”:0,“ofln”:“Offline”,“onln”:“Online”,“state”:[“OFF”,“ON”,“TOGGLE”,“HOLD”],“sw”:“13.2.0”,“t”:“tasmota_2D3B58”,“ft”:“%prefix%/%topic%/”,“tp”:[“cmnd”,“stat”,“tele”],“rl”:[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0…

sensors = {“sn”:{“Time”:“1970-01-02T03:42:50”},“ver”:1}

▼$SYS

▼broker

version = mosquitto version 2.0.18

uptime = 748 seconds

▼clients

total = 3

inactive = 0

disconnected = 0

active = 3

connected = 3

expired = 0

maximum = 3

▼load

▼messages

▼received

1min = 4.32

5min = 4.46

15min = 2.87

▼sent

1min = 38.95

5min = 24.55

15min = 11.22

▼publish

▼dropped

1min = 0.00

5min = 0.00

15min = 0.00

▼received

1min = 0.80

5min = 0.92

15min = 0.77

▼sent

1min = 29.50

5min = 18.49

15min = 8.10

▼bytes

▼received

1min = 157.08

5min = 191.34

15min = 153.48

▼sent

1min = 929.31

5min = 771.60

15min = 404.42

▼sockets

1min = 0.13

5min = 0.29

15min = 0.24

▼connections

1min = 0.13

5min = 0.27

15min = 0.20

▼messages

stored = 56

received = 66

sent = 547

▼store

▼messages

count = 56

bytes = 1130

▼subscriptions

count = 15

▼shared_subscriptions

count = 0

▼retained messages

count = 56

▼heap

current = 74656

maximum = 75792

▼publish

▼messages

dropped = 0

received = 19

sent = 501

▼bytes

received = 2549

sent = 6087

▼bytes

received = 4013

sent =

mqtt:
  switch:
    - unique_id: "996080f7-aaa9-4850-baed-31c9298d6956"
      name: "whatever"
      state_topic: "tele/tasmota_2D3B58/SENSOR"
      value_template: "{{ value_json['ZbReceived']['0x57C5']['Power'] }}"
      state_on: 1 
      state_off: 0 
      command_topic: "cmnd/tasmota_2D3B58/ZbSend"
      payload_on: '{"device":"0x57C5","send":{"Power":"On"} }' 
      payload_off: '{"device":"0x57C5","send":{"Power":"Off"} }'
      availability_topic: "tele/ttasmota_2D3B58/LWT"
      payload_available: "Online"
      payload_not_available: "Offline"
      optimistic: false
      qos: 0

Thanks! I paste this config in the configuration.yaml file and I got the switch available in the entities. However it is in the state “Unavailable” and greyed out. However it is connected and still reple via the Tasmota console:
15:14:29.329 CMD: ZbSend { “device”:“0x57C5”, “send”:{“Power”:“1”} }
15:14:29.335 MQT: stat/tasmota_2D3B58/RESULT = {“ZbSend”:“Done”}
15:14:30.230 MQT: tele/tasmota_2D3B58/SENSOR = {“ZbReceived”:{“0x57C5”:{“Device”:“0x57C5”,“Power”:1,“Endpoint”:1,“LinkQuality”:68}}}

I saw the error, one t too many

afbeelding

should be

"tele/tasmota_2D3B58/LWT"

Hello, this has done the job indeed! Thanks for this. It is still reasonable complicated for me.
I went further since I have got a second power plug and a humidity /temperature sensor. I used the following yaml config:

mqtt:
switch:
- unique_id: “996080f7-aaa9-4850-baed-31c9298d6956”
name: “Plug-Ali-1”
state_topic: “tele/tasmota_2D3B58/SENSOR”
value_template: “{{ value_json[‘ZbReceived’][‘0x57C5’][‘Power’] }}”
state_on: 1
state_off: 0
command_topic: “cmnd/tasmota_2D3B58/ZbSend”
payload_on: ‘{“device”:“0x57C5”,“send”:{“Power”:“On”} }’
payload_off: ‘{“device”:“0x57C5”,“send”:{“Power”:“Off”} }’
availability_topic: “tele/tasmota_2D3B58/LWT”
payload_available: “Online”
payload_not_available: “Offline”
optimistic: false
qos: 0

switch:
- unique_id: “996080f7-aaa9-4850-baed-31c9298d6957”
name: “Plug-Ali-2”
state_topic: “tele/tasmota_2D3B58/SENSOR”
value_template: “{{ value_json[‘ZbReceived’][‘0x5796’][‘Power’] }}”
state_on: 1
state_off: 0
command_topic: “cmnd/tasmota_2D3B58/ZbSend”
payload_on: ‘{“device”:“0x5796”,“send”:{“Power”:“On”} }’
payload_off: ‘{“device”:“0x5796”,“send”:{“Power”:“Off”} }’
availability_topic: “tele/tasmota_2D3B58/LWT”
payload_available: “Online”
payload_not_available: “Offline”
optimistic: false
qos: 0

sensor:
- unique_id: “996080f7-aaa9-4850-baed-31c9298d6958”
name: “Temperatuur Ali 1”
state_topic: “tele/tasmota_2D3B58/SENSOR”
suggested_display_precision: 1
unit_of_measurement: “°C”
value_template: “{{ value_json[‘ZbReceived’][‘0xB064’][‘Temperature’] }}”
sensor:
- unique_id: “996080f7-aaa9-4850-baed-31c9298d6959”
name: “Vocht Ali 1”
state_topic: “tele/tasmota_2D3B58/SENSOR”
unit_of_measurement: “%”
value_template: “{{ value_json[‘ZbReceived’][‘0xB064’][‘Humidity’] }}”

Two problems:
-The first sensor entity Plug-Ali-1is not available anymore. I changed the device ID and I also added 1 to the unique ID. Is that not sufficient?
-I get empty charts with the humidity/temperature sensor “Temperatuur Ali 1” and “Vocht Ali 1”

From the Tasmota console I read:
18:58:21.447 MQT: tele/tasmota_2D3B58/SENSOR = {“ZbReceived”:{“0xB064”:{“Device”:“0xB064”,“Temperature”:17.5,“Humidity”:63.1,“Endpoint”:1,“LinkQuality”:14}}}

But using the command in this console
19:26:34.393 CMD: ZbReceived { “device”:“0x57C5”, “read”:{“Temperature”} }
I get
19:26:34.401 MQT: stat/tasmota_2D3B58/RESULT = {“Command”:“Unknown”}

Do i use wrong syntax here of is my method for these sensors wrong?

Please format your code

You can easily create unique id’s on this site

Because it is

mqtt:
  switch
    - unique_id: "996080f7-aaa9-4850-baed-31c9298d6956"
      name: "whatever"
      state_topic: "tele/tasmota_2D3B58/SENSOR"
      value_template: "{{ value_json['ZbReceived']['0x57C5']['Power'] }}"
      etc ...
    - unique_id etc..

and not

mqtt:
  switch:
    - unique_id: 
  switch
   - unique_id ..

same for sensor

  sensor:
    - unique_id: "c727f4b5-1a14-440e-bd0b-52274dcfc4ff"
      name: “Temperatuur Ali 1”
      state_topic: "tele/tasmota_2D3B58/SENSOR"
      value_template: "{{ value_json['ZbReceived']['0x57C5']['Temperature'] }}"
      availability_topic: "tele/tasmota_2D3B58/LWT"
      payload_available: "Online"
      payload_not_available: "Offline"
      qos: 0
      device_class: "temperature"
      unit_of_measurement: '°C'

    - unique_id: "38a96f91-a393-4ba4-bcdd-189bcfb2f738"
      name: “Vocht Ali 1”
      state_topic: "tele/tasmota_2D3B58/SENSOR"
      value_template: "{{ value_json['ZbReceived']['0x57C5']['Humidity'] }}"
      availability_topic: "tele/tasmota_2D3B58/LWT"
      payload_available: "Online"
      payload_not_available: "Offline"
      qos: 0
    device_class: "humidity"
    unit_of_measurement: '%'

Thanks again, this cleared up the disappeared power plug.
The sensors do also exist now, however the data is still unknow. For some reason the temperature and humidity variables does not reach the entity in HA.
By the way; do you use a generator for the unique id’s or do you extract these from somewhere?

I forgot to change 0x57C5 to 0xB064 in the sensors

I missed this device ID’s too, but corrected them now. Unfortunately still unknown data.

sensor:
- unique_id: “c727f4b5-1a14-440e-bd0b-52274dcfc4ff”
name: “Temperatuur Ali 1”
state_topic: “tele/tasmota_2D3B58/SENSOR”
value_template: “{{ value_json[‘ZbReceived’][‘0xB064’][‘Temperature’] }}”
availability_topic: “tele/tasmota_2D3B58/LWT”
payload_available: “Online”
payload_not_available: “Offline”
qos: 0
device_class: “temperature”
unit_of_measurement: ‘°C’

- unique_id: "38a96f91-a393-4ba4-bcdd-189bcfb2f738"
  name: “Vocht Ali 1”
  state_topic: "tele/tasmota_2D3B58/SENSOR"
  value_template: "{{ value_json['ZbReceived']['0xB064']['Humidity'] }}"
  availability_topic: "tele/tasmota_2D3B58/LWT"
  payload_available: "Online"
  payload_not_available: "Offline"
  qos: 0
  device_class: "humidity"
  unit_of_measurement: '%'

I usually blow on them to get them to update :slight_smile:

This is still not correct, wrong " (copying from unformatted code wrangles the ")

I have blown on them and suddenly it worked. For sure I have also replaced the wrangled " for normal ones :slightly_smiling_face:
Anyway; many thanks for sharing your experience and your quick replies. Everything works now!

1 Like

Hello, another issue: I bought a ZigBee PIR Motion Sensor.
The console output when there is motion:

01:06:47.113 MQT: tele/tasmota_2D3B58/SENSOR = {“ZbReceived”:{“0x7E65”:{“Device”:“0x7E65”,“ZoneStatus”:1,“Occupancy”:1,“Endpoint”:1,“LinkQuality”:37}}}

I tried to use the same template as for the other sensor, so I add in config.yaml:
- unique_id: “49b96f91-a393-4ba4-bcdd-189bcfb2f849”
name: “Beweging achter”
state_topic: “tele/tasmota_2D3B58/SENSOR”
value_template: “{{ value_json[‘ZbReceived’][‘0x7E65’][‘ZoneStatus’] }}”
availability_topic: “tele/tasmota_2D3B58/LWT”
payload_available: “Online”
payload_not_available: “Offline”
qos: 0
device_class: “motion”
unit_of_measurement: ‘motion’

Unfortunately it gives errors:
Error: expected SensorDeviceClass or one of ‘date’, ‘enum’, ‘timestamp’, ‘apparent_power’, ‘aqi’, ‘atmospheric_pressure’, ‘battery’, ‘carbon_monoxide’, ‘carbon_dioxide’, ‘current’, ‘data_rate’, ‘data_size’, ‘distance’, ‘duration’, ‘energy’, ‘energy_storage’, ‘frequency’, ‘gas’, ‘humidity’, ‘illuminance’, ‘irradiance’, ‘moisture’, ‘monetary’, ‘nitrogen_dioxide’, ‘nitrogen_monoxide’, ‘nitrous_oxide’, ‘ozone’, ‘ph’, ‘pm1’, ‘pm10’, ‘pm25’, ‘power_factor’, ‘power’, ‘precipitation’, ‘precipitation_intensity’, ‘pressure’, ‘reactive_power’, ‘signal_strength’, ‘sound_pressure’, ‘speed’, ‘sulphur_dioxide’, ‘temperature’, ‘volatile_organic_compounds’, ‘volatile_organic_compounds_parts’, ‘voltage’, ‘volume’, ‘volume_storage’, ‘volume_flow_rate’, ‘water’, ‘weight’, ‘wind_speed’ for dictionary value @ data[‘device_class’].

I tried as well:
motion:
- unique_id: “49b96f91-a393-4ba4-bcdd-189bcfb2f849”
name: “Beweging sensor achter 1”
state_topic: “tele/tasmota_2D3B58/MOTION”
availability_topic: “tele/tasmota_2D3B58/LWT”
payload_available: “Online”
payload_not_available: “Offline”
device_class: motion

but that is invalid as well; Integration ‘motion’ not found.

Any suggestion how to define this ZigBee PIR Motion Sensor in configuration.yaml so that it will become available as enitity?

I found out myself:

In configuration.yaml:

binary_sensor:
- unique_id: “c727f4c6-1a15-441e-bd1b-52274dcfc3ee”
name: “Beweging Ali 1”
state_topic: “tele/tasmota_2D3B58/SENSOR”
payload_on: “1”
payload_off: “0”
availability:
- topic: “tele/tasmota_2D3B58/LWT”
payload_available: “Online”
payload_not_available: “Offline”
qos: 0
device_class: “opening”
value_template: “{{ value_json[‘ZbReceived’][‘0x7E65’][‘ZoneStatusChange’] }}”