GPIO inputs

Inversed – By default, the firmware interprets the LOW state on the input pin as a pressed state of a button. If this option is enabled, the HIGH state means the pressed button.

Link – The input immediately controls the state of the corresponding output (e.g. Input 1 – Output 1). The device sends the on/off state of the output to a coordinator. Otherwise, the input is independent.

Long – The firmware detects and reports to the coordinator a long click (2000 ms).

Double – The firmware detects and reports a double click (max 500 ms between clicks).

Triple – The firmware detects and reports a triple-click (max 500 ms between clicks).

Switch – an input works as a switch. Only ON (pushed) / OFF (released) states. This option works if the input is linked to the corresponding output. When the switch changes a state, the firmware immediately reports a state of the output. The output can be a virtual (i.e. assigned to any unused pin number).

Toggle – this options appears for a switch input. The switch works as a toggle button. But because the ON/OFF state can be changed via external commands, a physical button position may differ with an output state.

Note: Input 1, if it is defined as a click button, also acts as a system button and allows you to reset the device if you press and hold that button for 10 seconds. After resetting, the device start a paring process.

Zigbee cluster: ZCL_CLUSTER_ID_GEN_MULTISTATE_INPUT_BASIC
Zigbee attribute: ATTRID_IOV_BASIC_PRESENT_VALUE
Data type: UINT8 (1 – single click, 2 – double click, 3 – tripple click, 4 – long press (more than 1500 ms))

GPIO outputs

Inversed – By default, the firmware sets the output pin to HIGH when a logical state is ON. You may invert that logic using this option.

Remember state – The firmware saves the output state to NVRAM and restores it after power off/on. Also, this option works for some sensors (counter, PWM)

Zigbee cluster: ZCL_CLUSTER_ID_GEN_ON_OFF
Zigbee attribute: ATTRID_ON_OFF.

Zigbee2MQTT commands

on/off – sets the output to the HIGH or LOW state
Topic: z2m/[friedly_name]/[channel]/set
Channel: l1, l2, l3 … l8
Payload: ON or OFF

read – sets the output to the HIGH or LOW state
Topic: z2m/[friedly_name]/[channel]/get/state
Channel: l1, l2, l3 … l8
Returns: The channel state {“state_[channel]”: “ON”}

trigger – sets the output to the HIGH state for N seconds, then resets to LOW. Topic: z2m/[friedly_name]/[channel]/set
Channel: l1, l2, l3 … l8
Payload: {“trigger”: 5000}

Analog inputs (ADC)

You may define up to 8 analog inputs in the configuration. You must connect analog inputs to pins P00 .. P07.

The firmware reads analog values when it sends a periodic report to a host. When the periodic report is disabled you should send the “read” request for the configured endpoint.

Analog input, accurate (max 1.15V) – the pin uses internal reference voltage that is more precise than a source voltage.

Analog input, (max 3.3V) – less accurate, but it can measure higher voltage.

Source voltage – reports source power voltage. It can be used to monitor a battery level. You may assign this sensor to any unused pin.

Internal temperature – reports the temperature of the CC2530 chips. You may assign this sensor to any unused pin.

Zigbee cluster: ZCL_CLUSTER_ID_GEN_ANALOG_INPUT_BASIC
Zigbee attributes:
ATTRID_IOV_BASIC_PRESENT_VALUE – the sensor value (single precision float).
ATTRID_IOV_BASIC_DESCRIPTION – the value units (V – voltage, C – temperature).

Zigbee2MQTT commands

read – immediately reads the analog input value
Topic: z2m/[friedly_name]/get/[channel]
Channel: l1, l2, l3 … l8
Payload: 1
Returns: The channel state {“[channel]”: float_value}

UART

The UART interface is designed to send text or hex commands between an external device (e.g. Arduino) and a host.

The maximum command size is 127 bytes. Every command line may terminate with a special configurable byte: CR (0x0D), LF (0x0A) or 0x03 (ETX). The firmware also adds the ending signature to each of the commands that the device receives from a host and outputs to UART. If the end signature is not defined, the firmware waits 300 ms and outputs the whole buffer to a host.

UART uses P02 and P03 pins (3.3V). You should enable UART on P02 on an output pin in the configuration.

You can also select a baud rate for the UART interface in the firmware configuration.

UART configuration. P02 is required. P03 is optional.

Zigbee cluster: ZCL_CLUSTER_ID_GEN_MULTISTATE_VALUE_BASIC
Zigbee attributes: ATTRID_IOV_BASIC_STATE_TEXT – UART data. You should use the “ZCL_DATATYPE_OCTET_STR” (0x41) or “ZCL_DATATYPE_CHAR_STR” (0x42) data types for this attribute.

Zigbee2MQTT commands

write – sends data to a UART.
Topic: z2m/[friedly_name]/set/action
Payload: text command
The following command allows you to send any bytes. The first byte in the array (2) is the number to bytes following the length.
Topic: z2m/[friedly_name]/set
Payload: {“action”: [2, 0, 0]}

External sensors

The firmware supports up to 8 external sensors of different types. Keep in mind, that CC253x has limited performance. You cannot attach 8 sensors, 4 inputs, UART and get a good result. Some sensors cannot co-exist with each other.

Common Zigbee information for all external information:
Zigbee cluster: ZCL_CLUSTER_ID_GEN_ANALOG_INPUT_BASIC
Zigbee attributes:
ATTRID_IOV_BASIC_PRESENT_VALUE – the sensor value (single-precision float).
ATTRID_IOV_BASIC_DESCRIPTION – the value units (V – voltage, C – temperature, % – humidity, m – altitude, ppm – air quality, CO2, TVOC).
Zigbee commands: read

I2C sensors

You should define a pin for a sensor first. It is the SDA pin. Then you should define the SCL pin. For example, output 4 – BME280, and output 5 – I2C SCL.

I2C configuration for a sensor

If you connect several sensors on one bus (pin) you may define the SCL pin only once.

This image has an empty alt attribute; its file name is img1-4.png
I2C configuration for sensors on one bus

Zigbee: Accepts the “read” and “write” commands on the endpoint for the SDA pin.

CCS811

The sensor requires environmental temperature and humidity for better results. The example above shows that several I2C sensors are connected on the same bus. They provide the necessary data. These sensors should be defined first. If they are defined after CCS811, environmental info will be ignored by CCS811.

You may also send temperature and humidity from a higher system.

Analog value: 65NNN where NNN is a humidity value, for example, 65050 for 50%. Humidity range: 0 … 50.
Analog value: 64NNN where NNN is a temperature value, shifted by 25. For example, 64000 for -25C, 64025 for 0C, 64050 for 25C. Temperature range: -25 … 100.
Analog value: 0 .. 63999 – baseline value (see docs for CCS811).

Zigbee2MQTT commands

write – writes calibration data.
Topic: z2m/[friedly_name]/set/[channel]
Channel: l1, l2, l3 … l8
Payload: value

DS18B20

The firmware supports up to 4 sensors on one line. If you didn’t specify the sensor ID in the settings, the firmware sends all values to one endpoint but with a different description like “C,00-00-00-00-00” (unit, comma, device ID).

You may specify the same pin number, sensor type, and sensor ID on different endpoints. In this case, the firmware will send the sensor value to the corresponding endpoint.

Pulse generator

You may use this generator to wake-up Atmega-based external sensor. The external sensor should measure value and output it to a UART port.

Pulse counter

It is 32 bit counter with the 10 milliseconds debounce interval. Therefore it cannot be used for high-frequency signals. If an interval is defined, the counter automatically resets after that interval and reports the counted values to a coordinator.

Zigbee2MQTT commands

read – immediately reads the counter value.
Topic: z2m/[friedly_name]/get/[channel]
Channel: l1, l2, l3 … l8
Payload: 1
Returns: The counter value {“[channel]”: float_value}
write – resets the counter
Topic: z2m/[friedly_name]/set/[channel]
Channel: l1, l2, l3 … l8
Payload: 0

MHZ19, Senseair S8

These sensors work in the UART mode and you should connect sensors to UART pins. Therefore you cannot use the UART interface in the same configuration. (CC2530 P0.2 -> MH-Z19 RX, CC2530 P0.3 -> MH-Z19 TX).

Bistable relay

You should define the ON pin first. For example, output 7 – Bistable relay ON, and output 8 – Bistable relay OFF.

Bistable relay configuration

Zigbee: Look for commands and examples for GPIO outputs. The firmware accepts all commands on the “Bistable relay On” endpoint.

PWM

The firmware supports two PWM types: software and hardware.

Software, configurable 1 kHz, 2 kHz, 3 kHz, 5 kHz – the firmware can generate the PWM signal on any pin. The higher frequency requires more CPU resources. The frequency may slightly float. You may configure up to two PWM outputs in the configuration.

Hardware, configurable 1 kHz, 2 kHz, 4 kHz, 8 kHz, 16 kHz, 32 kHz – the firmware uses the hardware PWM generator on the chip. The PWM duty cycle has 256 states (8 bits). It is precise and does not use CPU resources, but it can work on the following pins only:

PWM #1 pins: P13, P14, P16, P17 (one of these pins)
PWM #2 pins: P10, P11, P20, P23 (one of these pins)

If the frequency of all PWM is identical, you may create up to four hardware PWM.

PWM #1 pins: P13 or P16
PWM #2 pins: P10 or P20
PWM #3 pins: P14 or P17
PWM #4 pins: P11 or P23

If a PWM output is linked to a corresponding input (e.g. Input 2 – Output 2), the input can control the PWM value (12 steps, cyclic, 0 – 20 – 40 .. 240 – 255 0).

Zigbee cluster: ZCL_CLUSTER_ID_GEN_LEVEL_CONTROL
Zigbee attributes: ATTRID_LEVEL_CURRENT_LEVEL (uint8)
Zigbee commands: read, write, moveToLevel, moveToLevelWithOff

Zigbee cluster: ZCL_CLUSTER_ID_GEN_ANALOG_INPUT_BASIC
Zigbee attributes: ATTRID_IOV_BASIC_PRESENT_VALUE (float, range: 0-255)
Zigbee commands: read, write

Zigbee2MQTT commands

on/off – Look for commands and examples for GPIO outputs.
write – sets the PWM duty cycle.
Topic: z2m/[friedly_name]/[channel]/set/brightness
Channel: l1, l2, l3 … l8
Payload: value
Topic: z2m/[friedly_name]/set/[channel]
Channel: l1, l2, l3 … l8
Payload: {“brightness”: value, “transition”: 3}
value – 0 .. 254.
transition – (optional) the transition time in seconds between states.
read – reads the current value
Topic: z2m/[friedly_name]/[channel]/get/brightness
Payload: none
Returns: {“brightness_[channel]”: value}


Comments
Harvey Specter
Posted at 15:38 September 21, 2020
darksun
Reply
Author

Is it possible to produce this firmware for CC26X2R1 and CC1352P_2? I’m looking to turn a https://www.tindie.com/products/slaesh/cc2652-zigbee-coordinator-or-openthread-router/ stick into a Zigbee Router rather than a coordinator, I have CCS and IAR workbench and zstack I see the sample switch and sample light examples but not sure how I can implement everything from this great firmware

    Harvey Specter
    Posted at 03:23 September 22, 2020
    Owner
    Reply
    Author

    Unfortunately, CC26X2R1 and CC1352P_2 are fully different. It is necessary to create a firmware from scratch.

Harvey Specter
Posted at 12:03 September 16, 2020
kevin
Reply
Author

I find somthing if I publish on topic
zigbee2mqtt/0x00124b001d37a935/set
payload
{
“state”: “ON”
}
The output I1 light ON
but how can we do with the other output?

    Harvey Specter
    Posted at 12:54 September 16, 2020
    Owner
    Reply
    Author

    Hi. There is a mistake or typo. Replace “I1” to “l1”.

Harvey Specter
Posted at 09:27 September 16, 2020
lancereau kevin
Reply
Author

Hello, thanks for your configurator, it’s really an amazing tool. I use Jeedom and Z2M and i read all the input, but i can’t commands any ouput, i use the last firmware of Z2M maybe is the reason. I test lot of command with MQTT Explorer, as zigbee2mqtt/[FRIENDLY_NAME]/set { “state_I1”: “ON”} and other. maybe i miss something.
I test with alexa amazone and surprise it work with only one output.
You do a super project. Thanks a lot

    Harvey Specter
    Posted at 12:55 September 16, 2020
    Owner
    Reply
    Author

    Hi. The correct command { “state_l1”: “ON”} or { “state_l2”: “ON”} (the lower case “l” instead of upper case “I”).

Harvey Specter
Posted at 05:05 August 28, 2020
Richard
Reply
Author

Is it possible to configure so it doesn’t reset & unpair when the power is cycled a few times quickly, leaving only a long press on IN1 as the method to achieve that? I’ve had it where a momentary fault on the power line caused the device to unpair I think due to the turn power on/off 3x to unpair feature.

    Harvey Specter
    Posted at 05:12 August 28, 2020
    Owner
    Reply
    Author

    Sorry, but you cannot disable it.

Harvey Specter
Posted at 13:18 August 27, 2020
Giovanni C
Reply
Author

Hello, is there a way to use this firmware to controlo a curtain motor? this motors need to be powered either to close OR to open but NEVER both at same time, this is normally defined as INTERLOCK, it will be great to be able to have such option in this firwmare!!

    Harvey Specter
    Posted at 14:42 August 27, 2020
    Owner
    Reply
    Author

    Hello, You may use the Bistable relay outputs. It works in the similar way.

Harvey Specter
Posted at 12:00 August 24, 2020
Paul Kanthak
Reply
Author

Hi, there is a typo in the description of “GPIO Outputs” – “zigbee2MQTT commands:

Payload: {“trigger”, 5000} -> the ‘,’ need to be changed to ‘:’ -> Payload: {“trigger”: 5000}

Thanks again for this excellent project!

    Harvey Specter
    Posted at 12:02 August 24, 2020
    Owner
    Reply
    Author

    Thank you! Fixed.

Harvey Specter
Posted at 18:37 August 23, 2020
John
Reply
Author

Can you add OUTPUT: True RMS?
I want to use ACS712 for AC current like this:
https://i1.wp.com/modkam.ru/wp-content/uploads/2020/01/Router-ULN-Google-Chrome-2020-01-20-13.46.08.jpg

    Harvey Specter
    Posted at 03:19 August 24, 2020
    Owner
    Reply
    Author

    Hi, ACS712 exists in the sensors list.

Harvey Specter
Posted at 18:03 August 19, 2020
Paul Kanthak
Reply
Author

Hi, I’m trying to use the UART interface with an Arduino Nano and have configured ‘Output 2’ of the CC2530 as described in your configuration specification. Unfortunately I can’t get it to work. Using the Zigbee2MQTT with topic “z2m/[friedly_name]/set/action” and payload “Hello paul” lead to the following error message:

Zigbee2MQTT:error 2020-08-19 19:48:33: Publish ‘set’ ‘action’ to ‘test’ failed: ‘Error: Write 0x00124b001efe861e/1 genMultistateValue({“14”:{“value”:”Hello paul”,”type”:66}}, {“timeout”:10000,”disableResponse”:false,”disableDefaultResponse”:true,”direction”:0,”srcEndpoint”:null,”reservedBits”:0,”manufacturerCode”:null,”transactionSequenceNumber”:null}) failed (Status ‘UNSUP_CLUSTER_COMMAND’)’
Zigbee2MQTT:info 2020-08-19 19:48:33: MQTT publish: topic ‘z2m/bridge/log’, payload ‘{“type”:”zigbee_publish_error”,”message”:”Publish ‘set’ ‘action’ to ‘test’ failed: ‘Error: Write 0x00124b001efe861e/1 genMultistateValue({\”14\”:{\”value\”:\”Hello paul\”,\”type\”:66}}, {\”timeout\”:10000,\”disableResponse\”:false,\”disableDefaultResponse\”:true,\”direction\”:0,\”srcEndpoint\”:null,\”reservedBits\”:0,\”manufacturerCode\”:null,\”transactionSequenceNumber\”:null}) failed (Status ‘UNSUP_CLUSTER_COMMAND’)'”,”meta”:{“friendly_name”:”test”}}’
Zigbee2MQTT:info 2020-08-19 19:48:45: MQTT publish: topic ‘z2m/test’, payload ‘{“state_l2″:”OFF”,”linkquality”:115,”state_l1″:”OFF”,”state_l3″:”OFF”,”state_l4″:”OFF”,”state_l5″:”OFF”,”state_l6″:”OFF”}’

To go ahead I need an idea how to solve this problem. Thanks in advance!

    Harvey Specter
    Posted at 12:27 August 20, 2020
    Paul Kanthak
    Reply
    Author

    OK, serial communication between CC2530 and Arduino is now in place!

    I figured out that the CC2530-P02 is the RX pin (INPUT) and P03 the TX pin (OUTPUT). From my understanding it is confusing as your configuration of the UART defines P02 as output.
    In addition it was necessary to configure ‘Output 1’ for the UART connection (using Output 2 was not working).
    Thanks a lot for your great project. It enables me to move now all my DIY sensors/actors into my Zigbee network.

    Harvey Specter
    Posted at 14:10 August 22, 2020
    Paul Kanthak
    Reply
    Author

    Hi, I’m using the UART interface with an Arduino to transmit several status to my Home Automation. Unfortunately I’m not able to send a JSON string as it seems that the firmware add a slash before the double quotes to escape these characters:

    MQTT publish: topic ‘z2m/sauna’, … ,”action”:”{\”1\”:\”ausgeschaltet\”}”}’
    MQTT publish: topic ‘z2m/sauna’, … ,”action”:”{\”2\”:\”offen\”}”}’
    MQTT publish: topic ‘z2m/sauna’, … ,”action”:”{\”4\”:\”28\”}”}’

    Any chance to change this behaviour???

      Harvey Specter
      Posted at 03:20 August 24, 2020
      Owner
      Reply
      Author

      Hi. The firmware does not escape anything. I can only add a data packet end to the data sent.

Harvey Specter
Posted at 21:15 August 7, 2020
Paul
Reply
Author

Hi, i am using your firmware tool to create own Zigbee devices like switches or temp/humidity sensors, all works fine 😉 Now i want to create UART communication between my Teensy 3.2 microcontroller and zigbee2mqtt (via CC2530 router).
My config looks like this:
Settings: https://ibb.co/VBMNqcZ
Expert: https://ibb.co/L6jyS3R
Device is properly (i think) recognizes by zigbee2mqtt but communication with UART does not work. If i send request to topic: zigbee2mqtt/my_device_id/set with payload: ‘{“action”: [2, 0, 0]}’ i see this error: https://ibb.co/rZwkqkh
Also i periodically(about 2-3s) receive this messages from my device: https://ibb.co/DM6fNQp
I connected P02 pin to RX in my microcontroller and PO3 to TX, on serial port there is no receiving any messages. I would be grateful for any help.
Best regards, Paul 🙂

    Harvey Specter
    Posted at 05:24 August 8, 2020
    Owner
    Reply
    Author

    1. Please, set the “Packet end” option to “None”.
    2. Ensure, that you are using the latest version of z2m.

      Harvey Specter
      Posted at 06:50 August 8, 2020
      Paul
      Reply
      Author

      Thank You for fast reponse 🙂 I set the “Packed end” option to “None” and result is the same: when i try send payload “11” to topic zigbee2mqtt/my_device_id/set/action i receive error. Also i receive random “action” data from cc2530 like previous.
      https://ibb.co/b7C7S5N
      Any idea what i am doing wrong?
      Best regards,
      Paul

        Harvey Specter
        Posted at 08:34 August 8, 2020
        Owner
        Reply
        Author

        Are you using the latest developers version of z2m? Are you using the latest version of the firmware?

          Harvey Specter
          Posted at 10:19 August 8, 2020
          Paul
          Author

          Yes, i am using the latest version of z2m and firmware tool.

          Harvey Specter
          Posted at 22:42 August 8, 2020
          Paul
          Author

          I found a solution, change UART pin to Output 1. It seems that UART does not work correctly on Output 5.

Harvey Specter
Posted at 21:34 August 4, 2020
dclobato
Reply
Author

First, thank you for the firmware. I have a CC2530+CC2591 devboard and I created a custom version of the firmware with no sensors, and just the LED on P24. After flashing the module, the flash attached to P24 and GND does not blink :-/ The configuration I have here is on https://paste.ubuntu.com/p/QbHPzwp328/

What can I be doing wrong?

    Harvey Specter
    Posted at 07:29 August 5, 2020
    Owner
    Reply
    Author

    Hmm. Usually, P24 is not available, because an external oscillator is connected to that pin. But I do not have a firmware for CC2530+CC2591 _without_ the oscillator.

      Harvey Specter
      Posted at 04:32 August 7, 2020
      dclobato
      Reply
      Author

      It worked! Used pin P03

Harvey Specter
Posted at 15:08 August 3, 2020
G
Reply
Author

I have created a firmware with only the Reporting LED feature enabled – the pinout of CC2531USB is available at https://www.ti.com/lit/ug/swru221a/swru221a.pdf . I tried two different variants, using both P00 and P11 for the reporting channel.

However, after flashing, it seems like the firmware is not booting properly. Sometimes the LED starts blinking, sometimes it doesn’t. Tried resetting the dongle with the “reset” button of the SmartRF40 and by power-cycling it, sometimes it works fine (LED starts blinking immediately), sometimes it starts blinking after an unpredictable amount of time, most of the time it doesn’t start at all.

Tested with multiple sticks, to exclude any hardware problem. Also tested the old router firmware, and it starts blinking every time I reset/power cycle the stick.

Any idea?

    Harvey Specter
    Posted at 07:34 August 5, 2020
    Owner
    Reply
    Author

    Please, try the firmware for CC2530 without oscillator.

      Harvey Specter
      Posted at 09:08 August 5, 2020
      G
      Reply
      Author

      That indeed did the trick, thanks!

Harvey Specter
Posted at 09:30 July 26, 2020
John
Reply
Author

Why bistable relay ON/OFF can’t work for OUTPUT1 and OUTPUT2?

    Harvey Specter
    Posted at 04:07 July 27, 2020
    Owner
    Reply
    Author

    Please, re-download the firmware. This bug has been fixed.

Harvey Specter
Posted at 07:25 July 26, 2020
John
Reply
Author

I want to control Nice Gates Motor.
It have inputs for a buttons: OPEN, CLOSE, STOP and State output for a lamp (open = 24V, close = 0V)

Instead of OPEN, CLOSE, STOP buttons I use simple relay + CC2530 gpio, Instead of lamp I use pc817 + CC2530 gpio. OPEN = P16, CLOSE = P13, STOP = P12.

Cause button press is impulse, I config ptvo with bistable relay.

Board type: CC2530 + CC2592
Power saving mode (PSM): No
Status LED: Yes (Inversed)
Default reporting interval (s): 30

Output pins:
P16: Output 3, Bistable relay ON, Pull-up (500, 0)
P13: Output 4, Bistable relay OFF, Pull-up (500)
P12: Output 5, Bistable relay ON, Pull-up (500, 0)
P17: Output 6, Bistable relay OFF, Pull-up (500)
P23: Output 7, GPIO, Pull-up

Input pins:
P04: Input 7, GPIO, Pull-up, Switch, Link to out 7

Trouble: I can’t config 3 bistable ON relay, only 2 is works.

Temp solution is Bistable1 ON = OPEN ( P16), Bistable1 OFF = CLOSE (P13), Bistable2 ON = STOP (P12).
But in rebooting Bistable1 is OFF and CLOSE command running. I dont want it.

Can you tell me how using 3 bistable relay ON in ptvo?

    Harvey Specter
    Posted at 04:11 July 27, 2020
    Owner
    Reply
    Author

    Hi. I see only two bistable relays in our configuration.

Harvey Specter
Posted at 07:04 July 26, 2020
John
Reply
Author

z2m works fine

Harvey Specter
Posted at 17:37 July 19, 2020
James
Reply
Author

Hi,

I have a CC2530 module and baseboard (Waveshare ZB502) that I have flashed with the latest version of the configurable firmware with settings as shown below:

Board type: CC2530
Power saving mode (PSM): No
Status LED: Yes (Inversed)

Output pins:
P14: Output 1, GPIO, Pull-up, Remember state
P04: Output 2, GPIO, Pull-up, Remember state
P11: Output 3, GPIO, Pull-up, Remember state
P12: Output 4, DS18B20, Pull-up (AA-BB-CC-DD-EE-FF-01-02)

Input pins:
P01: Input 1, GPIO, Pull-up, Switch, Link to out 1
P20: Input 2, GPIO, Pull-up, Switch, Link to out 2

There are two buttons connected to pins P0_1 and P2_0, two LEDs connected to pins P1_1 and P1_4, and a DS18B20 connected to pin P1_2. The board is connected to my zigbee2mqtt network and I am using MQTT Exporer to monitor the network and publish to devices.
when I press a button (P2_0) on the ZB502 board I get the following response:

ZB502_01 = {“state_bottom_left”:”OFF”,”linkquality”:126,”state_bottom_right”:”ON”,”state_top_left”:”OFF”,”state_undefined”:”ON”}

(Where ZB502_01 is the zigbee2mqtt friendly name.)

However, I am unable to publish to the device to get or set the state of the LEDs or buttons. I am using the following to try and set/get pin states:

zigbee2mqtt/ZB502_01/l1/set # turn a LED on
zigbee2mqtt/ZB502_01/l3/set/state:ON # turn a LED on
zigbee2mqtt/ZB502_01/l3/set/state:OFF # turn a LED off
zigbee2mqtt/ZB502_01/l1/get # read the state of button on l1
zigbee2mqtt/ZB502_01/l4/get # read the temperature form the DS18B20

None of these work. I have also tried sending commands from Node-Red but again, nothing seems to work. It appears the the CC2530 can transmit data but is not receiving commands. I am not sure if the is a hardware problem or if I am missing something in the configuration or MQTT publishing strings.

Any help or advice would be appreciated.

    Harvey Specter
    Posted at 03:33 July 20, 2020
    Owner
    Reply
    Author

    Hi. You use the old versoin of Z2M. In your case you should change l1->bottom_left, l3->bottom_right.

Harvey Specter
Posted at 14:18 July 14, 2020
John
Reply
Author

I flashed cc2530 + bmp280, try to use it in hassio.
Its cluster data error.
For ZHA no objects created with sensjrs data.
For Zigbee2Mqtt I see objects with any different data.

sensor.0x00124b001d38d3c6_linkquality
l6: 29.93
device: ’77’
temperature: 29.9
linkquality: 0
pressure: 99633
altitude: 141.8
humidity: 56.1
unit_of_measurement: lqi
friendly_name: ptvo_bmp280_linkquality
icon: ‘mdi:signal’

Can you fix Cluster arrays for bmp280?

    Harvey Specter
    Posted at 14:27 July 14, 2020
    Owner
    Reply
    Author

    Hi John,

    Clusters are correct if you see data in Z2M. You should add sensors in HA manually because it is not possible to create it for all possible configurations.
    Look here for examples: https://www.zigbee2mqtt.io/devices/ptvo.switch.html

      Harvey Specter
      Posted at 12:01 July 16, 2020
      Max
      Reply
      Author

      Hi,
      John has not tell clear about the problem. I clarify.
      There are one inconvenience and one bug.

      Inconvenience – all data reported in AnalogInput cluster – temperature, pressure etc, but in ZCL we have separate clusters for each values. So, some software not expect, for example, the temperature value inside AnalogInput cluster, but expect it in temperature cluster.

      Bug – when the sensor, connected to the some output, printed not one value (for example, BMP280 has 3 values – temperaure, humidity and pressure), the data transmited to coordinator under the same endpoint and cluster id. It is not possible in that situation to differenciate the values. The only difference – it is “description”, what makes it almost impossible to use that values in almost all software, which not do, of course, the synaxis analize of “description” attribute.

        Harvey Specter
        Posted at 13:29 July 16, 2020
        Owner
        Reply
        Author

        1. Unfortunately, I cannot implement a separate cluster for each the value type. It requires a lot of memory.
        2. See #2. Also, I did it for identical sensors on the same endpoint (DS18B20). Zigbee2MQTT can successfully parse this data.

Harvey Specter
Posted at 22:52 July 4, 2020
Alan
Reply
Author

Hi. Could you please clarify under the section GPIO Outputs / Zigbee2MQTT commands what would be the channel number of Output 1 with the configuration shown here: https://www.dropbox.com/s/qq1edgmqzifd0qz/ptvo%20configuration.jpg?dl=0

At the moment l1 is the Input 1 Counter and l2 is Input Temperature.

Also, Input 1 Counter is linked to Output 1. Does linking work for Counters? At the moment an LED on Output 1 is always ON but the Input 1 is low (OFF). [Output 1 Inverse is not selected].

Thank you
Alan

    Harvey Specter
    Posted at 11:33 July 10, 2020
    Owner
    Reply
    Author

    Hi Alan. The LED state may depend on your electronics. It may inverse the signal state.

      Harvey Specter
      Posted at 11:57 July 11, 2020
      Alan
      Reply
      Author

      Hi. I have simplified the circuit and made some more tests. I removed the Link from the Counter input to the LED output and made a new push button input with a link to the LED. So now I have:
      – Input 1(P0.3) Red Push Button 3.3v is config as Counter internal Pull-down (20k)
      – Input 2 (P0.2) is config as Internal Temperature – no external hardware
      – Input 3 (P0.4) Yellow Push Button 3.3v is config as GPIO internal Pull-down (20k) Inversed & Link to Output 3
      – Output 3 (P1.6) Red LED to Ground is config as GPIO internal Pull-down (20k) & Remember State
      Circuit diagram here: https://www.dropbox.com/s/xg2uus5my7cb4mv/CC2530%20Testing%20Circuit%20v3.jpg?dl=0
      Firmware config screen here: https://www.dropbox.com/s/3gq5nbxa76cjseo/ptvo%20configuration%20V3%20with%2010mins%20and%20Input%202.jpg?dl=0
      The firmware is set to report every 10 minutes.

      Testing:

      1. Input 1 Counter. Pressing push button increments counter as shown in the regular 10 min. reporting.
      But publishing message zigbee2mqtt/Solar S0 Counter/get/l1 + payload 1 FAILS with no converter available for ‘ptvo.switch’ with cluster ‘genAnalogInput’ and type ‘raw’ and data ‘{“type”:”Buffer”,”data”:[24,42,1,85,0,0,57,0,0,64,64,28,0,0,66]}’
      Devices.js for ptvo.switch here: https://www.dropbox.com/s/yt60eip4oasintt/Devices%20js%20definition%20for%20the%20ptvo%20switch%20re%20S0%20Counter.txt?dl=0
      Also resetting counter with ‘zigbee2mqtt/Solar S0 Counter/set/l1 ‘ with data ‘0’
      FAILS with error No converter available for ‘l1 ‘ (0)

      2. Input 2 Temperature with message zigbee2mqtt/Solar S0 Counter/get/l2 + payload 1 receives message with temperature OK: {“state_bottom_left”:”OFF”,”linkquality”:105, “state_bottom_right”:”OFF”,”l1″:6,”l2″:28,”temperature”:28,”state_top_left”:”OFF”,”l3″:32,”last_seen”:”2020-07-10T22:25:35.794Z”}

      3. Input 3 Pressing push button makes the LED come on when the button is released BUT it stays ON. Pressing push button again makes the LED go off when the button is released. Looks like the GPIO is behaving as a Latch not a momentary make/break circuit.
      Publishing zigbee2mqtt/Solar S0 Counter/get/l3 + payload 1 to get the push button state is OK: state is ON or OFF as shown by the LED.

      In summary.:
      1. Counter: Cannot read(get) or write(set) counter – errors “no converter available”
      2. GPIO push button input is acting as a latch switch

      Hope this helps. Many thanks.
      Alan

        Harvey Specter
        Posted at 12:11 July 13, 2020
        Owner
        Reply
        Author

        Hi,
        2. It seems you use an old version of z2m. It does not have the corresponding converter.
        3. Enable the ‘switch’ option and it will work as expected.

          Harvey Specter
          Posted at 22:16 July 14, 2020
          Alan
          Author

          Hi. I’m running zigbee2mqtt under docker. I installed the latest image 1.14.1 dated 2020-06-30 16:45:15. I still get the same error: “No converter available for ‘ptvo.switch'”. Here is a copy of the ptvo.switch entry in the devices.js file https://www.dropbox.com/s/hmsw8uxozmf764o/ptvo_switch_1_14_1.txt?dl=0 + the fromZigbee.js file https://www.dropbox.com/s/s1w4azpfusnbp11/ptvo_fromZigbee_1_14_1.txt?dl=0 + the toZigbee,js file https://www.dropbox.com/s/csysdqn1u7lkyni/ptvo_toZigbee_1_14_1.txt?dl=0

          Whilst this is all new to me, I see in the zigbee2mqtt log the response is:
          type ‘raw’, cluster ‘genAnalogInput’, data ‘{“type”:”Buffer”,”data”:[24,12,1,85,0 ……….
          whereas I was expecting to see something like:
          type ‘readResponse’, cluster ‘genAnalogInput’, data ‘{“presentValue”:123, “description”:”Counter”}’

          Maybe I need a new version of the firmware? I’m on cc2530_io_1.2.2a.44539_firmware

          Thanks,
          Alan

          Harvey Specter
          Posted at 20:39 July 22, 2020
          Alan
          Author

          Hi. I would appreciate if you have any further thoughts on getting the Counter function working. Thank you. Alan

          Harvey Specter
          Posted at 04:41 July 23, 2020
          Owner
          Author

          Hi Alan. I’ve tested the counter and it works.

Harvey Specter
Posted at 07:38 May 25, 2020
Andreas
Reply
Author

Leave a Reply