esphome / esphome/feature-requests

Software commands (not using pin3) to put PMS5003 to sleep to exponentially extend sensor life

Open
#2,033 1 comment 5 reactions 0 assignees View on GitHub
component: pmsx003
Dominant language
No language data
Stars
450
Forks
29
PR merge metrics
No merged PRs in 30d

Description

**Describe the problem you have/What new integration you would like**

The PMS5003 sensor has a 3.5yr life span according to the datasheet. It can be extended by either putting the sensor to sleep via a high level signal on pin 3 (Set) or by sending a sleep command via the UART. The command can be sent via the code pasted below however it is not officially supported, and thus braindead easy to do, and it gives a warning related to the response from the sensor being shorter than expected when the sleep mode is changed.

**Please describe your use case for this integration and alternatives you've tried:**

This code (see `uart.write` parts) adds the ability to put to sleep and awake the sensor:

```
interval:
- interval: 150s
# Two-minute interval to extend the life span of the PMS5003 sensor
then:
- switch.turn_on: pms_switch
- delay: 30s
- switch.turn_off: pms_switch

# Source: https://github.com/airgradienthq/arduino/blob/master/AirGradient.cpp#L123
switch:
- platform: template
name: "PMS5003"
id: pms_switch
optimistic: true
turn_on_action:
- uart.write:
id: pms5003_uart
data: [0x42, 0x4D, 0xE4, 0x00, 0x01, 0x01, 0x74]
turn_off_action:
- uart.write:
id: pms5003_uart
data: [0x42, 0x4D, 0xE4, 0x00, 0x00, 0x01, 0x73]
```

While it works fine, there is a warning:

```
[W][pmsx003:108]: PMSX003 length 4 doesn't match. Are you using the correct PMSX003 type?
```

The thread speculates that it is simply due to ESPHome expecting more data than is sent for this command given it only supports receiving measurement data.

Source of code above: https://forum.airgradient.com/t/extending-the-life-span-of-the-pms5003-sensor/114/9

This post gives more insight on what data is sent back:

https://forum.airgradient.com/t/extending-the-life-span-of-the-pms5003-sensor/114/13

**Additional context**

The thread where I found the information in this FR is:

https://forum.airgradient.com/t/extending-the-life-span-of-the-pms5003-sensor/114

I claim absolutely no credits! I am only relaying this in hopes that someone will merge this into ESPHome for official support.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.