Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The ’power_cost_month‘ and ’power_cost_today‘ attributes are lost after the 0.7.16 update #1562

Closed
SeanChengN opened this issue Mar 7, 2024 · 17 comments
Labels
bug Something isn't working

Comments

@SeanChengN
Copy link
Contributor

Device model / 设备型号

cuco.plug.cp1md

Component version / 插件版本

0.7.16

HA core version / HA版本

2024.3.0

Integrated mode / 集成方式

Automatic (自动模式)

The problem / 问题详情

chrome_jlXMNtPO5i

Entity attributes / 实体属性

model: cuco.plug.cp1md
lan_ip: 192.168.31.46
mac_address: 10:B7:13:ED:18:EF
entity_class: MiotSwitchEntity
home_room: SeanCheng的家 三楼书房
miot_type: urn:miot-spec-v2:device:outlet:0000A002:cuco-cp1md:1
switch.on: true
switch.power_consumption: 0
switch.voltage: 2200
switch.electric_current: 409
switch.power: 90
physical_controls_locked: true
state_updater: lan
power_cost_today: 1306
power_cost_month: 17704
sub_entities: power_cost_today, power_cost_month, switch-2.voltage-3, switch-2.electric_current-4, power-4.power-2, physical_controls_locked-6.physical_controls_locked-1
device_class: outlet
friendly_name: 书房电量计 Switch
supported_features: 0

Home Assistant Logs / 系统日志

No response

@lx521q
Copy link

lx521q commented Mar 7, 2024

me too, The power_cost_today isn't working. How to do?

@EnnawYang
Copy link

EnnawYang commented Mar 8, 2024

cuco.plug.cp2d cuco.acpartner.cp6 is also, on Xiaomi Miot Auto 0.7.16 + HA 2024.3.0

@chs72
Copy link

chs72 commented Mar 8, 2024

cuco.plug.v3 也是一样问题

@flyibeat
Copy link

flyibeat commented Mar 8, 2024

me too, The power_cost_today isn't working. How to do?

cuco.plug.v3 也是一样问题

the same issue. back to 0.7.15,it does not work

@flyibeat
Copy link

flyibeat commented Mar 8, 2024

me too, The power_cost_today isn't working. How to do?

cuco.plug.v3 也是一样问题

the same issue. back to 0.7.15,it does not work

now,homeassistant 2024.2.4 and xiaomi miot auto 0.7.16,it work.

@he-sb
Copy link

he-sb commented Mar 8, 2024

same issue after upgrade to 0.7.16

device:

  • lumi.acpartner.mcn02
  • cuco.plug.cp2d
  • cuco.plug.v3

software version info:

  • home-assistant 2024.3.0
  • Xiaomi Miot Auto 0.7.16

@flyibeat
Copy link

flyibeat commented Mar 8, 2024

me too, The power_cost_today isn't working. How to do?

cuco.plug.v3 也是一样问题

the same issue. back to 0.7.15,it does not work

now,homeassistant 2024.2.4 and xiaomi miot auto 0.7.16,it work.

if upgrade to homeassistant2024.3.0 ,it does not work
version info:
ha 2024.3.0
miot auto 0.7.16

log of ha 2024.3.0

日志: homeassistant
来源: util/timeout.py:469
首次发生: 16:08:22 (9 全部发生)
上次记录: 16:08:52

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 625, in async_add_entities
await add_func(coros, entities, timeout)
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 573, in _async_add_entities
async with self.hass.timeout.async_timeout(timeout, self.domain):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/util/timeout.py", line 469, in async_timeout
current_task: asyncio.Task[Any] | None = asyncio.current_task()
^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: no running event loop

@EnnawYang
Copy link

me too, The power_cost_today isn't working. How to do?

cuco.plug.v3 也是一样问题

the same issue. back to 0.7.15,it does not work

now,homeassistant 2024.2.4 and xiaomi miot auto 0.7.16,it work.

HA 2024.2.5 + Xiaomi Miot Auto 0.7.16 , works

@he-sb
Copy link

he-sb commented Mar 9, 2024

me too, The power_cost_today isn't working. How to do?

cuco.plug.v3 也是一样问题

the same issue. back to 0.7.15,it does not work

now,homeassistant 2024.2.4 and xiaomi miot auto 0.7.16,it work.

HA 2024.2.5 + Xiaomi Miot Auto 0.7.16 , works

Yep, after rolled back HA to 2024.2.5 , it works fine now.

@alanshu8
Copy link

alanshu8 commented Mar 9, 2024

same issue here.
Also xiaomi 增强版‘s power information lost as well.

@sevenclockseven
Copy link

设备开关实体属性里边有电量,我的解决办法是属性转实体了

@theodorx7
Copy link

设备开关实体属性里边有电量,我的解决办法是属性转实体了

A good and reliable solution. But for greater order, it’s worth finding out whether there are errors of this type in the log:

Platform xiaomi_miot does not generate unique IDs. ID b8:50:d8:48:d8:37-power_consumption-11.electric_power-2 is already used by sensor.cuco_v2eur_d837_electric_power - ignoring sensor.cuco_v2eur_d837_electric_power

If yes, then you need to edit the file /homeassistant/.storage/core.entity_registry
Specifically in my case and with my device cuco.plug.v2eur we need to find both entities and delete them

In my case, I deleted these two entities and the problem was solved:

      {
        "aliases": [],
        "area_id": null,
        "capabilities": {
          "state_class": "measurement"
        },
        "config_entry_id": "f9c56e33fd0977c6ad79b67effb15737",
        "device_class": null,
        "device_id": "bf608a2f29754bdc04f3b68e415a2384",
        "disabled_by": null,
        "entity_category": null,
        "entity_id": "sensor.cuco_v2eur_d837_electric_power",
        "hidden_by": null,
        "icon": null,
        "id": "c94db59521eb7d1ae1527521b6e729e4",
        "has_entity_name": false,
        "labels": [],
        "name": "Мощность духовки",
        "options": {
          "conversation": {
            "should_expose": false
          },
          "sensor": {
            "display_precision": null
          }
        },
        "original_device_class": "power",
        "original_icon": null,
        "original_name": "Духовка Power Consumption Electric",
        "platform": "xiaomi_miot",
        "supported_features": 0,
        "translation_key": "power_consumption.electric_power",
        "unique_id": "b8:50:d8:48:d8:37-power_consumption-11.electric_power-2",
        "previous_unique_id": null,
        "unit_of_measurement": "W"
      },

@yjlin0224
Copy link

我也遇到這問題,暫時用 {{ state_attr("switch.near_door_main_outlet", "power_consumption-4-5") }} 解決

@al-one
Copy link
Owner

al-one commented Mar 14, 2024

Try master branch.

@WalterDSU
Copy link

群主,chuangmi.plug.v3的累计功耗还是不行。你漏改了吧?

@alanshu8
Copy link

Recovered in 0.7.17, very nice, tks.

@al-one al-one closed this as completed Mar 16, 2024
@he-sb
Copy link

he-sb commented Mar 16, 2024

Works fine now, huge thx!

application version:

  • HA: 2024.3.1
  • Xiaomi Miot Auto: 0.7.17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests