CPU Speed Integration

Hi,
I added the new CPU Speed Integration, but I don’t see icons, entities or anything else
https://www.home-assistant.io/integrations/cpuspeed/

image

any ideas?

diagnostics info


{
  "home_assistant": {
    "installation_type": "Home Assistant OS",
    "version": "2022.2.0",
    "dev": false,
    "hassio": true,
    "virtualenv": false,
    "python_version": "3.9.7",
    "docker": true,
    "arch": "aarch64",
    "timezone": "Europe/Rome",
    "os_name": "Linux",
    "os_version": "5.10.63-v8",
    "supervisor": "2022.01.1",
    "host_os": "Home Assistant OS 7.2",
    "docker_version": "20.10.9",
    "chassis": "embedded",
    "run_as_root": true
  },
  "custom_components": {},
  "integration_manifest": {
    "domain": "cpuspeed",
    "name": "CPU Speed",
    "documentation": "https://www.home-assistant.io/integrations/cpuspeed",
    "requirements": [
      "py-cpuinfo==8.0.0"
    ],
    "config_flow": true,
    "codeowners": [
      "@fabaff",
      "@frenck"
    ],
    "iot_class": "local_push",
    "is_built_in": true
  },
  "data": {
    "python_version": "3.9.7.final.0 (64 bit)",
    "cpuinfo_version": [
      8,
      0,
      0
    ],
    "cpuinfo_version_string": "8.0.0",
    "arch": "ARM_8",
    "bits": 64,
    "count": 4,
    "arch_string_raw": "aarch64",
    "hardware_raw": "BCM2835",
    "flags": [
      "asimd",
      "cpuid",
      "crc32",
      "evtstrm",
      "fp"
    ]
  }
}

The integration has no icon, but you should see an entity. Check the logs.

grafik

I see this


Logger: homeassistant.components.sensor
Source: components/cpuspeed/sensor.py:85
Integration: Sensor ([documentation](https://www.home-assistant.io/integrations/sensor), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+sensor%22))
First occurred: 8:27:12 AM (4 occurrences)
Last logged: 4:46:03 PM

cpuspeed: Error on device update!

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 431, in _async_add_entity await entity.async_device_update(warning=False) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 709, in async_device_update await task File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/usr/src/homeassistant/homeassistant/components/cpuspeed/sensor.py", line 85, in update ATTR_BRAND: info["brand_raw"], KeyError: 'brand_raw'

You should file an issue at github, as the integration is obviously incapable of reading or interpreting the CPU model. The missing key “brand_raw” is present at my site, so no issue over here:

    "cpuinfo_version_string": "8.0.0",
    "arch": "X86_64",
    "bits": 64,
    "count": 4,
    "arch_string_raw": "x86_64",
    "vendor_id_raw": "AuthenticAMD",
    "brand_raw": "AMD Athlon 200GE with Radeon Vega Graphics",
    "hz_advertised_friendly": "2.0091 GHz",
    "hz_actual_friendly": "2.0091 GHz",

I just wanted to test it on Rpi4 and I have the same problem. I don’t need it so I removed the integration

Hi,

after the latest update, the entity is there, but there is still some issues with the data

image

I just tried this. Got ‘unknown’ as well. I think it may be due to HA living in a docker container, which is clearly stated here: CPU Speed - Home Assistant
So, this works nicely (add to your configuration.yaml). Then you can chart it with apexcharts etc:

sensor:
  - platform: command_line
    name: HA_PROC_Speed
    command: "cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq"
    # If errors occur, make sure configuration file is encoded as UTF-8
    unit_of_measurement: "MHz"
    value_template: "{{ value | multiply(0.001) | round(0) }}"
    scan_interval: 60
2 Likes