Sensor instance not always available throws breaking error - how to ignore?
I have just started out with HASS.Agent. My use is only for providing sensors for the Windows server it is running on.
I have it up and running with the sensors showing up fine in HA.
The problem is when I want to watch Performance Counter sensors related to processes that are not always running. If I add them when the processes are running everthing works fine, for then. If at a later time the process is not running when I save sensors configuration or when I (re)start HASS.Agent, it throws an error - e.g. on start "Error loading sensors: Instance [process name] does not exist in the specified Category". If I edit sensors configuration and try to save the edits and the process is not running, I get a similar error and the configuration edits are not saved.
I imagine this is not an unusual situation, for example wanting to track processor load of a process that is only running at certain times. So I imagined there was a solution ready to find. I have tried setting IgnoreAvailability to true but it did not help, I suspect that this is not intended to do what I want here. Googling and looking at forums have not made me wiser, so here I am asking for help or if this is unsupported (and I should rather see if there is feature request for it or make one).
Thanks for any help.
5 Replies
Help us Help Others!
To help others find answers, you can mark your question as solved via
Right click solution message -> Apps -> ✅ Mark Solution
Help us Help You!
Please don't delete messages or posts because it makes it impossible to understand what happened. If you don't want your messages to be seen then don't post here.
We will help as soon as possible.
While you're waiting you can try the following:
- Checkout the documentation. - Search here in discord for previously solved similar issues.
@DrR0x
@Amadeo, haven't seen this yet, surprised though, seems like a common issue people would have? Is there an inbuilt solution?
gradual-turquoiseOP•15h ago
A specific example is here, I am tracking the Plex Transcoder process, which only starts up when transcoding is needed:
{
"Type": "PerformanceCounterSensor",
"Id": "0a24a76c-4600-4a65-92a3-ffe450544e5e",
"Name": "Plex Transcoder Processor Time",
"UpdateInterval": 30,
"Query": "",
"Scope": null,
"WindowName": "",
"Category": "Process",
"Counter": "% Processor Time",
"Instance": "Plex Transcoder",
"EntityName": "performancecounter_ProcessorTimePlexTranscoder",
"IgnoreAvailability": true,
"ApplyRounding": false,
"Round": null,
"AdvancedSettings": "{"DeviceClass":"","UnitOfMeasurement":"%","StateClass":""}"
},
Perhaps I made some error, or should set it up another way, but it works fine as long as the process is running.
The IgnoreAvailability was set to "false", but I tried to get things running again by editing it to "true" in the config file. Did not help though.