home-assistant / core

:house_with_garden: Open source home automation that puts local control and privacy first.
https://www.home-assistant.io
Apache License 2.0
72.94k stars 30.52k forks source link

Sensirion SPS30 via Tasmota missing device classes and units #106296

Closed arnowelzel closed 3 months ago

arnowelzel commented 10 months ago

The problem

I use a Sensirion SPS30 connected to Tasmota and reporting values via MQTT.

In Tasmota the SPS30 reports four values for particle matter: PM 1.0, PM 2.5, PM 4.0, PM 10. All values are expressed as ug/m³.

However in Home Assistant, only PM 10 is correct as "particle matter". All other values don't use the same device class and therefore are only reported as numeric values.

The following partial JSON shows the issue - for PM10 HomeAssistant reports µg/m³ as unit_of_measurement and pm10 as device_class. However all other values are missing that.

The result is, that in the UI these values are only visualized as state and can not be used for graphing.

  {
    "entity_id": "sensor.tasmota_sps30_pm1_0",
    "state": "0.2",
    "attributes": {
      "friendly_name": "Tasmota SPS30 PM1_0"
    },
    "last_changed": "2023-12-23T09:42:58.533074+00:00",
    "last_updated": "2023-12-23T09:42:58.533074+00:00",
    "context": {
      "id": "01HJB0WWQ50W2RK17PP60TENYG",
      "parent_id": null,
      "user_id": null
    }
  },
  {
    "entity_id": "sensor.tasmota_sps30_pm2_5",
    "state": "0.35",
    "attributes": {
      "friendly_name": "Tasmota SPS30 PM2_5"
    },
    "last_changed": "2023-12-23T09:42:58.533387+00:00",
    "last_updated": "2023-12-23T09:42:58.533387+00:00",
    "context": {
      "id": "01HJB0WWQ5NFHRCCJTRSHCWD8W",
      "parent_id": null,
      "user_id": null
    }
  },
  {
    "entity_id": "sensor.tasmota_sps30_pm4_0",
    "state": "0.46",
    "attributes": {
      "friendly_name": "Tasmota SPS30 PM4_0"
    },
    "last_changed": "2023-12-23T09:42:58.533691+00:00",
    "last_updated": "2023-12-23T09:42:58.533691+00:00",
    "context": {
      "id": "01HJB0WWQ5XND4CGGS35F43MJX",
      "parent_id": null,
      "user_id": null
    }
  },
  {
    "entity_id": "sensor.tasmota_sps30_pm10",
    "state": "0.51",
    "attributes": {
      "state_class": "measurement",
      "unit_of_measurement": "µg/m³",
      "device_class": "pm10",
      "friendly_name": "Tasmota SPS30 PM10"
    },
    "last_changed": "2023-12-23T09:42:58.534014+00:00",
    "last_updated": "2023-12-23T09:42:58.534014+00:00",
    "context": {
      "id": "01HJB0WWQ6BKVXZCY2XZ910MER",
      "parent_id": null,
      "user_id": null
    }
  },

What version of Home Assistant Core has the issue?

core-2023.12.3

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

Integration causing the issue

tasmota

Link to integration documentation on our website

https://www.home-assistant.io/integrations/tasmota/

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

home-assistant[bot] commented 10 months ago

Hey there @emontnemery, mind taking a look at this issue as it has been labeled with an integration (tasmota) you are listed as a code owner for? Thanks!

Code owner commands Code owners of `tasmota` can trigger bot actions by commenting: - `@home-assistant close` Closes the issue. - `@home-assistant rename Awesome new title` Renames the issue. - `@home-assistant reopen` Reopen the issue. - `@home-assistant unassign tasmota` Removes the current integration label and assignees on the issue, add the integration domain after the command. - `@home-assistant add-label needs-more-information` Add a label (needs-more-information, problem in dependency, problem in custom component) to the issue. - `@home-assistant remove-label needs-more-information` Remove a label (needs-more-information, problem in dependency, problem in custom component) on the issue.

(message by CodeOwnersMention)


tasmota documentation tasmota source (message by IssueLinks)

emontnemery commented 7 months ago

@arnowelzel please share what the sensor update from the tasmota device looks like. In the Tasmota console, type in status 8 and share the output here.

arnowelzel commented 7 months ago

@emontnemery Here you go:

stat/tasmota_C04EDC/STATUS8 = {"StatusSNS":{"Time":"2024-03-05T19:25:48","SCD30":{"CarbonDioxide":693,"eCO2":662,"Temperature":22.9,"Humidity":35.8,"DewPoint":6.9},"SPS30":{"PM1_0":1.90,"PM2_5":2.01,"PM4_0":2.01,"PM10":2.01,"NCPM0_5":13.16,"NCPM1_0":15.14,"NCPM2_5":15.19,"NCPM4_0":15.19,"NCPM10":15.19,"TYPSIZ":0.45},"TempUnit":"C"}}
agomezxff commented 7 months ago

I think you missed the sensor. Ah you got 2 :) I got this: 19:57:20.851 MQT: stat/tasmota_5D42D3/STATUS8 = {"StatusSNS":{"Time":"2024-03-28T19:57:20","SPS30":{"PM1_0":1.41,"PM2_5":1.73,"PM4_0":1.93,"PM10":2.03,"NCPM0_5":8.99,"NCPM1_0":10.89,"NCPM2_5":11.18,"NCPM4_0":11.22,"NCPM10":11.22,"TYPSIZ":0.60}}}

issue-triage-workflows[bot] commented 4 months ago

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates. Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍 This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.