See changelog
homebridge-macosx-info is homebridge plugin for Apple HomeKit, get and return somes systems informations from macOSX computer.
Such as :
You can see below screenshots for illustrate homebridge-macos-info plugin.
Screenshots are taken from the Elgato Eve.app
{
"updateTime":"Fri May 31 19:35:36 CEST 2019",
"temperature":31.3,
"fan":1797,
"power":1.25,
"uptime":"up 13:21",
"load":"2.52 2.17 2.07",
"freemem":639.96,
"disk":"50",
"user":2
}
/etc/sudoers
fileUsed npm tool to install homebridge-macosx-info, and execute the command line below
npm i homebridge-macosx-info
Add this lines in config.json
"accessories": [
{
"accessory": "MacOSXSysInfo",
"name": "macOSX Info",
"file": "/tmp/_homebridge-macosx-info.json",
"serial": "042-03-000",
"consumption": true,
"user": true,
"updateInterval": 60000
}
],
Parameter | Note | Optionnal | value |
---|---|---|---|
accessory |
Name of accessory | No | MacOSXSysInfo |
name |
a human-readable name for your plugin | No | macOSX Info |
file |
.json respons file | yes | default : /tmp/_homebridge-macosx-info.json |
updateInterval |
is time in ms of data update | yes | default : null |
consumption |
true for log CPU Consumption |
yes | default : null |
user |
true for log Users number |
yes | default : null |
Note :
- The
index.js
call<PATH of Node Module>/homebridge-macosx-info/sh/homebridge-macosx-info.sh
shell script. You can find this script in the repository in/src/sh
directory- It's possible that you can change the path of
homebridge-macosx-info.sh
inreadUptime
function onindex.js
script
async function readUptime() {
const exec = require('child_process').exec;
var script = await exec('/usr/local/lib/node_modules/homebridge-macosx-info/src/sh/homebridge-macosx-info.sh',
(error, stdout, stderr) => {
if (error !== null) {
//this.log("exec error: " + ${error});
}
});
};
JSON_DATA_FILE
check_osx_smc
binary -> var CHECK_OSX_SMC
DIR=$(dirname $0)
JSON_DATA_FILE=/tmp/_homebridge-macosx-info.json # path of .json respons file
CHECK_OSX_SMC=$DIR/../../bin/check_osx_smc # path of check_osx_smc binary
function sys_mon()
{
# See the hardware compatibility -> https://github.com/jedda/OSX-Monitoring-Tools/blob/master/check_osx_smc/known-registers.md
# See README -> https://github.com/jedda/OSX-Monitoring-Tools/blob/master/check_osx_smc/README.md
read -a fields <<< `$CHECK_OSX_SMC -s c -r TA0P,F0Ac -w 70,5200 -c 85,5800`
_temp=${fields[7]//,/.}
_fan=${fields[8]}
_time=`date`
read -a fields <<< `sudo powermetrics -i 500 -n1 --samplers cpu_power | grep "CPUs+GT+SA" | sed 's/Intel energy model derived package power (CPUs+GT+SA): //g'`
_power=${fields[0]//W/}
_uptime=`uptime`
_load=$_uptime
_uptime=${_uptime%users*} ; _uptime=${_uptime%,*} ; _uptime=${_uptime#*up} ; _uptime=${_uptime%,*} ; _uptime=${_uptime#*up} ; _uptime="up ${_uptime# }"
_load=${_load#*load averages: }
_user=`who | wc -l`
_user="${_user// /}"
read -a fields <<< `vm_stat | perl -ne '/page size of (\d+)/ and $size=$1; /Pages\s+([^:]+)[^\d]+(\d+)/ and printf("%-16s % 16.2f Mi\n", "$1:", $2 * $size / 1048576)' | grep "free:"` ; _freemem=${fields[1]}
read -a fields <<< `df -h / | grep /` ; _disk=${fields[4]//%/}
echo '{"updateTime":"'${_time}'","temperature":'${_temp:5:4}',"fan":'${_fan:5:4}',"power":'${_power}',"uptime":"'${_uptime}'","load":"'${_load}'","freemem":'${_freemem:0:6}',"disk":"'${_disk}'","user":'${_user}'}' > $JSON_DATA_FILE
}
# root and users in group wheel can run anything on any machine as any user
root ALL = (ALL) ALL
%admin ALL = (ALL) ALL
<USER> ALL=NOPASSWD: ALL
Note :You must change the user
<USER>
by the user who runhomebridge
in your system
Combine the two commands in a terminal to restart homebridge background process
launchctl unload ~/Library/LaunchAgents/com.homebridge.server.plist
launchctl load ~/Library/LaunchAgents/com.homebridge.server.plist
Note :This commands are only avalable for macOS
check_osx_smc
binary. You can see the hardware compatibility here [#2]I'm furnishing this software "as is". I do not provide any warranty of the item whatsoever, whether express, implied, or statutory, including, but not limited to, any warranty of merchantability or fitness for a particular purpose or any warranty that the contents of the item will be error-free. The development of this module is not supported by Apple Inc. or eve. These vendors and me are not responsible for direct, indirect, incidental or consequential damages resulting from any defect, error or failure to perform.
This project is licensed under the MIT License - see the LICENSE file for details
我有一个使用JOGL1.0库的项目http://easystoneshop.com/applets/countertopquote/index.html。我的应用程序作为Java Web start启动。所有工作正常,但在Mac Os X 10.7.5更新JDK 1.7.0.51我的项目不工作。exeption: 我试着在Mac Os X10.7.5上运行项目,使用JDK1.6.0.37,所有工作
问题内容: 使用MacOSX 10.6上的最新Java更新,Eclipse不再找到Java源代码。 我不确定(如果我不再记得)过去是否手动下载了源并将它们放在某个地方,或者MacOSX是否提供了它们并且Eclipse自动找到了它们。 MacOSX是否在某处有源?(请不要在这里做任何假设。我真的很想知道。) 如果没有,我在哪里可以得到它们? 问题答案: 安装最新的Java更新后,您会在下面找到src
homebridge-info Plugin for homebridge providing stats about the running instance. homebridge-info acts as a server, that emits several infos about the homebridge instance. You can subscribe and displa
Homebridge 是一个轻量级 NodeJS 服务器,它模拟 iOS HomeKit API,提供从 HomeKit 到“智能家居”设备制造商提供的各种第三方 API 的基本桥接。通过 Homebridge 的桥接,可以让 Siri 控制完全不支持 HomeKit 的设备。 此外 Homebridge 支持插件。
homebridge-vsx homebridge-vsx is a plugin made for homebridge,which allows switching on and off your Pioneer AV receiver. All AV receivers (VSX and SC),which work with the iControl AV5 App are support
homebridge-sesame Control and monitor your Sesame smart lock with HomeKit integration. Prerequisites Installation of Homebridge iOS 11 or later Sesame lock with enabled cloud integration Sesame Wifi A