bramstroker / homeassistant-powercalc

Custom component to calculate estimated power consumption of lights and other appliances
MIT License
1.02k stars 262 forks source link

LCA007 lookup not working with 1.12.0 #2230

Closed ejpenney closed 6 months ago

ejpenney commented 6 months ago

System Health details

System Information

version core-2024.5.1
installation_type Home Assistant OS
dev false
hassio true
docker true
user root
virtualenv false
python_version 3.12.2
os_name Linux
os_version 6.6.25-haos
arch x86_64
timezone America/Los_Angeles
config_dir /config
Home Assistant Community Store GitHub API | ok -- | -- GitHub Content | ok GitHub Web | ok GitHub API Calls Remaining | 4988 Installed Version | 1.34.0 Stage | waiting Available Repositories | 1417 Downloaded Repositories | 61 HACS Data | ok
Home Assistant Cloud logged_in | false -- | -- can_reach_cert_server | ok can_reach_cloud_auth | ok can_reach_cloud | ok
Home Assistant Supervisor host_os | Home Assistant OS 12.2 -- | -- update_channel | stable supervisor_version | supervisor-2024.04.4 agent_version | 1.6.0 docker_version | 25.0.5 disk_total | 46.5 GB disk_used | 30.6 GB healthy | true supported | true board | ova supervisor_api | ok version_api | ok installed_addons | Home Assistant Google Drive Backup (0.112.1), Advanced SSH & Web Terminal (17.2.0), RTSP Simple Server Add-on (v0.17.6), Studio Code Server (5.15.0), Z-Wave JS UI (3.6.0), ESPHome (2024.4.2), Docker Wyze Bridge (2.8.3), Glances (0.21.1), Firefox (1.2.0), eufy-security-ws (1.8.0-2), OnStar2MQTT Home Assistant Add-on (BigThunderSR) for Vehicle 1 (1.18.2)
Dashboards dashboards | 6 -- | -- resources | 26 views | 26 mode | storage
Recorder oldest_recorder_run | April 24, 2024 at 11:01 AM -- | -- current_recorder_run | May 3, 2024 at 10:46 AM estimated_db_size | 2218.57 MiB database_engine | sqlite database_version | 3.44.2
Sonoff version | 3.7.3 (e240aaf) -- | -- cloud_online | 1 / 1 local_online | 1 / 1

Checklist

Describe the issue

No longer getting profiles for LCA007 bulbs:

light.great_room_1: Skipping sensor setup: No lookup file found for mode: color_temp

But if I understand this, then it should be this file:

Reproduction steps

  1. Upgrade from 1.11.8 to 1.12.0
  2. Energy sensors for LCA007 bulbs are Unavailable
  3. Check logs ...

Debug logs

2024-05-03 11:10:43.598 DEBUG (MainThread) [custom_components.powercalc.discovery] light.great_room_1: Auto discovered model (manufacturer=Signify Netherlands B.V., model=Hue color lamp (LCA007))
2024-05-03 11:10:43.599 DEBUG (MainThread) [custom_components.powercalc.sensors.power] Creating power sensor (entity_id=light.great_room_1 entity_category=None, sensor_name=Great room 1 power strategy=lut manufacturer=signify model=LCA007 unique_id=pc_0c4e60b3-38cc-4a75-ac2d-34f9d2e49023)
2024-05-03 11:10:43.599 ERROR (MainThread) [custom_components.powercalc.sensors.power] light.great_room_1: Skipping sensor setup: No lookup file found for mode: color_temp
2024-05-03 11:10:43.599 ERROR (MainThread) [custom_components.powercalc.sensor] No energy sensor created for config_entry ce77e5352cb98890d07e2587ec2baf0a

Diagnostics dump or YAML config

{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2024.5.1",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.12.2",
    "docker": true,
    "arch": "x86_64",
    "timezone": "America/Los_Angeles",
    "os_name": "Linux",
    "os_version": "6.6.25-haos",
    "supervisor": "2024.04.4",
    "host_os": "Home Assistant OS 12.2",
    "docker_version": "25.0.5",
    "chassis": "vm",
    "run_as_root": true
  },
  "custom_components": {
    "samsungtv_smart": {
      "documentation": "https://github.com/ollo69/ha-samsungtv-smart",
      "version": "0.13.4",
      "requirements": [
        "websocket-client!=1.4.0,>=0.58.0",
        "wakeonlan>=2.0.0",
        "aiofiles>=0.8.0",
        "casttube>=0.2.1"
      ]
    },
    "webrtc": {
      "documentation": "https://github.com/AlexxIT/WebRTC",
      "version": "v3.5.0",
      "requirements": []
    },
    "adaptive_lighting": {
      "documentation": "https://github.com/basnijholt/adaptive-lighting#readme",
      "version": "1.21.1",
      "requirements": [
        "ulid-transform"
      ]
    },
    "npm_switches": {
      "documentation": "https://github.com/InTheDaylight14/nginx-proxy-manager-switches",
      "version": "1.0.2",
      "requirements": []
    },
    "smartthinq_sensors": {
      "documentation": "https://github.com/ollo69/ha-smartthinq-sensors",
      "version": "0.39.0",
      "requirements": [
        "pycountry>=23.0.0",
        "xmltodict>=0.13.0",
        "charset_normalizer>=3.2.0"
      ]
    },
    "teamtracker": {
      "documentation": "https://github.com/vasqued2/ha-teamtracker",
      "version": "0.1",
      "requirements": [
        "arrow",
        "aiofiles"
      ]
    },
    "frigate": {
      "documentation": "https://github.com/blakeblackshear/frigate",
      "version": "5.1.0",
      "requirements": [
        "pytz"
      ]
    },
    "proxmoxve": {
      "documentation": "https://github.com/dougiteixeira/proxmoxve",
      "version": "3.4.1",
      "requirements": [
        "proxmoxer==2.0.1"
      ]
    },
    "thermal_comfort": {
      "documentation": "https://github.com/dolezsa/thermal_comfort/blob/master/README.md",
      "version": "2.2.2",
      "requirements": []
    },
    "asusrouter": {
      "documentation": "https://asusrouter.vaskivskyi.com",
      "version": "0.31.0",
      "requirements": [
        "asusrouter==1.9.0"
      ]
    },
    "fitbit4": {
      "documentation": "https://www.home-assistant.io/integrations/fitbit",
      "version": "1.2.3",
      "requirements": [
        "fitbit==0.3.1"
      ]
    },
    "bhyve": {
      "documentation": "https://github.com/sebr/bhyve-home-assistant/blob/main/README.md",
      "version": "3.2.4",
      "requirements": []
    },
    "browser_mod": {
      "documentation": "https://github.com/thomasloven/hass-browser_mod/blob/master/README.md",
      "version": "2.3.0",
      "requirements": []
    },
    "omada": {
      "documentation": "https://github.com/zachcheatham/ha-omada",
      "version": "0.4.0-beta.1",
      "requirements": []
    },
    "govee": {
      "documentation": "https://github.com/LaggAt/hacs-govee/blob/master/README.md",
      "version": "2023.11.1",
      "requirements": [
        "govee-api-laggat==0.2.2",
        "dacite==1.8.0"
      ]
    },
    "fitbit2": {
      "documentation": "https://www.home-assistant.io/integrations/fitbit",
      "version": "1.2.3",
      "requirements": [
        "fitbit==0.3.1"
      ]
    },
    "wyzeapi": {
      "documentation": "https://github.com/SecKatie/ha-wyzeapi#readme",
      "version": "0.1.24",
      "requirements": [
        "wyzeapy==0.5.21"
      ]
    },
    "alarmo": {
      "documentation": "https://github.com/nielsfaber/alarmo",
      "version": "v1.10.0",
      "requirements": []
    },
    "watchman": {
      "documentation": "https://github.com/dummylabs/thewatchman",
      "version": "0.5.1",
      "requirements": [
        "prettytable==3.0.0"
      ]
    },
    "bluetooth_tracker": {
      "documentation": "https://www.home-assistant.io/integrations/bluetooth_tracker",
      "version": "1.0.0",
      "requirements": [
        "bt-proximity==0.2.1",
        "git+https://github.com/pybluez/pybluez.git#pybluez==0.30"
      ]
    },
    "astroweather": {
      "documentation": "https://github.com/mawinkler/astroweather",
      "version": "0.42.3",
      "requirements": [
        "pyastroweatherio==0.43.1.dev8"
      ]
    },
    "powercalc": {
      "documentation": "https://github.com/bramstroker/homeassistant-powercalc",
      "version": "v1.12.0",
      "requirements": [
        "numpy>=1.21.1"
      ]
    },
    "fitbit3": {
      "documentation": "https://www.home-assistant.io/integrations/fitbit",
      "version": "1.2.3",
      "requirements": [
        "fitbit==0.3.1"
      ]
    },
    "avanza_stock": {
      "documentation": "https://github.com/custom-components/sensor.avanza_stock",
      "version": "1.5.2",
      "requirements": [
        "pyavanza==0.7.1"
      ]
    },
    "pitboss": {
      "documentation": "https://github.com/dknowles2/ha-pitboss",
      "version": "2024.2.1",
      "requirements": [
        "pytboss==2024.2.1"
      ]
    },
    "worlds_air_quality_index": {
      "documentation": "https://github.com/pawkakol1/worlds-air-quality-index",
      "version": "1.1.0",
      "requirements": []
    },
    "eufy_security": {
      "documentation": "https://github.com/fuatakgun/eufy_security",
      "version": "8.0.2",
      "requirements": [
        "websocket-client==1.4.2",
        "aiortsp==1.3.7"
      ]
    },
    "sonoff": {
      "documentation": "https://github.com/AlexxIT/SonoffLAN",
      "version": "3.7.3",
      "requirements": [
        "pycryptodome>=3.6.6"
      ]
    },
    "google_home": {
      "documentation": "https://github.com/leikoilja/ha-google-home",
      "version": "1.11.0",
      "requirements": [
        "glocaltokens==0.7.0"
      ]
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/configuration/start",
      "version": "1.34.0",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "xiaomi_cloud_map_extractor": {
      "documentation": "https://github.com/PiotrMachowski/Home-Assistant-custom-components-Xiaomi-Cloud-Map-Extractor",
      "version": "v2.2.0",
      "requirements": [
        "pillow",
        "pybase64",
        "python-miio",
        "requests",
        "pycryptodome"
      ]
    },
    "nest_protect": {
      "documentation": "https://github.com/imicknl/ha-nest-protect",
      "version": "0.4.0b1",
      "requirements": []
    },
    "localtuya": {
      "documentation": "https://github.com/xZetsubou/hass-localtuya/",
      "version": "3.2.5",
      "requirements": []
    },
    "fitbit1": {
      "documentation": "https://www.home-assistant.io/integrations/fitbit",
      "version": "1.2.3",
      "requirements": [
        "fitbit==0.3.1"
      ]
    },
    "cryptoinfo": {
      "documentation": "https://github.com/heyajohnny/cryptoinfo",
      "version": "0.1.7",
      "requirements": []
    }
  },
  "integration_manifest": {
    "after_dependencies": [
      "integration",
      "utility_meter"
    ],
    "codeowners": [
      "@bramstroker"
    ],
    "config_flow": true,
    "dependencies": [
      "light",
      "group",
      "template",
      "select",
      "utility_meter"
    ],
    "documentation": "https://github.com/bramstroker/homeassistant-powercalc",
    "domain": "powercalc",
    "iot_class": "local_polling",
    "issue_tracker": "https://github.com/bramstroker/homeassistant-powercalc/issues",
    "name": "Powercalc",
    "requirements": [
      "numpy>=1.21.1"
    ],
    "version": "v1.12.0",
    "is_built_in": false
  },
  "data": {
    "entry": {
      "entry_id": "ce77e5352cb98890d07e2587ec2baf0a",
      "version": 3,
      "minor_version": 1,
      "domain": "powercalc",
      "title": "Great room 1",
      "data": {
        "entity_id": "light.great_room_1",
        "manufacturer": "signify",
        "model": "LCA007",
        "unique_id": "pc_0c4e60b3-38cc-4a75-ac2d-34f9d2e49023",
        "sensor_type": "virtual_power",
        "name": "Great room 1",
        "_power_entity": "sensor.great_room_1_power",
        "_energy_entity": "sensor.great_room_1_energy",
        "create_energy_sensor": true,
        "create_utility_meters": false
      },
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "integration_discovery",
      "unique_id": "pc_0c4e60b3-38cc-4a75-ac2d-34f9d2e49023",
      "disabled_by": null
    }
  }
}
bramstroker commented 6 months ago

Thanks for reporting. I'll have a look.

bramstroker commented 6 months ago

I see, it's an oversight I made with the new download functionality. It's not a very easy fix. Will take a few hours to make the fix. Will probably do tomorrow.

For a quick fix you could manually download LCA006 directory and copy to config/.storage/powercalc_profiles/signify directory. Restart after that. This should fix your problem.

ejpenney commented 6 months ago

Hmm, that didn't fix it. Had to remove the linked_lut line from the LCA007 json and copy the files directly into the LCA007 directory.

bramstroker commented 6 months ago

Just made a fix with #2231 Release in v1.12.1 which should resolve the issue with linked profiles not working correctly anymore.

ejpenney commented 6 months ago

Thanks, I deleted my modifications and reloaded the entry, it downloaded and I'm getting metrics. Looks like this is resolved!