Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
MQTT Discovery: missing state_class for power sensors in Home Assistant
#1
Hello,
I noticed an issue with the MQTT Discovery configuration generated by the N30 when the device is integrated into Home Assistant.
For example, Home Assistant creates the following entity:
Code:
sensor.n30_d0cf13020244_energy2_ch2_power
The N30 publishes this MQTT Discovery payload:
Code:
{
  "uniq_id": "D0CF13020244_sensor_energy2_power_ch2",
  "~": "homeassistant/sensor/D0CF13020244energy2_power_ch2",
  "name": "energy2_ch2.power",
  "device": {
    "name": "N30-D0CF13020244",
    "identifiers": "D0CF13020244",
    "manufacturer": "KinCony",
    "model": "N30"
  },
  "config_topic": "~/config",
  "avty_t": "D0CF13020244/avail",
  "unit_of_meas": "W",
  "dev_cla": "power",
  "val_tpl": "{{ value | float | round(1) }}",
  "stat_t": "~/state"
}
In Home Assistant, the entity is therefore detected with:
Code:
device_class: power
unit_of_measurement: W
but without:
Code:
state_class: measurement
The missing field in the MQTT Discovery payload is:
Code:
"stat_cla": "measurement"
Interestingly, some other N30 power sensors are correctly detected by Home Assistant with:
Code:
state_class: measurement
unit_of_measurement: W
device_class: power
For example,
Code:
sensor.n30_bl0910_1_power_6
already has the correct
Code:
state_class
.
This suggests that the issue is specific to some of the MQTT Discovery configurations generated by the N30 firmware, particularly the
Code:
energy*_ch*_power
sensors.
Could you please check the N30 firmware and add:
Code:
"stat_cla": "measurement"
to the MQTT Discovery configuration of all instantaneous power sensors?
The expected configuration would be:
Code:
"unit_of_meas": "W",
"dev_cla": "power",
"stat_cla": "measurement"
This would allow Home Assistant to correctly identify these entities as power measurements and use them properly for statistics and energy-related features.
Thank you.
Reply
#2
we will check and feedback later.
Reply
#3
new fimrware have added "measurement". you can download for testing:
New KCS V3.27.4_beta_20261012-010554 Test Firmware:
1. Added a manual current direction reversal setting for CT sensors.
2. Extended the maximum CT sensor channel name length to 32 characters.
3. Moved “Clear All Energy Data” to the Energy → Settings page, with separate options for “Clear All Energy Data” and “Reset Calibration Factors.”
4. Added the statistics attribute to MQTT messages reported to Home Assistant.
5. Fixed missing CRC validation in certain cases that could result in incorrect data.
6. Fixed an issue on N-series energy meters where MQTT reported incorrect zero energy readings after the initial power-up.

.zip   KCS_N30_V3.27.4_beta_20261012-010554.zip (Size: 1.09 MB / Downloads: 27)
Reply


Forum Jump:


Users browsing this thread:
1 Guest(s)