ad5030 / homebridge-macosx-info

This homebridge plugin for Apple HomeKit, get and return somes systems informations from macOSX computer.
MIT License
16 stars 3 forks source link

I can't make the plugin to work. #6

Open SergeStre opened 4 years ago

SergeStre commented 4 years ago

Hello! I'm trying to start this plugin and went through 3 steps except step 2. I don't understand what I have to do on step 2. And I'v got some errors then homebridge starts. Here is the snapshot. IMG_20190909_100354_589

ad5030 commented 4 years ago

The error is in your config.json file at line 83. Can you post your config.json or test it in https://jsonformatter.curiousconcept.com. Can you give me your OSX version and your Mac model ?

STEP 2 : In homebridge-macosx-info.sh script : 1/ You can change path of temporary .json files -> var JSON_DATA_FILE 2/ You can change path and option of check_osx_smc binary -> var CHECK_OSX_SMC For adapte option of check_osx_smc your must read :

Best regard Alexandre

SergeStre commented 4 years ago

I have installed plugin using sudo npm install -g --unsafe-permhomebridge-macosx-info as Homebridge didn't start saying "Error: The requested accessory 'MacOSXSysInfo' was not registered by any plugin." Config.json is absolutely valid, you can check it by yourself. { "bridge": { "name": "Homebridge", "username": "CC:22:3D:E3:CE:30", "port": 51770, "pin": "031-45-154" }, "ports": { "start": 52100, "end": 52150, "comment": "This section is used to control the range of ports that separate accessory (like camera or television) should be bind to." }, "platforms": [ { "platform": "MiPhilipsLightPlatform", "deviceCfgs": [ { "type": "MiPhilipsSmartBulb", "ip": "10.0.1.13", "token": "e9513a296a6f0406ed874a89ca6653e8", "lightName": "Свет", "lightDisable": false } ] }, { "platform": "config", "name": "Config", "port": 8091, "log": "/Users/macmini/.homebridge/logfile.log", "restart": "sudo systemctl restart homebridge.service" }, { "platform": "Shelly", "name": "Shelly" } ], "accessories": [ { "accessory": "MacOSXSysInfo", "name": "macOSX Info", "file": "/tmp/_homebridge-macosx-info.json", "serial": "042-03-000", "consumption": true, "user": true, "updateInterval": 60000 } ] } My system: Macmini 5.1 Mac OS X 10.9.5

ad5030 commented 4 years ago

Hi, Can you send me "/tmp/_homebridge-macosx-info.json" file ? In README.md on STEP 2 you must change option of check_osx_smc in homebridge-macosx-info.sh for adapt it for your Mac ("See the hardware compatibility -> https://github.com/jedda/OSX-Monitoring-Tools/blob/master/check_osx_smc/known-registers.md").

And try to start homebrige with this config file ( I just deleted "consumption": true, "user": true) {
"bridge":{
"name":"Homebridge", "username":"CC:22:3D:E3:CE:30", "port":51770, "pin":"031-45-154" }, "ports":{
"start":52100, "end":52150, "comment":"This section is used to control the range of ports that separate accessory (like camera or television) should be bind to." }, "platforms":[
{
"platform":"MiPhilipsLightPlatform", "deviceCfgs":[
{
"type":"MiPhilipsSmartBulb", "ip":"10.0.1.13", "token":"e9513a296a6f0406ed874a89ca6653e8", "lightName":"Свет", "lightDisable":false } ] }, {
"platform":"config", "name":"Config", "port":8091, "log":"/Users/macmini/.homebridge/logfile.log", "restart":"sudo systemctl restart homebridge.service" }, {
"platform":"Shelly", "name":"Shelly" } ], "accessories":[
{
"accessory":"MacOSXSysInfo", "name":"macOSX Info", "file":"/tmp/_homebridge-macosx-info.json", "serial":"042-03-000", "updateInterval":60000 } ] }

SergeStre commented 4 years ago

_homebridge-macosx-info.zip

ad5030 commented 4 years ago

The error is in the .json respond file : The "power" key is empty {
"updateTime":"Tue Oct 1 19:35:26 YEKT 2019", "temperature":45.0, "fan":1798, "power":, "uptime":"up 16 days", "load":"0.45 0.35 0.34", "freemem":8.11, "disk":"38", "user":3 }

Your hardware is not compatible with this function. So you must delete in your config.json file the MacOSXSysInfo accessories and remplace with this lines.

"accessories": [ { "accessory": "MacOSXSysInfo", "name": "macOSX Info", "file": "/tmp/_homebridge-macosx-info.json", "user": true, "serial": "042-03-000", "updateInterval": 60000 } ]

SergeStre commented 4 years ago

image config.zip