richibrics / IoTuring

Your Windows, Linux, macOS computer as MQTT and HomeAssistant integration
https://pypi.org/project/IoTuring/
GNU General Public License v3.0
82 stars 6 forks source link

DiskIO values as extra attributes in Disk Entity #87

Open lockenkop opened 11 months ago

lockenkop commented 11 months ago

psutil.disk_io_counters() in Disk Entity

Acording to psutil docs (https://psutil.readthedocs.io/en/latest/index.html#psutil.disk_io_counters) most relevant values are supported on all except BSD. Namely:

Other platform specific fields will only get accessed if on linux.

Windows may need an extra flag:

On Windows it may be necessary to issue diskperf -y command from cmd.exe first in order to enable IO counters.

Currently tested only on Linux with Console Warehouse. I'll check windows and display in HomeAssistant further this week.

richibrics commented 11 months ago

diskperf -y is needed only the first time, and a reboot is required before accessing those informations (diskperf) so I'd suggest the user to manually use that command in the cmd or ask the user if he wants to enable that characteristic and do it from IoTuring. Although, that would need the configurations to know which is the host OS.

lockenkop commented 11 months ago

so I'd suggest the user to manually use that command in the cmd or ask the user if he wants to enable that characteristic and do it from IoTuring. Although, that would need the configurations to know which is the host OS.

Doing this with self.RunCommand() at configuration and asking the user to reboot seems okay to me. I'll test if its possible to check for the availability during configuration and show this step if it needs the change and reboot. Playing around with the windows side of things this week.

infeeeee commented 11 months ago

I don't know if the command has to be run as admin, or it can be run as a regular user. If the former, we shouldn't call it here.

Ekkor: 2023. december 11. 18:04:51 CET, lockenkop @.***> írta:

so I'd suggest the user to manually use that command in the cmd or ask the user if he wants to enable that characteristic and do it from IoTuring. Although, that would need the configurations to know which is the host OS.

Doing this with self.RunCommand() at configuration and asking the user to reboot seems okay to me. I'll test if its possible to check for the availability during configuration and show this step if it needs the change and reboot. Playing around with the windows side of things this week.

-- Reply to this email directly or view it on GitHub: https://github.com/richibrics/IoTuring/pull/87#issuecomment-1850495406 You are receiving this because you commented.

Message ID: @.***>

richibrics commented 9 months ago

Hi @lockenkop, which is the current state of this entity enhancement ?

lockenkop commented 9 months ago

Hi, o had some personal stuff going on and I am abroad until April. I was about to get some coding done starting this week. Sadly my surface's battery decided to become balloon. This PR should be nearly done. I'll see if I can do some finishing on my phone.

richibrics commented 9 months ago

No problem, work on it when you'll have free time or write what's missing so someone else will do it 💪 Thanks for your work !

lockenkop commented 4 months ago

latest I'll have to do some testing if the read and writerates are even remotely accurate. At least they spike when i read or write a file, so it must be somewhat plausible.