Use system sensors (temp/IO/network/CPUload/g…) as triggers

Posted on
Mon Jun 11, 2018 4:09 am
vitaprimo offline
User avatar
Posts: 11
Joined: Jul 12, 2016
Location: La Paz, Baja California Sur. MX.

Use system sensors (temp/IO/network/CPUload/g…) as triggers

Didn't need more than a 1-liner to explain that--cool! Anyway, possible? Plugin needed?

Thanks!

I'll bet you think this post is about you. Don't you. ♪

Posted on
Mon Jun 11, 2018 8:50 pm
howartp offline
Posts: 3667
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Use system sensors (temp/IO/network/CPUload/g…) as trigg

Assuming Apple expose that data, it’s certainly plausible.

A plugin would be the logical approach.


Sent from my iPhone using Tapatalk Pro

Posted on
Wed Jun 13, 2018 11:50 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Use system sensors (temp/IO/network/CPUload/g…) as trigg

I actually wrote a plugin to do all of that but it's one of my "just for me" plugins that I haven't made generic for public consumption but a lot of this can be done with some Py scripting. For example, if you wanted the CPU:

Code: Select all
CPU_Pct=str(round(float(os.popen('''grep 'cpu ' /proc/stat | awk '{usage=($2+$4)*100/($2+$4+$5)} END {print usage }' ''').readline()),2))
indigo.server.log("CPU Usage = " + CPU_Pct)


This is untested code, just an idea of what could be done.

That could be populated into a variable easily enough. It's on my todo list to publish my Plugin for this but it's a bit low on the list right now with other things I'm working on.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 2 guests