Stog / homebridge-fronius-inverter

A homebridge plugin to pull Fronius solar inverter data into HomeKit as a light sensor accessory.
6 stars 1 forks source link

Unit and conf values #6

Open CoolCatB opened 4 years ago

CoolCatB commented 4 years ago

Hi! I am seeing all the 3 parameter values being displayed in "lux" units instead of Watts?

Thanks!

Stog commented 4 years ago

So unfortunately HomeKit does not have a Characteristic for power generation or consumption so the light level characteristic is used instead for displaying a value.

One of the limitations of the light level is that its minimum value is 0.0001 lux.

There must be an error in getting the value if P_Load and P_Grid are only showing 0.0001.

CoolCatB commented 4 years ago

Thanks for the response! It does get errors as below. I did re-check the configurations and can't spot anything different... Error: connect EHOSTUNREACH xxx.xxx.xx.xx:80 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { errno: 'EHOSTUNREACH', code: 'EHOSTUNREACH', syscall: 'connect', address: 'xxx.xxx.xx.xx', port: 80, config: { url: 'http://xxx.xxx.xx.xx/solar_api/v1/GetPowerFlowRealtimeData.fcgi', method: 'get', headers: { Accept: 'application/json, text/plain, /', 'User-Agent': 'axios/0.19.2' }, transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 2000, adapter: [Function: adapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, validateStatus: [Function: validateStatus], data: undefined }, request: Writable { _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, bufferedRequest: null, lastBufferedRequest: null, pendingcb: 0, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: false, bufferedRequestCount: 0, corkedRequestsFree: [Object] }, writable: true, _events: [Object: null prototype] { response: [Function: handleResponse], error: [Function: handleRequestError] }, _eventsCount: 2, _maxListeners: undefined, _options: { protocol: 'http:', maxRedirects: 21, maxBodyLength: 10485760, path: '/solar_api/v1/GetPowerFlowRealtimeData.fcgi', method: 'GET', headers: [Object], agent: undefined, agents: [Object], auth: undefined, hostname: 'xxx.xxx.xx.xx', port: null, nativeProtocols: [Object], pathname: '/solar_api/v1/GetPowerFlowRealtimeData.fcgi' }, _redirectCount: 0, _redirects: [], _requestBodyLength: 0, _requestBodyBuffers: [], _onNativeResponse: [Function], _currentRequest: ClientRequest { _events: [Object: null prototype], _eventsCount: 6, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: [Socket], connection: [Socket], _header: 'GET /solar_api/v1/GetPowerFlowRealtimeData.fcgi HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'User-Agent: axios/0.19.2\r\n' + 'Host: xxx.xxx.xx.xx\r\n' + 'Connection: close\r\n' + '\r\n', _onPendingData: [Function: noopPendingOutput], agent: [Agent], socketPath: undefined, method: 'GET', insecureHTTPParser: undefined, path: '/solar_api/v1/GetPowerFlowRealtimeData.fcgi', _ended: false, res: null, aborted: false, timeoutCb: [Function: emitRequestTimeout], upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, _redirectable: [Circular],

  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype]
},
_currentUrl: 'http://xxx.xxx.xx.xx/solar_api/v1/GetPowerFlowRealtimeData.fcgi',
[Symbol(kCapture)]: false

}, response: undefined, isAxiosError: true, toJSON: [Function] } [6/5/2020, 10:06:03 PM] [Generation] calling getCurrentAmbientLightLevelcHandler 0 Error: connect EHOSTUNREACH xxx.xxx.xx.xx:80 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) { errno: 'EHOSTUNREACH', code: 'EHOSTUNREACH', syscall: 'connect', address: 'xxx.xxx.xx.xx', port: 80, config: { url: 'http://xxx.xxx.xx.xx/solar_api/v1/GetPowerFlowRealtimeData.fcgi', method: 'get', headers: { Accept: 'application/json, text/plain, /', 'User-Agent': 'axios/0.19.2' }, transformRequest: [ [Function: transformRequest] ], transformResponse: [ [Function: transformResponse] ], timeout: 2000, adapter: [Function: adapter], xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, validateStatus: [Function: validateStatus], data: undefined }, request: Writable { _writableState: WritableState { objectMode: false, highWaterMark: 16384, finalCalled: false, needDrain: false, ending: false, ended: false, finished: false, destroyed: false, decodeStrings: true, defaultEncoding: 'utf8', length: 0, writing: false, corked: 0, sync: true, bufferProcessing: false, onwrite: [Function: bound onwrite], writecb: null, writelen: 0, afterWriteTickInfo: null, bufferedRequest: null, lastBufferedRequest: null, pendingcb: 0, prefinished: false, errorEmitted: false, emitClose: true, autoDestroy: false, bufferedRequestCount: 0, corkedRequestsFree: [Object] }, writable: true, _events: [Object: null prototype] { response: [Function: handleResponse], error: [Function: handleRequestError] }, _eventsCount: 2, _maxListeners: undefined, _options: { protocol: 'http:', maxRedirects: 21, maxBodyLength: 10485760, path: '/solar_api/v1/GetPowerFlowRealtimeData.fcgi', method: 'GET', headers: [Object], agent: undefined, agents: [Object], auth: undefined, hostname: 'xxx.xxx.xx.xx', port: null, nativeProtocols: [Object], pathname: '/solar_api/v1/GetPowerFlowRealtimeData.fcgi' }, _redirectCount: 0, _redirects: [], _requestBodyLength: 0, _requestBodyBuffers: [], _onNativeResponse: [Function], _currentRequest: ClientRequest { _events: [Object: null prototype], _eventsCount: 6, _maxListeners: undefined, outputData: [], outputSize: 0, writable: true, _last: true, chunkedEncoding: false, shouldKeepAlive: false, useChunkedEncodingByDefault: false, sendDate: false, _removedConnection: false, _removedContLen: false, _removedTE: false, _contentLength: 0, _hasBody: true, _trailer: '', finished: true, _headerSent: true, socket: [Socket], connection: [Socket], _header: 'GET /solar_api/v1/GetPowerFlowRealtimeData.fcgi HTTP/1.1\r\n' + 'Accept: application/json, text/plain, /\r\n' + 'User-Agent: axios/0.19.2\r\n' + 'Host: xxx.xxx.xx.xx\r\n' + 'Connection: close\r\n' + '\r\n', _onPendingData: [Function: noopPendingOutput], agent: [Agent], socketPath: undefined, method: 'GET', insecureHTTPParser: undefined, path: '/solar_api/v1/GetPowerFlowRealtimeData.fcgi', _ended: false, res: null, aborted: false, timeoutCb: [Function: emitRequestTimeout], upgradeOrConnect: false, parser: null, maxHeadersCount: null, reusedSocket: false, _redirectable: [Circular],

  [Symbol(kNeedDrain)]: false,
  [Symbol(corked)]: 0,
  [Symbol(kOutHeaders)]: [Object: null prototype]
},
_currentUrl: 'http://xxx.xxx.xx.xx/solar_api/v1/GetPowerFlowRealtimeData.fcgi',
[Symbol(kCapture)]: false

}, response: undefined, isAxiosError: true, toJSON: [Function] }

CoolCatB commented 4 years ago

I did get a warning as below while installing the plugin. Is it because of that?

pi@raspberrypi:~/.homebridge $ sudo npm install -g homebridge-fronius-inverter npm WARN axios-cache-adapter@2.5.0 requires a peer of axios@0.18.1 but none is installed. You must install peer dependencies yourself.