planbnet/livisi_unofficial

Add RAM Usage of the SHC

Closed this issue · 5 comments

Checklist

  • I have filled out the template to the best of my ability.
  • This only contains 1 feature request (if you have multiple feature requests, open one feature request for each feature request).
  • This issue is not a duplicate feature request of previous feature requests.

Is your feature request related to a problem? Please describe.

It seems like the SHC (SHC1) has a software bug that causes it to use up all RAM over time, leading to a freeze of the software if not restarted before

Describe the solution you'd like

For the SHC Entity in HASS there should be an entity for the RAM usage (maybe also other entities for CPU?)

Describe alternatives you've considered

none

Additional context

Additionally, I also want to add a restart action to the SHC Device, but that is another Feature request (also this will only be available with the next update (https://community.livisi.de/forum/thread/5326-woran-arbeiten-wir-gerade/?postID=44357&highlight=neustart#post44357)

I hope you don't mind creating an issue for visibility here. I will add a PR later!
Is it the same ID and endpoint for the SHC2?

// https://ip/device/states
{
        "id": "a42d421e1ad9460da6b690ce09e780c9",
        "state": {
            "updateAvailable": {
                "value": "",
                "lastChanged": "2023-11-17T23:02:18Z"
            },
            "lastReboot": {
                "value": "2023-11-17T23:01:03Z",
                "lastChanged": "2023-11-17T23:02:18Z"
            },
            "OSState": {
                "value": "Normal",
                "lastChanged": "2023-11-18T00:02:18Z"
            },
            "memoryLoad": {
                "value": 96,
                "lastChanged": "2024-01-12T22:59:54Z"
            },
            "CPULoad": {
                "value": 99,
                "lastChanged": "2024-01-12T22:59:54Z"
            },
            "diskUsage": {
                "value": 20,
                "lastChanged": "2023-11-17T23:02:18Z"
            },
            // ...
        }
    }

Great idea. If you create a PR I will check if it works with my SHC v2

device/00000000000000000000000000000000/state returns the following data on my SHCv2:

{
  "configVersion": {
    "value": 707,
    "lastChanged": "2024-02-13T11:21:45.171684Z"
  },
  "cpuUsage": {
    "value": 3,
    "lastChanged": "2024-02-15T08:02:35.827063Z"
  },
  "currentUtcOffset": {
    "value": 60,
    "lastChanged": "1970-01-01T00:00:00Z"
  },
  "deviceConfigurationState": {
    "value": "Complete",
    "lastChanged": "1970-01-01T00:00:00Z"
  },
  "deviceInclusionState": {
    "value": "Included",
    "lastChanged": "2023-03-04T20:14:38.123688Z"
  },
  "discoveryActive": {
    "value": false,
    "lastChanged": "1970-01-01T00:00:00Z"
  },
  "diskUsage": {
    "value": 65,
    "lastChanged": "2024-02-15T07:57:35.829675Z"
  },
  "ethIpAddress": {
    "value": "REDACTED",
    "lastChanged": "1970-01-01T00:00:00Z"
  },
  "ethMacAddress": {
    "value": "REDACTED",
    "lastChanged": "1970-01-01T00:00:00Z"
  },
  "firmwareVersion": {
    "value": null,
    "lastChanged": "1970-01-01T00:00:00Z"
  },
  "inUseAdapter": {
    "value": "eth",
    "lastChanged": "1970-01-01T00:00:00Z"
  },
  "innogyLayerAttached": {
    "value": true,
    "lastChanged": "1970-01-01T00:00:00Z"
  },
  "isReachable": {
    "value": null,
    "lastChanged": "1970-01-01T00:00:00Z"
  },
  "lastReboot": {
    "value": "2024-02-15T07:52:35+00:00",
    "lastChanged": "2024-02-15T07:52:35.439616Z"
  },
  "lbDongleAttached": {
    "value": false,
    "lastChanged": "1970-01-01T00:00:00Z"
  },
  "memoryUsage": {
    "value": 27,
    "lastChanged": "2024-02-15T07:57:35.829820Z"
  },
  "operationStatus": {
    "value": "active",
    "lastChanged": "2024-02-15T07:53:32.753651Z"
  },
  "updateAvailable": {
    "value": "",
    "lastChanged": "2024-01-16T00:02:52.673931Z"
  },
  "updateState": {
    "value": "UpToDate",
    "lastChanged": "1970-01-01T00:00:00Z"
  },
  "wMBusDongleAttached": {
    "value": false,
    "lastChanged": "1970-01-01T00:00:00Z"
  },
  "wifiIpAddress": {
    "value": "",
    "lastChanged": "1970-01-01T00:00:00Z"
  },
  "wifiMacAddress": {
    "value": "REDACTED",
    "lastChanged": "1970-01-01T00:00:00Z"
  },
  "wifiSignalStrength": {
    "value": 0,
    "lastChanged": "1970-01-01T00:00:00Z"
  }
}

My controller crashed (went unresponsive until a forced power cycle) this morning... Now I need this feature, too...

@DanielHabenicht Can you check if this also works for v1? Looks like the status map is has different keys (CPULoad vs cpuUsage, memoryLoad vs memoryUsage) there...

Do you get the device state of the Controller when querying the endpoint at https://ip/device/states?