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

UART-based sensor
UART-based sensor.

PZEM-004 V3

Please, note that the firmware supports V3 only.

PZEM-004 configuration for one sensor
PZEM-004 configuration for three sensors
This sensor type supports the write command.

write - resets the counter
Topic: zigbee2mqtt/[friedly_name]/set
Payload: {"[channel]": 0}
Channel: l1, l2, l3 … l16

Senseair S8

This sensor type supports the write command.

write - starts calibration procedures.
Topic: zigbee2mqtt/[friedly_name]/set/[channel]
Payload: {"[channel]": value}
Channel: l1, l2, l3 … l16
Value:
0 - start the zero calibration procedure.
1 - start the background calibration procedure.

Comments
Harvey Specter
Posted at 08:01 October 15, 2021
raymond
Reply
Author

Hello PTVO. How to configure Pzem 004t with home assistant? I followed this guide but with no success: https://gio-dot.github.io/Z1-Mini/pzem-zigbee-meter
sensor:
– platform: mqtt
name: “PZEM Volt R”
state_topic: “zigbee2mqtt/0x00124b0022608e5a”
unit_of_measurement: “V”
value_template: “” (this attributes is empty).
Please help me. Thanks you very much

    Harvey Specter
    Posted at 08:02 October 16, 2021
    Owner
    Reply
    Author

    Sorry, but I do not use HA. I do not know how to add support of sensors there.

Harvey Specter
Posted at 21:17 October 13, 2021
glcos
Reply
Author

Which are UART pins RX and TX on an EBYTE E72-2G4M05S1F module with CC2652RB chip ?
I would like to use this module with PZEM-004T.
Thanks

    Harvey Specter
    Posted at 12:28 October 14, 2021
    Owner
    Reply
    Author

    The firmware uses pins P02 and P03 on CC2652 chips.

Harvey Specter
Posted at 23:54 September 26, 2021
Jack
Reply
Author

Hi there, I have an SPS30 air quality sensor connected. While I can configure the firmware to give regular sensor updates at every 10 seconds to the topic ‘zigbee2mqtt/sps30’, I couldn’t figure out how to poll for sensor values by publishing to ‘zigbee2mqtt/sps30/get’ with message {“l1”: “”}. Doe the firmware allow for polling for sensor values? Thanks.

    Harvey Specter
    Posted at 04:53 September 27, 2021
    Owner
    Reply
    Author

    Sorry, but the firmware cannot work with this sensor as you want.

Harvey Specter
Posted at 02:59 January 22, 2021
Mário Arnaldo Mazon
Reply
Author

Hi. As PZEM-004T uses UART, is there any way to connect three or more of them to one cc2530 and get 3 channels (three phase) readings, for example ? I understood I need to connect it to pins p0.2 and p0.3, but in which case I need to configure INPUT ? Or I only config the Output ? Thank you.

    Harvey Specter
    Posted at 03:27 January 22, 2021
    Owner
    Reply
    Author

    Hi. I didn’t try to connect 3 sensors.
    1. You should change the sensor’s address using a utility from a manufacturer. Each sensor should have a unique address.
    2. You should configure 3 outputs. All outputs should use pin P02.
    3. You don’t need any inputs.
    Please, let me know about your results.

        Harvey Specter
        Posted at 04:59 January 29, 2021
        Owner
        Reply
        Author

        Thank you for sharing your expirience!

          Harvey Specter
          Posted at 19:10 February 21, 2021
          gio
          Author

          Hi, i noticed a really strange behaviour using PZEM004-t. I realized a schematic with this config:
          Board type: CC2530
          Device type: End device without routing
          Update firmware’s timestamp : 2021-02-20
          Status LED: P01, Periodic (every 5 seconds)
          Default reporting interval (s): 20

          Output pins:
          P02: Output 1, PZEM-004T V3 (Address (dec): 1)
          P10: Output 4, GPIO, External pull-up
          P11: Output 5, GPIO, External pull-up

          Input pins:
          P20: Input 4, GPIO, External pull-up, Link to out 4
          P17: Input 5, GPIO, External pull-up, Link to out 5

          So far so good, all is working. I use SmartRF04EB as programmer. If i flash firmware and then let connect the board to zigbee2mqtt (without power cycle or reset the board), all is working flawlessy: inputs command linked out fast and even output switched from z2m works fast.
          But if i reset or power cycle the board (Off then on after flash), command outputs from zigbee2mqtt becomes very very laggy (5-10 seconds). Command outputs from linked Inputs instead remain fast.
          I’m sure there is a bug somewhere.

          Harvey Specter
          Posted at 09:37 February 22, 2021
          gio
          Author

          Hi, i have found the reason of very laggy gpio commands outputs using PZEM: if router function is disabled command are very laggy (5-10 seconds). With router enabled commands are ever fast.

Harvey Specter
Posted at 17:26 December 2, 2020
Frab
Reply
Author

Hi, I cannot get the PZEM-004 V3 to work.
For me it’s not clear if I am configuring it wrong or there is a malfunction on the module.
Is it ok if I configure like this?
OUTPUT 1 – P02 – PZEM004 – ADDRESS 248 (where do I find this value, is it standard?)
INPUT 2 – P03 – PZEM004
Anyway thank you for your work!

    Harvey Specter
    Posted at 14:02 December 4, 2020
    Owner
    Reply
    Author

    Please, configure Output 1 only. The address is the default value from the documentation. Please, try to swap RX and TX wires. Did you connect GND and 3.3V to PZEM too?
    The sensor does not work without a connected load.

      Harvey Specter
      Posted at 21:49 December 5, 2020
      Frab
      Reply
      Author

      Thank you. With:
      OUTPUT 1 – P03 – PZEM004 and no INPUT it works! It was not really clear for me how to connect.
      Now the only thing I notice: in Zigbee2Mqtt every value appears good, but Watts are without comma (example: 596 watts instead of 59,6 watts). Is this Zigbee2Mqtt bug?
      Anyway, a coffee is coming 😉

        Harvey Specter
        Posted at 06:54 December 6, 2020
        Owner
        Reply
        Author

        Watts: Maybe, it is a bug. I’ll fix it in the next version.

        Harvey Specter
        Posted at 12:04 December 7, 2020
        Owner
        Reply
        Author

        Fixed.

Leave a Reply