homeassistant-powercalc: Sonos Beams go unavailable frequently

System Health details

System Information

version core-2025.2.4
installation_type Home Assistant Container
dev false
hassio false
docker true
user root
virtualenv false
python_version 3.13.1
os_name Linux
os_version 3.10.108
arch x86_64
timezone America/Chicago
config_dir /config
Home Assistant Community Store
GitHub API ok
GitHub Content ok
GitHub Web ok
HACS Data ok
GitHub API Calls Remaining 4988
Installed Version 2.0.5
Stage running
Available Repositories 1550
Downloaded Repositories 54
Dashboards
dashboards 7
resources 34
views 31
mode storage
Network Configuration
adapters lo (disabled), bond0 (enabled, default, auto), docker0 (disabled), dockerc575423 (disabled), dockeracfb520 (disabled), docker3e18fba (disabled), docker520ec39 (disabled), dockerf78b82b (disabled), dockerb240c9b (disabled), dockere25c2f4 (disabled), docker75fd391 (disabled), dockerb1bb362 (disabled)
ipv4_addresses lo (127.0.0.1/8), bond0 (192.168.1.95/24), docker0 (172.17.0.1/16), dockerc575423 (), dockeracfb520 (), docker3e18fba (), docker520ec39 (), dockerf78b82b (), dockerb240c9b (), dockere25c2f4 (), docker75fd391 (), dockerb1bb362 ()
ipv6_addresses lo (::1/128), bond0 (), docker0 (fe80::42:6ff:fe02:5dec/64), dockerc575423 (fe80::9888:56ff:fe94:d285/64), dockeracfb520 (fe80::881f:e0ff:fec0:b532/64), docker3e18fba (fe80::d0:eaff:fe66:9b98/64), docker520ec39 (fe80::f002:dcff:fed9:98a9/64), dockerf78b82b (fe80::c7e:e5ff:fe78:4274/64), dockerb240c9b (fe80::a8d5:9bff:fe3c:2872/64), dockere25c2f4 (fe80::f84e:aff:fe3c:fb91/64), docker75fd391 (fe80::32:26ff:fefc:deb8/64), dockerb1bb362 (fe80::4468:6dff:fe91:ef52/64)
announce_addresses 192.168.1.95
Recorder
oldest_recorder_run November 21, 2024 at 6:34 PM
current_recorder_run February 21, 2025 at 12:06 PM
estimated_db_size 10609.44 MiB
database_engine mysql
database_version 10.11.9

Checklist

  • I have read the FAQ to see if there is a known solution to my problem.
  • I have enabled debug logging for my installation.
  • I have filled out the issue template to the best of my ability.
  • This issue only contains 1 issue (if you have multiple issues, open one issue for each issue).
  • This issue is not a duplicate issue of currently previous issues…

Describe the issue

Every morning and sometimes a few times during the day, my Sonos devices will go unavailable. I see it mostly with my two Beams, but I have also seen it happen with my One SLs and Amps. The media player entity is available but the power calc entity is unavailable. Additionally, when these entities are available, they don’t change power usage when in use. Reloading the entity does not change or fix anything.

Reproduction steps

  1. Auto add device of type Sonos Beam
  2. play something on a media player of the same type
  3. observe power and energy sensor of other media player with same type go unavailable …

Debug logs

I don’t have these just yet… debug logging is enabled but only after the issue had started.

Diagnostics dump or YAML config

{
  "home_assistant": {
    "installation_type": "Home Assistant Container",
    "version": "2025.2.4",
    "dev": false,
    "hassio": false,
    "virtualenv": false,
    "python_version": "3.13.1",
    "docker": true,
    "arch": "x86_64",
    "timezone": "America/Chicago",
    "os_name": "Linux",
    "os_version": "3.10.108",
    "run_as_root": true
  },
  "custom_components": {
    "variable": {
      "documentation": "https://github.com/enkama/hass-variables",
      "version": "3.4.9",
      "requirements": [
        "iso4217>=1.11.20220401"
      ]
    },
    "smartthinq_sensors": {
      "documentation": "https://github.com/ollo69/ha-smartthinq-sensors",
      "version": "0.41.1",
      "requirements": [
        "pycountry>=23.12.11",
        "xmltodict>=0.13.0",
        "charset_normalizer>=3.2.0"
      ]
    },
    "epson_projector_link": {
      "documentation": "https://github.com/amosyuen/ha-epson-projector-link",
      "version": "1.1.1",
      "requirements": [
        "pyserial_asyncio>=0.4",
        "async_timeout>=3.0.0"
      ]
    },
    "hacs": {
      "documentation": "https://hacs.xyz/docs/use/",
      "version": "2.0.5",
      "requirements": [
        "aiogithubapi>=22.10.1"
      ]
    },
    "frigate": {
      "documentation": "https://github.com/blakeblackshear/frigate",
      "version": "5.8.0",
      "requirements": [
        "hass-web-proxy-lib==0.0.7"
      ]
    },
    "schluter": {
      "documentation": "https://github.com/Ingos11/ha-schluter",
      "version": "v0.2.2",
      "requirements": [
        "aioschluter==0.1.9"
      ]
    },
    "nws_alerts": {
      "documentation": "https://github.com/finity69x2/nws_alerts/",
      "version": "6.1",
      "requirements": []
    },
    "nhl_api": {
      "documentation": "https://github.com/JayBlackedOut/hass-nhlapi",
      "version": "0.11.8",
      "requirements": [
        "pynhl==0.4.8"
      ]
    },
    "weatherdotcom": {
      "documentation": "https://github.com/jaydeethree/Home-Assistant-weatherdotcom",
      "version": "1.2.0",
      "requirements": []
    },
    "fordpass": {
      "documentation": "https://github.com/itchannel/fordpass-ha",
      "version": "0.1.68",
      "requirements": []
    },
    "dahua": {
      "documentation": "https://github.com/rroller/dahua",
      "version": "0.9.71",
      "requirements": []
    },
    "grocy": {
      "documentation": "https://github.com/custom-components/grocy",
      "version": "2025.2.2",
      "requirements": [
        "pygrocy2==2.4.0"
      ]
    },
    "spook": {
      "documentation": "https://spook.boo",
      "version": "3.1.0",
      "requirements": []
    },
    "powercalc": {
      "documentation": "https://docs.powercalc.nl",
      "version": "v1.17.7",
      "requirements": [
        "numpy>=1.21.1"
      ]
    },
    "ge_home": {
      "documentation": "https://github.com/simbaja/ha_gehome",
      "version": "2025.2.1",
      "requirements": [
        "gehomesdk==2025.2.2",
        "magicattr==0.1.6",
        "slixmpp==1.8.3"
      ]
    },
    "blitzortung": {
      "documentation": "https://github.com/mrk-its/homeassistant-blitzortung",
      "version": "1.3.9",
      "requirements": [
        "paho-mqtt>=1.5.0"
      ]
    },
    "monitor_docker": {
      "documentation": "https://github.com/ualex73/monitor_docker",
      "version": "1.18",
      "requirements": [
        "aiodocker==0.22.0",
        "python-dateutil==2.9.0"
      ]
    },
    "alarmo": {
      "documentation": "https://github.com/nielsfaber/alarmo",
      "version": "v1.10.7",
      "requirements": []
    },
    "kidschores": {
      "documentation": "https://github.com/ad-ha/kidschores-ha",
      "version": "0.2.1",
      "requirements": []
    },
    "adaptive_cover": {
      "documentation": "https://github.com/basbruss/adaptive-cover",
      "version": "1.4.5",
      "requirements": [
        "astral",
        "pandas"
      ]
    },
    "teamtracker": {
      "documentation": "https://github.com/vasqued2/ha-teamtracker",
      "version": "0.1",
      "requirements": [
        "arrow",
        "aiofiles"
      ]
    }
  },
  "integration_manifest": {
    "after_dependencies": [
      "integration",
      "utility_meter"
    ],
    "codeowners": [
      "bramstroker"
    ],
    "config_flow": true,
    "dependencies": [
      "light",
      "group",
      "template",
      "select",
      "utility_meter"
    ],
    "documentation": "https://docs.powercalc.nl",
    "domain": "powercalc",
    "iot_class": "calculated",
    "issue_tracker": "https://github.com/bramstroker/homeassistant-powercalc/issues",
    "name": "Powercalc",
    "requirements": [
      "numpy>=1.21.1"
    ],
    "version": "v1.17.7",
    "is_built_in": false,
    "overwrites_built_in": false
  },
  "setup_times": {
    "null": {
      "setup": 4.315880098380148
    },
    "e6c51018b297490bfb2b91b853b8a412": {
      "wait_import_platforms": -9.125936776399612e-05,
      "config_entry_setup": 0.005199304781854153
    },
    "b2fa164cdce41783ebf1235d3f5beb11": {
      "config_entry_setup": 0.0133010009303689
    },
    "da65761bde4566dd8371a59253406a48": {
      "config_entry_setup": 0.00410440843552351
    },
    "7eab436073e23d6b55f1524e3355cfb4": {
      "config_entry_setup": 0.07057763263583183
    },
    "7b36cc6dc198ab4740b19c1e0f044f4f": {
      "config_entry_setup": 0.008225594647228718
    },
    "bb00b5e9b395bfd22031c9bed3ccee8e": {
      "config_entry_setup": 0.004746540449559689
    },
    "e8ffaca94c5ed24126238be9c68e8894": {
      "config_entry_setup": 0.004731239750981331
    },
    "b87d62bc7b77b9d1e775b0f71a1a23b0": {
      "config_entry_setup": 0.00686845276504755
    },
    "de4c467b38f786933aa94344e6d856a7": {
      "config_entry_setup": 0.006780033931136131
    },
    "a1b7645e2d3ba0484985e865c2cc3a60": {
      "config_entry_setup": 0.0064977072179317474
    },
    "fe6ac4a5935b33c6bcd97ad199d1e20c": {
      "config_entry_setup": 0.004338394850492477
    },
    "01J5P4TCG49V57Y3C0Q7X5BYP0": {
      "config_entry_setup": 0.01552407257258892
    },
    "01J5P571BW07P7VPSETVBMYZV4": {
      "config_entry_setup": 0.014221468940377235
    },
    "01JH9T66YQC202TSS4Y5NS4BFN": {
      "config_entry_setup": 0.011197768151760101
    }
  },
  "data": {
    "entry": {
      "created_at": "1970-01-01T00:00:00+00:00",
      "data": {
        "_energy_entity": "sensor.front_room_energy",
        "_power_entity": "sensor.front_room_power",
        "create_energy_sensor": true,
        "create_utility_meters": false,
        "energy_integration_method": "left",
        "entity_id": "media_player.front_room",
        "ignore_unavailable_state": true,
        "manufacturer": "sonos",
        "model": "playbar",
        "name": "Front Room",
        "sensor_type": "virtual_power",
        "unavailable_power": 0.0,
        "unique_id": "Front Room"
      },
      "discovery_keys": {},
      "disabled_by": null,
      "domain": "powercalc",
      "entry_id": "a1b7645e2d3ba0484985e865c2cc3a60",
      "minor_version": 1,
      "modified_at": "2024-10-11T01:35:59.019556+00:00",
      "options": {},
      "pref_disable_new_entities": false,
      "pref_disable_polling": false,
      "source": "user",
      "title": "Front Room",
      "unique_id": "Front Room",
      "version": 4
    }
  }
}

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 22 (11 by maintainers)

Most upvoted comments

@squirtbrnr can we close this issue?

It does appear like the entities and devices don’t go unavailable anymore. However I haven’t been able to completely test it. Just initial observations.

Good news! I was finally able to reproduce, even with a unit test. Issue was caused by some internal caching to optimize performance. Is fixed with #3171 and will release that today.

@nexuszsolt Removing your comments from this issue, as your issue and reproduction steps are reported by multiple other users now in #3131. Should be resolved now in upcoming version. It’s definitely unrelated to the Sonos issue which is reported here.