Zigbee Configurable Firmware v2.5

The firmware allows creating a device with a easily configurable functionality including inputs, outputs, ADC, pulse counter/generator, I2C, external sensors.

Features overview

I’ve placed all features on the separate page. It is too long.

  • The status LED indicator works now.
  • The firmware supports up to 8 GPIO inputs or outputs.
  • The “switch” mode for inputs.
  • Pull-up, Pull-down, Tri-state options for inputs and outputs.
  • Analog inputs.
  • Internal temperature measurement.
  • Source voltage measurement.
  • UART (only text commands between an external device and a host, look at README.txt).
  • Some environmental sensors (DS18B20, BMP280, BME280, DHT 11, DHT 22, DHT 12, AM2301, Sonoff SI7021, MHZ19, SenseAir S8).
  • SI7021 (I2C), CCS811.
  • Pulse generator.
  • Pulse counter (infinite, resettable, interval).
  • PWM (hardware, up to 32 kHz).
  • PWM (software 3 kHz).
  • Bi-stable relay.
  • Watchdog timer.
  • Configurable default reporting interval.
  • Expert options (model ID, manufacturer info, network key, etc.).

Download

Download firmware

Your comments and bug reports are welcome :-)!

Updates

2020-06-26 Tested SI7021 & CCS811.
2020-06-24 Fixed problem with switch buttons linked to relays. Added the toggle mode for a switch input (works like Aqara).
2020-06-16 Improved hardware PWM (added frequency selection up to 32 kHz).
2020-05-26 Fixed interview problems in some configurations.
2020-05-21 Increased number of inputs to 8. Configurable TXEN and RXEN pins for the RFX2401 power amplifier. Ability to assign the DS18B20 sensor to an endpoint.
2020-05-03 Added the “Inverse” option for inputs and outputs. Added PWM.
2020-04-22 Fixed internal temperature measurement.
2020-04-20: Fixed problem with a pull-up/down mode. Added checks for pull-up/down settings in the configurator.
2020-04-19: Fixed problem with empty endpoints that may cause problems with joining. Fixed a bug with
2020-04-14: Fixed a problem with ADC


Comments
Harvey Specter
Posted at 01:53 July 1, 2020
Nick Rout
Reply
Author

Hi there.

Is there a beginners guide to using this firmware and how to set up a device from scratch?

Harvey Specter
Posted at 14:54 June 30, 2020
Smartict
Reply
Author

Some more digging, considering my post from yesterday. Even when I only generate a config with just 1 out (p00, GPIO, Tri-state) – it will join initially, after rebooting it has lost its network…
(E18-MS1PA1 -> selected board type = CC2530 + CC2592 ).
Let me know if I can do further testing! Best regards, S.

    Harvey Specter
    Posted at 10:37 July 2, 2020
    Smartict
    Reply
    Author

    After carefully rechecking the behaviour a few times, it looks like the v2.5 firmware with the above configuration explicitly calls the function to ‘rejoin’ / ‘reset’. A led attached to p00 shows the same behaviour (dimmed appearance) as when the device is reset by using P01 as described in the FAQ (10 second hold -> reset). Best regards, S.

    Harvey Specter
    Posted at 19:05 July 2, 2020
    Janis Klavins
    Reply
    Author

    Hi.
    The same problem (E18-MS1PA1 -> selected board type = CC2530 + CC2592 )
    After restarting power, lost connection.
    The only solution restart power three times (reset module) or hold first input to 10 seconds.
    There is a tricky part.
    if made automation, then after power fail, all process stops.
    Real hope for solution from smarter people.
    Best regards, Janis

Harvey Specter
Posted at 21:25 June 29, 2020
smartict
Reply
Author

Happy to see the ongoing development of this nice tool!
Nevertheless after updating to the V2.5 version I am experiencing some difficultaties that do not have with the older version (downloaded at 21-05). No matter how I configure the v2.5 (outputs and/or inputs) for usage with my E18-MS1PA1, after flashing and joining to a coordinator it looks fine. After powering off and on again, the device is not able to joing the network anymore…
Just verified the setup with another E18-MS1PA1 to make sure it’s not the device. Now I am back with the older version (21-05) with all ports on ‘default’ and I can reboot the device without issues. Any suggestion is welcome.

Harvey Specter
Posted at 15:47 June 27, 2020
Alan
Reply
Author

I’m sure this will be awesome once I get it working 😉 Thank you for making this available.

I have flashed a blue CC2530 module as per your fig 1 with the cc2530.hex firmware (actually my 3rd flash just be get back to base point). I then just connected the Vcc & Gnd.

In FirmwareConfig / Expert I set the Network Key (in hex) as per the key generated by zigbee2mqtt. In Domoticz I have 7 new devices: xxxxxxx_signal, + _click, + _input1 to _input5. In zigbee2mqtt I gave the CC2530 a friendly name of ‘Solar S0 Counter’. In Zigbee2mqtt Assistant the device is shown.

In FirmwareConfig I defined:
Output 1 P16 GPIO PullDown <<< currently nothing connected to P16
Input 1 PO1 GPIO ExtPullDown Inverse Link to out 1 <<< currently nothing connected to P16
Input 2 P02 Internal Temp <<< this is so I can test without any external circuitry)

In MQTT.fx I can subscribe to "zigbee2mqtt/Solar S0 Counter" and every few minutes get back
{"state_bottom_left":"OFF","linkquality":97,"state_bottom_right":"OFF","last_seen":"2020-06-27T15:18:45.270Z"}

I'm trying to understand the correct message format to interrogate the CC2530. I chose the internal temperature as this does not require any external components. In MQTT.fx I published Topic:
zigbee2mqtt/Solar S0 Counter/l2/get/state <<<< I2 is capital letter i2
with no payload.

In the subscribe window I subscribed to:
zigbee2mqtt/Solar S0 Counter/l2/get/state
and I just get that message repeated. No payload data. I think the Subscribe is just repeating the Publish.

Question please: what am I doing wrong? How to I get the temperature returned?

Ultimately Input P01 will be a Counter. The input pulses are positive pulses (I have no control over that). Will I need to select Inverse (as required for switches that are normally 0=low and 1=high)?

PS I note the Counter commands are Read (get) and Write (set) (which resets). To avoid missing a pulse between reading and writing it would be useful to have a combined command (e.g. reset). Alternatively the set command could return a payload with the value before resetting.

PS In https://ptvo.info/zigbee-configurable-firmware-features/ I believe the Topics need to be changed from z2m to the default zigbee2mqtt

Alan

    Harvey Specter
    Posted at 04:48 June 28, 2020
    Owner
    Reply
    Author

    Hi.

    1. Subscribe for all messages from your device.
    zigbee2mqtt/Solar S0 Counter/#
    2. The topic l1 contains lower case “L”.
    3. Please, note you should use different topic path for on/off outputs and sensor inputs/outputs.

      Harvey Specter
      Posted at 21:55 July 2, 2020
      Alan
      Reply
      Author

      Many thanks for responding. Looks like I used an capital i (for Input) rather than a lower case L.

      In MQTT.fx I subscribed to both zigbee2mqtt/Solar S0 Counter/# and zigbee2mqtt/Solar S0 Counter and both worked.

      I find that the CC2530 device is constantly sending 3 outputs every second even though the “Default reporting period” is not set. Looking at the zigbee2mqtt log I can see it receives a message for each of the defined 3 GPIO pins. Here is an extract:

      cluster ‘genOnOff’, data ‘{“onOff”:0}’ from endpoint 1 with groupID 0
      cluster ‘genAnalogInput’, data ‘{“presentValue”:0}’ from endpoint 1 with groupID 0
      cluster ‘genAnalogInput’, data ‘{“presentValue”:28,”description”:”C”}’ from endpoint 2 with groupID 0

      For each of these zigbee2mqtt then publishes on Solar S0 Counter (extract):
      ‘{“state_bottom_left”:”OFF”,”linkquality”:99,”state_bottom_right”:”OFF”,”l1″:0,”l2″:28,”temperature”:28,
      ‘{“state_bottom_left”:”OFF”,”linkquality”:99,”state_bottom_right”:”OFF”,”l1″:0,”l2″:28,”temperature”:28,
      ‘{“state_bottom_left”:”OFF”,”linkquality”:102,”state_bottom_right”:”OFF”,”l1″:0,”l2″:28,”temperature”:28,

      I.e. each output message is a complete list of the 3 pins (“OFF” which I guess is Output 1, and I1 (counter) and I2 (temperature).

      I could live with this but the constant high frequency output is worrying. I thought that if “Default reporting period” is not set then I should only get output when requested. Or have I misunderstood?

      I then tried to issue a get command, first to I2 for the temperature. In MQTT.fx I Published to zigbee2mqtt/Solar S0 Counter/get/l2 with payload 1 but there was no response. The zigbee2mqtt log says:

      debug 2020-07-02 21:43:39: Received MQTT message on ‘zigbee2mqtt/Solar S0 Counter/get/l2’ with data ‘1’
      debug 2020-07-02 21:43:39: Publishing get ‘get’ ‘l2’ to ‘Solar S0 Counter’

      When I issued a get command to I1 (the counter which is not currently connected to any circuit): zigbee2mqtt/Solar S0 Counter/get/l1 with payload 1 the zigbee2mqtt log reports an error:

      debug 2020-07-02 21:57:49: Received MQTT message on ‘zigbee2mqtt/Solar S0 Counter/get/l1’ with data ‘1’
      debug 2020-07-02 21:57:49: Publishing get ‘get’ ‘l1’ to ‘Solar S0 Counter’
      debug 2020-07-02 21:57:49: Received Zigbee message from ‘Solar S0 Counter’, type ‘raw’, cluster ‘genAnalogInput’, data ‘{“type”:”Buffer”,”data”:[24,38,1,85,0,0,57,0,0,0,0,28,0,0,66]}’ from endpoint 1 with groupID 0
      debug 2020-07-02 21:57:49: No converter available for ‘ptvo.switch’ with cluster ‘genAnalogInput’ and type ‘raw’ and data ‘{“type”:”Buffer”,”data”:[24,38,1,85,0,0,57,0,0,0,0,28,0,0,66]}’
      ……. repeats previous debug lines x2……….
      debug 2020-07-02 21:58:02: No converter available for ‘ptvo.switch’ with cluster ‘genAnalogInput’ and type ‘raw’ and data ‘{“type”:”Buffer”,”data”:[24,38,1,85,0,0,57,0,0,0,0,28,0,0,66]}’
      error 2020-07-02 21:58:12: Publish ‘get’ ‘l1’ to ‘Solar S0 Counter’ failed: ‘Error: Read 0x00124b001f2857e3/1 genAnalogInput([“presentValue”,”description”], {“timeout”:10000,”manufacturerCode”:null,”disableDefaultResponse”:true}) failed (Error: Timeout – 33246 – 1 – 38 – 12 – 1 after 10000ms)’
      debug 2020-07-02 21:58:12: Error: Read 0x00124b001f2857e3/1 genAnalogInput([“presentValue”,”description”], {“timeout”:10000,”manufacturerCode”:null,”disableDefaultResponse”:true}) failed (Error: Timeout – 33246 – 1 – 38 – 12 – 1 after
      10000ms) at Endpoint. (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:182:23)
      at Generator.throw ()
      at rejected (/app/node_modules/zigbee-herdsman/dist/controller/model/endpoint.js:6:65)

      Have you any ideas, please?

      Alan

Harvey Specter
Posted at 04:35 June 26, 2020
Roland
Reply
Author

Great project, any news on the power save mode?

    Harvey Specter
    Posted at 04:38 June 26, 2020
    Owner
    Reply
    Author

    Hello. Not ready yet.

      Harvey Specter
      Posted at 19:59 June 30, 2020
      Dieter
      Reply
      Author

      Hi, how could we help/contribute to get the power save mode prioritized? Thx and greets Dieter

Harvey Specter
Posted at 10:14 June 25, 2020
Marlor
Reply
Author

On Sonoff Basic ZBR3 with Version 2020-06-24
Why is the status LED constantly blinking?
Paring was successful and the relais can be controlled

    Harvey Specter
    Posted at 11:35 June 25, 2020
    Owner
    Reply
    Author

    Is it possible you’ve configured a very short reporting interval?

Harvey Specter
Posted at 18:19 June 22, 2020
AvdeevSV
Reply
Author

Hello! I set up one of the inputs for the button and everything works well. But if I enable the switch option for it, nothing happens when I click it. What might be the problem?
——————————————
P05: Input 2, GPIO, Pull-up

    Harvey Specter
    Posted at 03:49 June 23, 2020
    Owner
    Reply
    Author

    Hi. It is a switch. You should press and hold your button.

Harvey Specter
Posted at 13:19 June 19, 2020
cbor
Reply
Author

Hi, great Job, ist it possible to have a firmware with RX on P1.5 and TX on P1.4. I need it to use your firmware with E18-TBH-01.
Thank you.

    Harvey Specter
    Posted at 18:02 June 19, 2020
    Owner
    Reply
    Author

    Hmm. It is non-standard pins. It requires a custom build of a firmware.

Harvey Specter
Posted at 06:17 June 17, 2020
Roman
Reply
Author

Thanks for such a wonderful constructor! You can tell a little. I made the simplest device from the ebyte module, buttons and relays. In the control system (dekonz) I see and can switch the state of the relay, but if you click on the button, the relay switches, but the dekonz do not know about it … How can I do this or get around this annoyance?

My settings:
Board type: CC2530
Enable watch dog timer: Yes
Power saving mode (PSM): No
Default reporting interval (s): 1800
Output pins:
P13: Output 1, GPIO, Pull-up, Remember state
Input pins:
P03: Input 1, GPIO, Pull-up, Link to out 1

    Harvey Specter
    Posted at 07:20 June 17, 2020
    Owner
    Reply
    Author

    The firmware sends On/Off reports to the coordinator. Sorry, but I don’t know how deconz handles these reports.

      Harvey Specter
      Posted at 08:00 June 17, 2020
      Roman
      Reply
      Author

      I tested a little, really the report comes, but only on shutdown. If the button is turned off, the status is updated. But if included, there is no change. Maybe I did not solder the button correctly? https://monosnap.com/file/FDXktpc0nx0eciNp1u7MJuEgHQEPBi

      Harvey Specter
      Posted at 08:48 June 17, 2020
      Roman
      Reply
      Author

      I tried to connect via zigbee2mqtt, the statuses work well, both from the button and from the control system. But now I have 5 switches for one relay, of which 4 do not work =)) Please tell me, for which control system was this configurator developed? What should devices be used with so that they work well? https://take.ms/m4BsV

        Harvey Specter
        Posted at 09:31 June 17, 2020
        Owner
        Reply
        Author

        The firmware works well with Z2M. Try to send commands through MQTT. The readme file contains topics and examples. I cannot help you with deconz.

    Harvey Specter
    Posted at 19:58 June 30, 2020
    Smartict
    Reply
    Author

    Hello Roman, I am using Deconz as well, and it’s fairly simple to read back the new state. Not sure whether you are using Home Assistant or Node-Red, but both platforms provide you with either the deCONZ integration or in Node-Red you should be able to add the deCONZ template. After pairing, the device can be read as its OnOff atribute changes upon pressing your button. Just checked this as I am working my way through the new v2.5 version. Rgds, S.

Harvey Specter
Posted at 22:42 June 16, 2020
AvdeevSV
Reply
Author

Is it possible to enable/disable automatic baseline calibration for MHZ19? And also make a forced calibration? The necessary commands are here (lines 11-13): https://github.com/Anonym-tsk/esphome/blob/65df4170d2951235d6ec5df4304dda137f882efd/esphome/components/mhz19/mhz19.cpp

    Harvey Specter
    Posted at 07:19 June 17, 2020
    Owner
    Reply
    Author

    Hi. The firmware does not have ability to do it.

Harvey Specter
Posted at 12:35 June 16, 2020
Daniele
Reply
Author

It’s possible add the “Toggle” feature to the inputs? It’s for activate a relay with a push button

    Harvey Specter
    Posted at 13:08 June 16, 2020
    Owner
    Reply
    Author

    Link an input to an output and it will works in the Toggle mode.

Harvey Specter
Posted at 14:59 June 15, 2020
Marco
Reply
Author

Hello,is there any way to set the GPIO output pins high at startup? Many relays are low level triggered ..

    Harvey Specter
    Posted at 16:58 June 15, 2020
    Owner
    Reply
    Author

    The firmware can remember the last state. So, it can be any on reboot.

      Harvey Specter
      Posted at 17:25 June 15, 2020
      Marco
      Reply
      Author

      I’d want to use the relays to control the irrigation valves in my garden.
      if while a relay is on the power goes out or there is a reset ,the relay will stay on reboot, that’s not much reliable…

        Harvey Specter
        Posted at 17:52 June 15, 2020
        Owner
        Reply
        Author

        Then you could try the “Inverted” option for the output.

Harvey Specter
Posted at 13:50 June 12, 2020
svh
Reply
Author

I’ve successfully paired the chip to zigbee2mqtt but the device does not send any status information.
Is there a way to serial debug the device?

    Harvey Specter
    Posted at 10:04 June 13, 2020
    Owner
    Reply
    Author

    Did you configure any inputs or outputs? Did you change an interval on the Export tab?

      Harvey Specter
      Posted at 16:20 June 18, 2020
      svh
      Reply
      Author

      I have the EBYTE E18 MS1-PCB. Is it possible to test while connected to CC-Debugger or should I disconnect (the reset wire) and just connect power to 3.3v?

      This is the config:
      Board type: CC2530 + CC2592
      Manufacturer name: svh
      Model ID: Test01
      Location description: Home
      Update firmware’s timestamp : 2020-06-17
      Power saving mode (PSM): No
      Default reporting interval (s): 30

      Output pins:
      P13: Output 1, GPIO, Pull-up, Remember state
      P12: Output 2, GPIO, Pull-up, Remember state

      Input pins:
      P03: Input 1, GPIO, Pull-up, Link to out 1
      P04: Input 2, GPIO, Pull-up, Link to out 2

      zigbee2mqtt response after joining:
      {“type”:”pairing”,”message”:”interview_successful”,”meta”:{“friendly_name”:”0x00124baa1fb2cd3c”,”supported”:false}}

      Thanks!

        Harvey Specter
        Posted at 03:55 June 19, 2020
        Owner
        Reply
        Author

        You can test with an attached debugger. But you’ve changed ModelId. Therefore Z2M does not know your device.

          Harvey Specter
          Posted at 08:46 June 19, 2020
          svh
          Author

          Thanks, I’ve tried these options:
          -Adjusted my custom FW to match the right ModelId
          -Used the standard FW which came in the ZIP file: cc2530_cc2592.hex

          With both options Z2M responds:
          {“type”:”pairing”,”message”:”interview_successful”,”meta”:{“friendly_name”:”0x00124baa1fb2cd3c”,”supported”:false}}

          With the precompiled FW in the devices payload I get, which looks good I guess:
          {
          “ieeeAddr”: “0x00124baa1fb2cd3c”,
          “type”: “Router”,
          “networkAddress”: 28704,
          “model”: “DIYruz-Haier”,
          “vendor”: “-“,
          “description”: “-“,
          “friendly_name”: “0x00124baa1fb2cd3c”,
          “manufacturerID”: 4447,
          “manufacturerName”: “ptvo.info”,
          “powerSource”: “Mains (single phase)”,
          “modelID”: “DIYruz-Haier”,
          “hardwareVersion”: 1,
          “softwareBuildID”: “2020-03-21”,
          “dateCode”: “2020-03-21”,
          “lastSeen”: 1592555250687
          }

          But I don’t get any state messages even if the device is online, also if I request the state with:
          zigbee2mqtt/0x00124baa1fb2cd3c/get Payload: {“state”: “”}, nothing is returned.

          I don’t understand what I’m doing wrong 😞
          For the EBYTE E18 MS1-PCB I need to use the board type: CC2530 + CC2592 right? I’m using the CC-Debugger with TI SmartRF using these settings: interface fast, Erase+program+verify, location: primary.

          Thanks!

          Harvey Specter
          Posted at 09:00 June 19, 2020
          Owner
          Author

          The correct modelID should be: ptvo.switch
          Please, re-download the firmware and the configurator.

          Harvey Specter
          Posted at 17:06 June 19, 2020
          svh
          Author

          Perfect that worked! Thanks!
          So I can adjust all settings via the FW manager but have to leave all settings on Expert alone 😄

          Last question: will disabling the checkmarks use the defaults or should I manually take over the defaults from the sample firmware?

          Again, thank you! 🙏

          Harvey Specter
          Posted at 18:01 June 19, 2020
          Owner
          Author

          Just do not enable options 🙂

Harvey Specter
Posted at 09:32 June 12, 2020
Angel
Reply
Author

Is it possible to enter information on releasing the button and holding time? This introduces interesting possibilities.

“model” : “WXKG01LM”,
“click” : “long_release”,
“duration” : 1288,

    Harvey Specter
    Posted at 09:35 June 12, 2020
    Owner
    Reply
    Author

    No, it is not possible.

Harvey Specter
Posted at 08:57 June 12, 2020
Julien H
Reply
Author

Very nice software,

It is possible to imagine a led strip (type ws2812b fo exemple) control with this project ?

Thanks

    Harvey Specter
    Posted at 09:36 June 12, 2020
    Owner
    Reply
    Author

    I don’t have the ws2812b controller.

Harvey Specter
Posted at 20:34 June 10, 2020
Angel
Reply
Author

I understood the principle, the problem is gone

Harvey Specter
Posted at 16:45 June 10, 2020
Angel
Reply
Author

zigbee2mqtt version 1.14.0
“permit_join” : true
Default file: cc2530.hex + Status LED P14
FLASH -> REBOOT (Short fast blinks | After a short time | Short long blinks)
LOG zigbee2mqtt:

0x00124b000634e78b (0x00124b000634e78b): Not supported (Router)

MQTT publish: topic ‘zigbee2mqtt/bridge/log’, payload ‘{“type”:”device_announced”,”message”:”announce”,”meta”:{“friendly_name”:”0x00124b000634e78b”}}’

What am I doing wrong?

Harvey Specter
Posted at 16:19 June 8, 2020
Olili
Reply
Author

here you are:
https://client23.12hp.de/tmp/Zwischenablage01.jpg

P00 and P02 behave identically regarding logic: both active low.
IO tried it also PP00/P02 configured as tristate and internal pull-down. Same result.

Best regards, O

Harvey Specter
Posted at 13:52 June 8, 2020
olili
Reply
Author

Dear ptvo,
once again many thanks for fast response. But once again: are you sure that the “inverted” feature is working for the inputs? I tried it with tristate, internal pull-down and external-pull down. I saw no difference between “inverted” and normal mode.

Any hint? O.

    Harvey Specter
    Posted at 14:04 June 8, 2020
    Owner
    Reply
    Author

    Please, add a link to a screenshot with your settings that you suppose should work.

« Older Comments

Leave a Reply to Owner
Cancel Reply