When I set up a wmi query with Scope: .\ROOT\OpenHardwareMonitor and Query: SELECT value FROM Sensor WHERE Name LIKE “%CPU Core%” AND SensorType = “Temperature” I get an error when activating it:
2022-04-07 15:09:42.415 +02:00 [FTL] [SENSORSMANAGER] Error while storing: Der Parameter ist ungültig.
System.Management.ManagementException: Der Parameter ist ungültig.
at System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus errorCode)
at System.Management.ManagementPath.CreateWbemPath(String path)
at System.Management.ManagementPath..ctor(String path)
at System.Management.ManagementScope..ctor(String path)
at HASSAgent.Shared.Models.HomeAssistant.Sensors.WmiQuerySensor..ctor(String query, String scope, Nullable`1 updateInterval, String name, String id)
at HASSAgent.Settings.StoredSensors.ConvertConfiguredToAbstractSingleValue(ConfiguredSensor sensor)
at HASSAgent.Sensors.SensorsManager.StoreAsync(List`1 sensors, List`1 toBeDeletedSensors)
Sidenote, if I were you I would replace “%CPU Core%” with “%CPU Package%” as based on your screenshot from Open Hardware Monitor, CPU Package is showing the highest temperature accross all cores, so it should give you a more accurate temperature.
Nice one! I’ve been asking the devs for a central place to collect all clients, so users can pick the one they like for their OS of choice, but they don’t want it unfortunately.
Odd. It is very hard to find this! As you saw I ended up making a python script first but I’m gonna try your agent soon since my python script needs a bunch of work to make it solid.
Have you got steps to build your agent from source in tinfoilhat mode?
What you’re describing is part of the reason I built this; all other options were either bugged (and not getting fixes/updates) or missing features.
HASS.Agent will have bugs (I develop this in my spare time, and every complex application has them) but I always do my best to fix them soon after getting reported, depending on severity. Its development has been going steady for the past year or so, with a public release 6 months ago and updates every few weeks after.
If you have any questions or encounter problems, you can join us on Discord, open a GitHub ticket or just post them here. There’s also a wiki with a lot of troubleshooting/examples.
I just discovered your plugin and I just have to write here and say this is an awesome job you have done! This application is already so good and has a lot of potential. Super easy to setup as well.
Great work man,
I was just looking the best option for a windows integration and this has come for the win!
I have one question - how does the last active sensor works?
Is it the last time I moved the mouse or pressed a key in the keyboard?
It seems like it’s updating to the current time even if don’t do any of those 2 actions
Thanks, glad you like it! The ‘last active’ sensor works by using the same Windows-provided metric that for instance screensavers use. It’s basically what you mention; keyboard and mouse input.
Are you perhaps using a mouse emulating tool to prevent your machine from going to sleep or something like that?
No nothing special regarding mouse or keyboard is being used.
do you mind pointing me to the specific .Net API being used with this sensor?
I will try to debug it