sleevezipper / hass-workstation-service

Provide useful sensors and services from your workstation to Home Assistant.
Apache License 2.0
613 stars 54 forks source link

High Memory usage from "Unknown Sensor" spam #155

Open MoMolap opened 2 years ago

MoMolap commented 2 years ago

Hi

After some days of usage, Hass Workstation Service is using lot of RAM. (It goes up to 1GB). RAM usage is reset after a reboot of the service.

After inspecting the log, it seems that an unknown sensor is spaming the service.

{"@t":"2022-01-07T02:26:16.8829444Z","@m":"Unknown sensor","@i":"ab184f9e","@l":"Error","threadId":35}
{"@t":"2022-01-07T02:26:17.8878644Z","@m":"Unknown sensor","@i":"ab184f9e","@l":"Error","threadId":35}
{"@t":"2022-01-07T02:26:18.8878253Z","@m":"Unknown sensor","@i":"ab184f9e","@l":"Error","threadId":18}
{"@t":"2022-01-07T02:26:19.9047531Z","@m":"Unknown sensor","@i":"ab184f9e","@l":"Error","threadId":4}
{"@t":"2022-01-07T02:26:20.9214253Z","@m":"Unknown sensor","@i":"ab184f9e","@l":"Error","threadId":63}
{"@t":"2022-01-07T02:26:21.9360861Z","@m":"Unknown sensor","@i":"ab184f9e","@l":"Error","threadId":63}
{"@t":"2022-01-07T02:26:22.9497412Z","@m":"Unknown sensor","@i":"ab184f9e","@l":"Error","threadId":18}
{"@t":"2022-01-07T02:26:23.9635656Z","@m":"Unknown sensor","@i":"ab184f9e","@l":"Error","threadId":35}
{"@t":"2022-01-07T02:26:24.9812101Z","@m":"Unknown sensor","@i":"ab184f9e","@l":"Error","threadId":9}
{"@t":"2022-01-07T02:26:25.9952912Z","@m":"Unknown sensor","@i":"ab184f9e","@l":"Error","threadId":63}
{"@t":"2022-01-07T02:26:26.9956998Z","@m":"Unknown sensor","@i":"ab184f9e","@l":"Error","threadId":9}
{"@t":"2022-01-07T02:26:28.0104629Z","@m":"Unknown sensor","@i":"ab184f9e","@l":"Error","threadId":18}

HAssWorkStation

sleevezipper commented 2 years ago

Hi! Thanks for creating an issue. Could you post the contents of your configured-sensors.json? You can find it by using the "Config files" button in the UI. Sounds like something strange is in there.

MoMolap commented 2 years ago

see below

[{"Type":"ActiveWindowSensor","Id":"f3325dd5-5299-4bcd-a4f4-5a99f0290057","Name":"ActiveWindow","Query":null,"UpdateInterval":5,"WindowName":null},{"Type":"LastActiveSensor","Id":"11b56fe6-75e1-4c64-a686-fb6beb1431b1","Name":"LastActive","Query":null,"UpdateInterval":15,"WindowName":null},{"Type":"WMIQuerySensor","Id":"c0331e55-5809-4d4d-8698-2a65d0ec055d","Name":"WMIQuerySensor","Query":"Select * from Win32_Process Where Name = \u0027nbminer.exe\u0027","UpdateInterval":10,"WindowName":null},{"Type":"GpuTemperatureSensor","Id":"8d3323f5-9e6e-4bff-ab79-73f36fab87c1","Name":"GPUTemperature","Query":null,"UpdateInterval":10,"WindowName":null},{"Type":"WMIQuerySensor","Id":"db7e1d47-3d11-4d7e-979a-4509ce494e03","Name":"controllersensor","Query":"SELECT Present FROM Win32_PnPEntity WHERE Name=\u0027HID-compliant game controller\u0027","UpdateInterval":15,"WindowName":null}]

sagaland93 commented 2 years ago

I'm also getting this. And it seems like one or more of the sensors stops updating in HA at the same time.

filikun commented 2 years ago

Having the same issue, here is my log configured-sensors.json


[{"Type":"SessionStateSensor","Id":"8cfa6db9-428d-4444-9133-1c9f138d3a60","Name":"Session state","Query":null,"Scope":null,"UpdateInterval":5,"WindowName":null},{"Type":"CPULoadSensor","Id":"c1f4b72c-08d7-4a47-a5bd-6484c4bf7e92","Name":"CPU load","Query":"SELECT PercentProcessorTime FROM Win32_PerfFormattedData_PerfOS_Processor","Scope":"","UpdateInterval":5,"WindowName":null},{"Type":"GpuLoadSensor","Id":"1129031d-7eab-4b63-8643-b0567b1d0f99","Name":"GPU load","Query":null,"Scope":null,"UpdateInterval":5,"WindowName":null},{"Type":"GpuTemperatureSensor","Id":"7b905028-891b-451f-a48f-dc55291a1dd7","Name":"GPU temperature","Query":null,"Scope":null,"UpdateInterval":5,"WindowName":null},{"Type":"MemoryUsageSensor","Id":"d9907ffc-3e77-4234-b0c8-fcbd38e3f6fd","Name":"RAM usage","Query":"SELECT FreePhysicalMemory,TotalVisibleMemorySize FROM Win32_OperatingSystem","Scope":"","UpdateInterval":10,"WindowName":null},{"Type":"NamedWindowSensor","Id":"71ff6bc3-a706-4db6-8ead-d79b3135a64a","Name":"Forza","Query":null,"Scope":null,"UpdateInterval":5,"WindowName":"forza"}]