esphome / issues

Issue Tracker for ESPHome
https://esphome.io/
290 stars 36 forks source link

device_class frequency for modbus sensor not allowed #3014

Closed pki791 closed 2 years ago

pki791 commented 2 years ago

The problem

As i am integrating some energy measure equipment via modbus, i can not set the device_class to frequency. Voltage, current, power etc are fine.

Which version of ESPHome has the issue?

2022.1.2

What type of installation are you using?

Home Assistant Add-on

Which version of Home Assistant has the issue?

2022.2.0

What platform are you using?

ESP8266

Board

No response

Component causing the issue

No response

Example YAML snippet

uart:
  id: mod_bus
  tx_pin: GPIO01
  rx_pin: GPIO03
  baud_rate: 19200
  stop_bits: 1

modbus:
  id: modbus_reader_01

modbus_controller:
  - id: meter01
    address: 0x1
    modbus_id: modbus_reader_01
    setup_priority: -10
    update_interval: ${updates}

sensor:
  - platform: modbus_controller
    modbus_controller_id: meter01
    name: ${full_device_name} Frequency
    device_class: frequency
    state_class: "measurement"
    id: frequency
    register_type: read
    address: 0x0047
    unit_of_measurement: "Hz"
    value_type: U_DWORD
    accuracy_decimals: 1
    filters:
      - multiply: 0.1
    skip_updates: 5

Anything in the logs that might be useful for us?

INFO Reading configuration /config/esphome/g18-modbus-ds.yaml...
Failed config

sensor.modbus_controller: [source /config/esphome/g18-modbus-ds.yaml:192]
  platform: modbus_controller
  modbus_controller_id: meter01
  name: G18-Pomiary-Dom Frequency

  Unknown value 'frequency', valid options are '', 'aqi', 'battery', 'carbon_dioxide', 'carbon_monoxide', 'current', 'energy', 'gas', 'humidity', 'illuminance', 'monetary', 'nitrogen_dioxide', 'nitrogen_monoxide', 'nitrous_oxide', 'ozone', 'pm1', 'pm10', 'pm25', 'power', 'power_factor', 'pressure', 'signal_strength', 'sulphur_dioxide', 'temperature', 'timestamp', 'volatile_organic_compounds', 'voltage'.
  device_class: frequency [source /config/esphome/g18-modbus-ds.yaml:195]
  state_class: measurement
  id: frequency
  register_type: read
  address: 71
  unit_of_measurement: Hz
  value_type: U_DWORD
  accuracy_decimals: 1
  filters: 
    - multiply: 0.1
  skip_updates: 5

Additional information

No response

probot-esphome[bot] commented 2 years ago

Hey there @esphome/core, mind taking a look at this issue as it has been labeled with an integration (sensor) you are listed as a code owner for? Thanks! (message by CodeOwnersMention)

github-actions[bot] commented 2 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.