Esp32 + pms7003

Hi all,

i’ve some problem configuring PMS7003 module. Below is my config:

sensor:
#Wiring
#PMS7003  >> esp32 expressif
  #VCC > VIN (5V)
  #GND > GND
  #TX > GPIO3 (RX)
  #SET > GPIO23 (Sleep)
  - platform: pmsx003
    type: PMSX003
    pm_1_0:
      name: "PM 1.0µm"
      id: pm_1_0
    pm_2_5:
      name: "PM 2.5µm"
      id: pm_2_5 
    pm_10_0:
      name: "PM 10µm"
      id: pm_10_0
  - platform: wifi_signal
    name: "WiFi Signal Air Quality"
    update_interval: 60s
  - platform: template
    name: "PM ok 2.5µm Concentration"
    id: pm_2_5_ok
    icon: mdi:chemical-weapon
    unit_of_measurement: "µg/m³"
    accuracy_decimals: 0
    lambda: |-
      if (id(pms_warm).state) {
        return (id(pm_2_5).state);
      } else {
        return {};
      }
    update_interval: 1s
    filters:
    - sliding_window_moving_average:
        window_size: 10
        send_every: 10
        send_first_at: 10
        
binary_sensor:
  - platform: template
    name: "PMS is awake and warm"
    id: pms_warm
    lambda: |-
      if (id(pms_set).state) {
        return true;
      } else {
        return false;
      }
    filters:
      - delayed_on: 30s

switch:
#Turns PMS sleep on and off.
  - platform: gpio
    pin: 
      number: GPIO23
      inverted: no
    id: pms_set
    name: "PMS7003 is awake"
    
interval:
#Controls Sleep Interval by turning on/off above switch
  - interval: 180s
    then:
      - switch.turn_on: pms_set
      - delay: 60s
      - switch.turn_off: pms_set

logs:

[17:06:43][D][pmsx003:175]: Got PM1.0 Concentration: 22 µg/m^3, PM2.5 Concentration 33 µg/m^3, PM10.0 Concentration: 38 µg/m^3
[17:06:43][D][sensor:113]: 'PM 1.0µm': Sending state 22.00000 µg/m³ with 0 decimals of accuracy
[17:06:43][D][sensor:113]: 'PM 2.5µm': Sending state 33.00000 µg/m³ with 0 decimals of accuracy
[17:06:43][D][sensor:113]: 'PM 10µm': Sending state 38.00000 µg/m³ with 0 decimals of accuracy

ESP32 is working correctly as stated in logs but Hassio is not creating sensor for pm1.0. I’ve tried deleting and recreating integration without succes. Hassio see only pm2.5 and pm10.

Another question is about sensor reading. The sensor is used in house and is constantly reporting pm 2.5 above 20-25 that I supposed is high for indoor use. Is there a calibration procedure or my air is so bad?
Thank you

For your first question, I’m not sure why it isn’t seeing the data being sent as it is clear that it is reading it. Is it not showing up in entities at all?

With regards to the second, I do find these devices to be hit and miss. For example, here is one of the rooms that has a pm1006 in.

Screenshot 2022-01-11 at 14.44.06

Either we have a huge problem with pollution and rubbish in the air or there are other factors which do skew the readings and I’m more inclined to believe this now having run them for a year. Where is the sensor placed? is it near radiators or other bits that could mess the readings up?

Hassio see the device but only show up 4 entities, pm10, pm2.5,wifi and pm25_ok. No pm1.0 at all.

Now the device is near a radiator, tomorrow i’ll try moving in a more “quiet” place and see if the reading is better. My idea is to read incoming air from the MEV and trun it off if outdoor air is bad.

Did someone found a solution to show the pm1.0 entity?

Another question, I want to deactivate the measurement through a switch, which is implemented in HA.
Background is, that the sensor should only be active when the window is open to detect if the neighbours make a fire in their garden. I will close the windows then…
Can someone help me with the code?

thanks

hey i have the same problem did u solve it

unfortunately no

i solved it just change entity name in yaml into this
sensor:

  • platform: pmsx003

    type: PMSX003

    pm_1_0:

    name: “PM 1µm”

    id: pm_1_0

    pm_2_5:

    name: “PM 2.5µm”

    id: pm_2_5

    pm_10_0:

    name: “PM 10µm”

    id: pm_10_0

it somehow messes things when named PM 1.0µm

I changed sensor name as suggested but it keeps logging:

Platform esphome does not generate unique IDs. ID air-qualitysensorpm_10m already exists - ignoring sensor.pm_10um
Platform esphome does not generate unique IDs. ID air-qualitysensorpm_ok_10m_concentration already exists - ignoring sensor.pm_ok_1_0um_concentration

my yaml:

  - platform: pmsx003
     type: PMSX003
     pm_1_0:
       name: "PM 1.0µm"
       id: pm_1_0
     pm_2_5:
       name: "PM 2.5µm"
       id: pm_2_5 
     pm_10_0:
       name: "PM 10µm"
       id: pm_10_0
   - platform: wifi_signal
     name: "WiFi Signal Air Quality"
     update_interval: 60s
   - platform: template
     name: "PM ok 2.5µm Concentration"
     id: pm25_ok
     icon: mdi:chemical-weapon
     unit_of_measurement: "µg/m³"
     accuracy_decimals: 0
     lambda: |-
       if (id(pms_warm).state) {
         return (id(pm_2_5).state);
       } else {
         return {};
       }
     update_interval: 1s
     filters:
     - sliding_window_moving_average:
         window_size: 10
         send_every: 10
         send_first_at: 10
   - platform: template
     name: "PM ok 10µm Concentration"
     id: pm10_ok
     icon: mdi:chemical-weapon
     unit_of_measurement: "µg/m³"
     accuracy_decimals: 0
     lambda: |-
       if (id(pms_warm).state) {
         return (id(pm_10_0).state);
       } else {
         return {};
       }
     update_interval: 1s
     filters:
     - sliding_window_moving_average:
         window_size: 10
         send_every: 10
         send_first_at: 10
   - platform: template
     name: "PM ok 1.0µm Concentration"
     id: pm1_ok
     icon: mdi:chemical-weapon
     unit_of_measurement: "µg/m³"
     accuracy_decimals: 0
     lambda: |-
       if (id(pms_warm).state) {
         return (id(pm_1_0).state);
       } else {
         return {};
       }
     update_interval: 1s
     filters:
     - sliding_window_moving_average:
         window_size: 10
         send_every: 10
         send_first_at: 10

delete .0 from pm 1.0um

now it’s showing! Thank you