cnstudio / Taipower-Bimonthly-Energy-Cost-homeassistant

Calculate Taipower (Taiwan Power Company) bi-monthly bill amount from kWh sensor on Home Assistant.
MIT License
67 stars 7 forks source link

[BUG] device class 警告訊息 #18

Closed chehaochang closed 1 year ago

chehaochang commented 1 year ago

簡單一句話描述你的問題

系統有出現警告訊息 Logger: homeassistant.components.sensor Source: components/sensor/init.py:503 Integration: 感測器 (documentation, issues) First occurred: 01:07:43 (2 occurrences) Last logged: 01:07:43

Entity sensor.sensor_energy_summation_kwh_cost (<class 'custom_components.taipower_bimonthly_cost.sensor.KwhCostSensor'>) is using state class 'measurement' which is impossible considering device class ('monetary') it is using; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author. Entity sensor.sensor_energy_summation_power_cost (<class 'custom_components.taipower_bimonthly_cost.sensor.EnergyCostSensor'>) is using state class 'measurement' which is impossible considering device class ('monetary') it is using; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author.

你的執行環境

Home Assistant 2023.2.1 Supervisor 2023.01.1 Operating System 9.5

瀏覽器是什麼

如何重現這個問題的步驟?

你預期的結果應該是?

是否知道/猜測問題發生的原因?

有無任何錯誤或其它訊息?

cnstudio commented 1 year ago

您好, 類似的問題似乎在新版的 HA 2023.2 之後開始發生, 目前正在調查中, 首先請問您雖然有這個警告訊息但計算功能是否都正常?

再請問您可否試試看進入 "開發工具" -> "狀態" -> 找到並點擊 sensor.sensor_energy_summation_kwh_cost 後 -> 於 "狀態屬性(YAML,選項)" 下方把 "state_class: measurement" 這一行刪除後 -> 按下 "設定狀態" 按鈕. (sensor.sensor_energy_summation_power_cost 也是同樣動作)

上面動作做完後看看這兩個警告訊息會不會消失?

chehaochang commented 1 year ago

你好

目前歷史紀錄有持續累計計算 image

有依照你的步驟刪除,但未重開機前,系統會自動加回去。

另外發現另一個問題,新增整合時,無法進行輸入抄表日期。 image

cnstudio commented 1 year ago

您好, 感謝您的回饋, 目前還有些問題請問: 1: class 警告訊息在剛發布的 HA 2023.2.2 版裡面應該已經修復了, 如果您可以升級 HA 2023.2.2 的話請問是否還會看到這兩個警告訊息? 2: 怪了, 日期問題應該在上一版已經修正了, 請問您安裝本元件的版本是 v0.51.9 的最新版嗎?

chehaochang commented 1 year ago

你好

  1. 更新至2023.2.2,還是有顯示警告。
  2. 不好意思,我原本使用0.51.8,已更新至0.51.9。
cnstudio commented 1 year ago

您好, 麻煩您在 HACS 內開啟安裝 beta 版本程式功能後安裝 v0.51.9b (版本號結尾有個 "b" 字眼), 看看還有沒有這兩個警告訊息? 謝謝您.

chehaochang commented 1 year ago

你好

安裝 v0.51.9b 後無出現警告訊息。

cnstudio commented 1 year ago

謝謝您的回饋, 將發布新 v0.52.0 正式版解決這個問題.