Can't get CPU temp from serverinfo

  • Nextcloud Server version: 31.0.4.1
  • Operating system and version: DietPi 9.12.1 (Linux 6.6.44-current-sunxi64 aarch64) running on Pine A64+ SBC
  • Web server and version: Apache
    Server version: Apache/2.4.62 (Debian)
    Server built: 2024-10-04T15:21:08
  • Reverse proxy and version: none
  • PHP version: 8.2.28
  • Is this the first time you’ve seen this error? Yes, but it’s not really an error
  • When did this problem seem to first start? Yesterday
  • Installation method: DietPi’s software manager
  • Are you using CloudfIare, mod_security, or similar? No, this is a private installation with no outside access whatsoever

Summary of the issue you are facing:

I’m trying to get Home Assistant to monitor the CPU temp of the SBC running Nextcloud. I’ve read that you can configure Home Assistant to monitor

http:///nextcloud/ocs/v2.php/apps/serverinfo/api/v1/info?format=json&skipApps=false&skipUpdate=false

And it will get the CPU temp. So I configured it, and the JSON that is returned doesn’t include the CPU temp. It includes the number of CPUs and the CPU load, but not the temp.

Steps to replicate it (hint: details matter!):

  1. In a browser navigate to http:///nextcloud/ocs/v2.php/apps/serverinfo/api/v1/info?format=json&skipApps=false&skipUpdate=false
  2. Note that there is no info on CPU temp in the returned JSON

Log entries

No log entries generated

Nextcloud

No log entries generated

Web Browser

Unrelated to web interface

Web server / Reverse Proxy

The output of your Apache/nginx/system log in /var/log/____:

No log entries in /var/log/apache2/errors.log, /var/log/apache2/access.log or/var/log/apache2/other_vhosts_access.log

Configuration

Nextcloud

The output of occ config:list system :

{
    "system": {
        "passwordsalt": "***REMOVED SENSITIVE VALUE***",
        "secret": "***REMOVED SENSITIVE VALUE***",
        "trusted_domains": [
            "localhost",
            "*"
        ],
        "datadirectory": "***REMOVED SENSITIVE VALUE***",
        "dbtype": "mysql",
        "version": "31.0.4.1",
        "hashingThreads": 4,
        "memcache.local": "\\OC\\Memcache\\APCu",
        "filelocking.enabled": true,
        "memcache.locking": "\\OC\\Memcache\\Redis",
        "redis": {
            "host": "***REMOVED SENSITIVE VALUE***",
            "port": 0
        },
        "overwrite.cli.url": "http:\/\/localhost\/nextcloud",
        "htaccess.RewriteBase": "\/nextcloud",
        "dbname": "***REMOVED SENSITIVE VALUE***",
        "dbhost": "***REMOVED SENSITIVE VALUE***",
        "dbport": "",
        "dbtableprefix": "oc_",
        "mysql.utf8mb4": true,
        "dbuser": "***REMOVED SENSITIVE VALUE***",
        "dbpassword": "***REMOVED SENSITIVE VALUE***",
        "installed": true,
        "instanceid": "***REMOVED SENSITIVE VALUE***",
        "defaultapp": "files",
        "app_install_overwrite": [
            "circlesdb"
        ]
    }
}

#### Apps

**The output of `occ app:list`:**
Enabled:
  - activity: 4.0.0
  - app_api: 5.0.2
  - bruteforcesettings: 4.0.0
  - circles: 31.0.0
  - circlesdb: 1.8.2
  - cloud_federation_api: 1.14.0
  - comments: 1.21.0
  - contactsinteraction: 1.12.0
  - dashboard: 7.11.0
  - dav: 1.33.0
  - federatedfilesharing: 1.21.0
  - federation: 1.21.0
  - files: 2.3.1
  - files_downloadlimit: 4.0.0
  - files_pdfviewer: 4.0.0
  - files_reminders: 1.4.0
  - files_sharing: 1.23.1
  - files_trashbin: 1.21.0
  - files_versions: 1.24.0
  - firstrunwizard: 4.0.0
  - logreader: 4.0.0
  - lookup_server_connector: 1.19.0
  - nextcloud_announcements: 3.0.0
  - notifications: 4.0.0
  - oauth2: 1.19.1
  - password_policy: 3.0.0
  - photos: 4.0.0-dev.1
  - privacy: 3.0.0
  - profile: 1.0.0
  - provisioning_api: 1.21.0
  - recommendations: 4.0.0
  - related_resources: 2.0.0
  - serverinfo: 3.0.0
  - settings: 1.14.0
  - sharebymail: 1.21.0
  - support: 3.0.0
  - survey_client: 3.0.0
  - systemtags: 1.21.1
  - text: 5.0.0
  - theming: 2.6.1
  - twofactor_backupcodes: 1.20.0
  - updatenotification: 1.21.0
  - user_status: 1.11.0
  - viewer: 4.0.0
  - weather_status: 1.11.0
  - webhook_listeners: 1.2.0
  - workflowengine: 2.13.0
Disabled:
  - admin_audit: 1.21.0
  - encryption: 2.19.0
  - files_external: 1.23.0
  - suspicious_login: 9.0.1
  - twofactor_nextcloud_notification: 5.0.0
  - twofactor_totp: 13.0.0-dev.0
  - user_ldap: 1.22.0

Hi,

The temperature is not exposed via api.

System monitor - Home Assistant does not work for you?

It’s unfortunate that it’s not exposed via the API. I read in several places that it was, which is what confused me. I thought it was something about my settings.

I wasn’t aware of the system monitor integration, but looking at the link you provided, it appears that the system monitor integration monitors the system HA is running on. My HA and NC servers are on different computers, so I don’t think it will work.

I just added it to HA, and it is only for the system running HA, so that won’t work for me.

Here’s a feature request: Expose temperatures via api · Issue #793 · nextcloud/serverinfo · GitHub

Not a Home Assistant expert, but Google found this: GitHub - joshuar/go-hass-agent: A Home Assistant, native app for desktop/laptop devices.

If I understand it correctly you could install the hass-agent on your Nextcloud server or any other computer in your network, and it will then be able to report all kind of data to Home Assistant.