simont77 / fakegato-history Goto Github PK
View Code? Open in Web Editor NEWModule to emulate Elgato Eve history
License: MIT License
Module to emulate Elgato Eve history
License: MIT License
I want to log the internet speeds in fakegato-history in Mbps. In the fakegato-history json file the values look good.
Plugin:
https://github.com/Kienz/homebridge-speedtest-net
persistent json:
{"firstEntry":0,"lastEntry":2,"usedMemory":2,"refTime":608625820.9330001,"initialTime":1586933020.933,"history":["noValue",{"time":1586933020.933,"setRefTime":1},{"time":1586933020.933,"temp":422.75,"humidity":17.97,"pressure":55}]}
temp = download speed
humidity = upload speed
pressure = ping in ms
homebridge log:
4/15/2020, 8:43:40 AM] [Internet] Download: 422.75 Mbps
[4/15/2020, 8:43:40 AM] [Internet] Upload: 17.97 Mbps
[4/15/2020, 8:43:40 AM] [Internet] Ping: 55 ms
[4/15/2020, 8:43:40 AM] [Internet] External IP: 149.172.218.226
[4/15/2020, 8:43:40 AM] [Internet] Add history data 422.75 17.97 55
[4/15/2020, 8:43:40 AM] [Internet] First entry Internet: 0
[4/15/2020, 8:43:40 AM] [Internet] Last entry Internet: 2
[4/15/2020, 8:43:40 AM] [Internet] Used memory Internet: 2
[4/15/2020, 8:43:40 AM] [Internet] 116 Internet: 00000000000000009ce4462403 0102 0202 03020300c00f00000000000000000101
[4/15/2020, 8:43:40 AM] [Internet] ** Fakegato-storage write FS file: /homebridge/accessories/homebridge-4_Internet_persist.json "firstEntry":0,"lastEntry":2,"usedMemory":2,"refTime":608625820.9330001,"initial
[4/15/2020, 8:44:28 AM] [Internet] Data request Internet: 01140100000000
[4/15/2020, 8:44:28 AM] [Internet] Address requested Internet: 1
[4/15/2020, 8:44:28 AM] [Internet] Internet Entry: 2, Address: 2
[4/15/2020, 8:44:28 AM] [Internet] Data Internet: 1501000000 0100 0000 819ce446240000 0000 00 0000 10 02000000000000000723a505072602
Eve shows for this entry the value "-232,6" (in celcius). What is wrong?
I'm using the temperature service and the "weather" fakegato-history.
Hey I tried to add this cool plugin to my weather station extended plugin but I'm facing some problems.
I added your plugin v0.3.8 according to your description but the history data in the eve app is empty.
Do you have any idea what I might be doing wrong?
You can see my implementation here: https://github.com/naofireblade/homebridge-weather-station-extended/blob/master/index.js
I debugged the fakegato-history service and there seems to be history data in it:
displayName: 'Now History',
UUID: 'E863F007-079E-48FF-8F27-9C2605A29F52',
subtype: undefined,
iid: 25,
characteristics:
[ Characteristic {
displayName: 'Name',
UUID: '00000023-0000-1000-8000-0026BB765291',
iid: 26,
value: 'Now History',
eventOnlyCharacteristic: false,
props: [Object],
_events: [Object],
_eventsCount: 1 },
S2R1Characteristic {
displayName: 'S2R1',
UUID: 'E863F116-079E-48FF-8F27-9C2605A29F52',
iid: 27,
value: '8AAAAAAAAACdvCMgAwECAgIDAgQAwA8AAAAAAAAAAAEB',
eventOnlyCharacteristic: false,
props: [Object],
_events: [Object],
_eventsCount: 1 },
S2R2Characteristic {
displayName: 'S2R2',
UUID: 'E863F117-079E-48FF-8F27-9C2605A29F52',
iid: 28,
value: null,
eventOnlyCharacteristic: false,
props: [Object],
_events: [Object],
_eventsCount: 2 },
S2W1Characteristic {
displayName: 'S2W1',
UUID: 'E863F11C-079E-48FF-8F27-9C2605A29F52',
iid: 29,
value: null,
eventOnlyCharacteristic: false,
props: [Object],
_events: [Object],
_eventsCount: 2 },
S2W2Characteristic {
displayName: 'S2W2',
UUID: 'E863F121-079E-48FF-8F27-9C2605A29F52',
iid: 30,
value: null,
eventOnlyCharacteristic: false,
props: [Object],
_events: [Object],
_eventsCount: 2 } ],
optionalCharacteristics: [],
isHiddenService: false,
isPrimaryService: false,
linkedServices: [],
size: 4032,
minutes: 4,
accessoryName: 'Now',
log:
{ [Function: bound ]
debug: [Function],
info: [Function],
warn: [Function],
error: [Function],
log: [Function],
prefix: 'Wetterstation' },
accessoryType116: '03 0102 0202 0302',
accessoryType117: '07',
accessoryType: 'weather',
firstEntry: 0,
lastEntry: 3,
history:
[ ,
{ time: 1517520157, setRefTime: 1 },
{ temp: 1.9, ressure: 998, humidity: 94, time: 1517520157 },
{ temp: 1.8, ressure: 998, humidity: 94, time: 1517520397 } ],
memorySize: 4032,
usedMemory: 3,
currentEntry: 1,
transfer: false,
setTime: true,
refTime: 539212957,
memoryAddress: 0,
dataStream: '',
IntervalID: null,
_events:
{ 'service-configurationChange': [Function: bound ],
'characteristic-change': [Function: bound ] },
_eventsCount: 2 }````
when I lunch the script quickstartGoogleDrive.js and retrieve the link when I put the code into command line I receive the following error:
fs.js:128
throw new ERR_INVALID_CALLBACK();
^
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
at maybeCallback (fs.js:128:9)
at Object.writeFile (fs.js:1163:14)
at storeToken (/homebridge/node_modules/fakegato-history/lib/googleDrive.js:356:6)
at /homebridge/node_modules/fakegato-history/lib/googleDrive.js:337:7
at /homebridge/node_modules/fakegato-history/node_modules/google-auth-library/lib/auth/oauth2client.js:154:5
at Request._callback (/homebridge/node_modules/fakegato-history/node_modules/google-auth-library/lib/transporters.js:106:7)
at Request.self.callback (/homebridge/node_modules/fakegato-history/node_modules/request/request.js:185:22)
at Request.emit (events.js:198:13)
at Request. (/homebridge/node_modules/fakegato-history/node_modules/request/request.js:1161:10)
at Request.emit (events.js:198:13)
Hi,
Great project!
I would like to include the new thermo functionality you've created in honeywell's evohome homebridge: https://github.com/rooi/homebridge-evohome
I do not see the the graphs as in the weather station. Perhaps it has something to do with the fact the the homebridge-evohome uses platforms instead of accessories and/or I've made an error. Do you have an example on how to include the thermo?
Thanks!
Would need to use the version in the names of homebridge.globalFakegatoTimer and homebridge.globalFakeGatoStorage to solve this.
I am trying hard to add air quality (ppm) history with fakegato - but no luck yet. the accessory always reports "not data". is there anywhere a good example or where can I find the specific conditions for this? contactSensor and temp/humidity works for me, but not air quality. PLEASE HELP!
Hi,
I really like your lib and the timer handling.
In my setup, sensor data are received via MQTT every ~50-70 seconds. I call your addEntry
function every time when new data are received, so that a new history entry is generated every 10min from the average. This is working perfectly.
Now, if one sensor suddenly stops sending data (going offline, battery low, ...) and consequently no entry is added within the next 10min-intervall (no addEntry
call), I don’t want to have this „previous average extra entry“ generated. If the sensor is really off, gaps in the Eve app are absolutely ok.
Is it possible to use your timer for averaging values over the timer interval, but without adding extra entries if no data were added?
Hi,
I'm trying to add FakeGate to the homebridge-knx plugin. When I check the device in the eve App, I see the graph, but it says "No data available". If I dump the "loggingService" variable, I could see historical data. So not sure what I'm doing wrong here...
Any ideas how to further debug and get this up and running?
Thanks....
Debug Output:
[6/4/2018, 12:51:27 PM] [homebridge-knx.KNX] ** Fakegato-storage AddWriter : Temperatur Wohnzimmer History8
[6/4/2018, 12:51:27 PM] [homebridge-knx.KNX] ** Fakegato-storage read FS file: /home/knx/.homebridge/knx_Temperatur Wohnzimmer History8_persist.json
[6/4/2018, 12:51:27 PM] [homebridge-knx.KNX] ** Fakegato-timer Subscription : Temperatur Wohnzimmer History8
....
[6/4/2018, 12:54:15 PM] [homebridge-knx.KNX] **Fakegato-timer: addData Temperatur Wohnzimmer History8 { time: 1528109655, temp: 26 } immediate: false
Dump of loggingService:
FakeGatoHistory {
displayName: 'Temperatur Wohnzimmer History8 History',
UUID: 'E863F007-079E-48FF-8F27-9C2605A29F52',
subtype: 'SUB_dbcb770a-9b2e-4e69-8695-7317969d8a38',
iid: 21,
characteristics:
[ Characteristic {
displayName: 'Name',
UUID: '00000023-0000-1000-8000-0026BB765291',
iid: 22,
value: 'Temperatur Wohnzimmer History8 History',
status: null,
eventOnlyCharacteristic: false,
props:
{ format: 'string',
unit: null,
minValue: null,
maxValue: null,
minStep: null,
perms: [ 'pr' ] },
subscriptions: 0,
_events: { change: [Function: bound ] },
_eventsCount: 1 } ],
optionalCharacteristics: [],
isHiddenService: false,
isPrimaryService: false,
linkedServices: [],
size: '365',
minutes: 10,
storage: 'fs',
path: '/home/knx/.homebridge',
filename: undefined,
disableTimer: false,
accessoryName: 'Temperatur Wohnzimmer History8',
log:
{ [Function: bound ]
debug: [Function],
info: [Function],
warn: [Function],
error: [Function],
log: [Function],
prefix: 'homebridge-knx.KNX' },
loaded: true,
accessoryType116: '04 0102 0202 0402 0f03',
accessoryType117: '0f',
accessoryType: 'room',
firstEntry: 0,
lastEntry: 4,
history:
[ 'noValue',
{ time: 1528107958, setRefTime: 1 },
{ temp: 25.9, time: 1528107958 },
{ temp: 25.94, time: 1528108558 },
{ temp: 26, time: 1528109159 } ],
memorySize: '365',
usedMemory: 4,
currentEntry: 1,
transfer: false,
setTime: true,
refTime: 549800758,
memoryAddress: 0,
dataStream: '',
saving: false,
service:
Service {
displayName: 'Temperatur Wohnzimmer History8 History',
UUID: 'E863F007-079E-48FF-8F27-9C2605A29F52',
subtype: 'room',
iid: 11,
characteristics:
[ Characteristic {
displayName: 'Name',
UUID: '00000023-0000-1000-8000-0026BB765291',
iid: 12,
value: 'Temperatur Wohnzimmer History8 History',
status: null,
eventOnlyCharacteristic: false,
props:
{ format: 'string',
unit: null,
minValue: null,
maxValue: null,
minStep: null,
perms: [Object] },
subscriptions: 0,
_events: { change: [Function: bound ] },
_eventsCount: 1 },
Characteristic {
displayName: 'S2R1',
UUID: 'E863F116-079E-48FF-8F27-9C2605A29F52',
iid: 13,
value: 'sQQAAAAAAAA2S8UgBAECAgIEAg8DBQBtAQAAAAAAAAAAAQE=',
status: null,
eventOnlyCharacteristic: false,
props:
{ format: 'data',
unit: null,
minValue: null,
maxValue: null,
minStep: null,
perms: [Object] },
subscriptions: 0,
_events: { change: [Function: bound ] },
_eventsCount: 1 },
Characteristic {
displayName: 'S2R2',
UUID: 'E863F117-079E-48FF-8F27-9C2605A29F52',
iid: 14,
value: 'EwMAAABYAgAADyIKAAAAAAAAAA==',
status: null,
eventOnlyCharacteristic: false,
props:
{ format: 'data',
unit: null,
minValue: null,
maxValue: null,
minStep: null,
perms: [Object] },
subscriptions: 0,
_events:
{ change: [Function: bound ],
get: [Function: bound getCurrentS2R2] },
_eventsCount: 2 },
Characteristic {
displayName: 'S2W1',
UUID: 'E863F11C-079E-48FF-8F27-9C2605A29F52',
iid: 15,
value: 'ARQDAAAAAA==',
status: null,
eventOnlyCharacteristic: false,
props:
{ format: 'data',
unit: null,
minValue: null,
maxValue: null,
minStep: null,
perms: [Object] },
subscriptions: 0,
_events:
{ change: [Function: bound ],
set: [Function: bound setCurrentS2W1] },
_eventsCount: 2 },
Characteristic {
displayName: 'S2W2',
UUID: 'E863F121-079E-48FF-8F27-9C2605A29F52',
iid: 16,
value: '0k7FIA==',
status: null,
eventOnlyCharacteristic: false,
props:
{ format: 'data',
unit: null,
minValue: null,
maxValue: null,
minStep: null,
perms: [Object] },
subscriptions: 0,
_events:
{ change: [Function: bound ],
set: [Function: bound setCurrentS2W2] },
_eventsCount: 2 } ],
optionalCharacteristics: [],
isHiddenService: false,
isPrimaryService: false,
linkedServices: [],
_events:
{ 'service-configurationChange': [Function: bound ],
'characteristic-change': [Function: bound ] },
_eventsCount: 2 },
_events:
{ 'service-configurationChange': [Function: bound ],
'characteristic-change': [Function: bound ] },
_eventsCount: 2,
initialTime: 1528107958 }
in addition to doing:
history.getCharacteristic(CommunityTypes.EveResetTotal).updateValue(value)
should a call be made to history.cleanPersist()
or something else to tell fakegato to clear the history?
thanks!
The subject says it all - is there any accessory where this has been successfully implemented?
I'm having some concerns on the fakegato-storage functionality, particularly the filenames used:
{storage: 'fs'}
as option to FakeGatoHistory
, it doesn't seem to make sense to use the hostname in the filename. Multiple instances of homebridge need to be run from a different user directory anyway, ensuring each instance logs to a different directory;Arguably, not every-one might share my concerns. Both issues could be addressed by adding an additional filename
option to the FakeGatoHistory
, so each plugin can control their own behaviour.
We are struggling with the reference time of the Last Activation characteristic for a fake Eve door ContactSensor.
Wiki says:
seconds since last reset
However, Eve app always shows Just now for the last opening event.
@ebaauw uses something like this.hk.lastActivation = now - this.historyService.getInitialTime()
but this shows in our case the same behavior.
I'd like to be able to specify per accessory whether the logging service should subscribe to the fakegato timer. A lot of ZigBee sensors report their state periodically, which I can use easily to create periodic entries.
Also, for plugins that poll devices and cache their state it's quite easy to create periodic entries every n-th polling cycle.
cf., https://github.com/homespun/homebridge-accessory-bandwidth-quality/blob/master/index.js#L175
i am trying to determine why my plugin isn't generating entries that are acceptable to the elgato eve app.
a typical entry is something like:
{ time: 1539616961, ppm: 500, temp: 272.56832, humidity: 9.14389333333332 }
the timer is disabled and an entry is added each hour. in looking at the README
i am wondering whether i am doing something wrong with respect to the timing. can you advise me? thanks!
I'm trying to implement fakegato-history in my homebridge-hue platform plugin, but I'm stuck. Would appreciate any hints.
I started with what I hoped would be the easiest: a door sensor. Also, I have an Eve Door for comparison. I added the LastOpen (11A) and TimesOpened (129) characteristics to the ContactSensor service. I update their values when the contact state changes - this seems to work. I added a fakegato logging service to the "accessory" (still using the old static accessory model). I issue an addEntry() on startup and when the contact state changes. The Fakegato-timer seems to do its work, I see an entry being added every 10 minutes (see log below). In Eve, I see history under the Times Opened characteristic, but not under the Contact characteristic. When I press the details, Eve shows a busy wheel and doesn't display any log entries. I didn't add the 118 and 119 characteristics to the Contact Sensor service. Would I need to do so? Do need to set their values or will the Eve app to that?
I added the ResetTotals characteristic (112) to the logging service, but I don't see a reset in Eve under the Times Opened details (as for the Eve Door). I double-checked in HMCatalog that it's there. Should I assign a value other than 0 to this characteristic? I do notice some more characteristics in the logging service for the Eve Door. It has 11E (rw), 112 (rw), 11C (w), 121 (w), 116 (r), 117 (r), 11D (w), and 131 (r). The fakegato logging service only has 116, 117, 11C, 121, and 112 (added by me).
Here's some excerpts from the homebridge log:
[2018-1-30 21:50:25] [Hue] pi2: /sensors/256: LUMI lumi.sensor_magnet.aq2 (ZHAOpenClose) "Washroom Door"
[2018-1-30 21:50:25] [Hue] ** Fakegato-timer Subscription : Washroom Door
[2018-1-30 21:50:25] [Hue] **Fakegato-timer: addData Washroom Door { time: 1517345425, status: 0 } immediate: true
[2018-1-30 21:50:25] [Hue] **Fakegato-timer: executeImmediateCallback**
[2018-1-30 21:50:25] [Hue] **Fakegato-timer callbackDoor: Washroom Door , immediate: true , entry: { time: 1517345425, status: 0 }
[2018-1-30 21:50:25] [Hue] First entry Washroom Door: 0
[2018-1-30 21:50:25] [Hue] Last entry Washroom Door: 2
[2018-1-30 21:50:25] [Hue] Used memory Washroom Door: 2
[2018-1-30 21:50:25] [Hue] 116 Washroom Door: 00000000000000001112212001 06010300c00f00000000000000000101
...
[2018-1-30 21:53:59] [Hue] Data request Washroom Door: 01140000000000
[2018-1-30 21:53:59] [Hue] Address requested Washroom Door: 0
[2018-1-30 21:53:59] [Hue] Data Washroom Door: 1501000000 0100 0000 81111221200000 0000 00 0000
[2018-1-30 21:53:59] [Hue] Washroom Door Entry: 2, Address: 2
[2018-1-30 21:53:59] [Hue] Data Washroom Door: 0b 02000000000000000100
[2018-1-30 21:54:05] [Hue] Washroom Door: state changed event
[2018-1-30 21:54:05] [Hue] Washroom Door: sensor open changed from false to true
[2018-1-30 21:54:05] [Hue] Washroom Door: set homekit contact from 0 to 1
[2018-1-30 21:54:05] [Hue] **Fakegato-timer: addData Washroom Door { time: 1517345645, status: 1 } immediate: true
[2018-1-30 21:54:05] [Hue] **Fakegato-timer: executeImmediateCallback**
[2018-1-30 21:54:05] [Hue] **Fakegato-timer callbackDoor: Washroom Door , immediate: true , entry: { time: 1517345645, status: 1 }
[2018-1-30 21:54:05] [Hue] First entry Washroom Door: 0
[2018-1-30 21:54:05] [Hue] Last entry Washroom Door: 3
[2018-1-30 21:54:05] [Hue] Used memory Washroom Door: 3
[2018-1-30 21:54:05] [Hue] 116 Washroom Door: dc000000000000001112212001 06010400c00f00000000000000000101
[2018-1-30 21:54:08] [Hue] Washroom Door: state changed event
[2018-1-30 21:54:08] [Hue] Washroom Door: sensor open changed from true to false
[2018-1-30 21:54:08] [Hue] Washroom Door: set homekit contact from 1 to 0
[2018-1-30 21:54:08] [Hue] **Fakegato-timer: addData Washroom Door { time: 1517345648, status: 0 } immediate: true
[2018-1-30 21:54:08] [Hue] **Fakegato-timer: executeImmediateCallback**
[2018-1-30 21:54:08] [Hue] **Fakegato-timer callbackDoor: Washroom Door , immediate: true , entry: { time: 1517345648, status: 0 }
[2018-1-30 21:54:08] [Hue] First entry Washroom Door: 0
[2018-1-30 21:54:08] [Hue] Last entry Washroom Door: 4
[2018-1-30 21:54:08] [Hue] Used memory Washroom Door: 4
[2018-1-30 21:54:08] [Hue] 116 Washroom Door: df000000000000001112212001 06010500c00f00000000000000000101
[2018-1-30 21:54:14] [Hue] Washroom Door: state changed event
[2018-1-30 21:54:14] [Hue] Washroom Door: sensor open changed from false to true
[2018-1-30 21:54:14] [Hue] Washroom Door: set homekit contact from 0 to 1
[2018-1-30 21:54:14] [Hue] **Fakegato-timer: addData Washroom Door { time: 1517345654, status: 1 } immediate: true
[2018-1-30 21:54:14] [Hue] **Fakegato-timer: executeImmediateCallback**
[2018-1-30 21:54:14] [Hue] **Fakegato-timer callbackDoor: Washroom Door , immediate: true , entry: { time: 1517345654, status: 1 }
[2018-1-30 21:54:14] [Hue] First entry Washroom Door: 0
[2018-1-30 21:54:14] [Hue] Last entry Washroom Door: 5
[2018-1-30 21:54:14] [Hue] Used memory Washroom Door: 5
[2018-1-30 21:54:14] [Hue] 116 Washroom Door: e5000000000000001112212001 06010600c00f00000000000000000101
[2018-1-30 21:54:17] [Hue] Washroom Door: state changed event
[2018-1-30 21:54:17] [Hue] Washroom Door: sensor open changed from true to false
[2018-1-30 21:54:17] [Hue] Washroom Door: set homekit contact from 1 to 0
[2018-1-30 21:54:17] [Hue] **Fakegato-timer: addData Washroom Door { time: 1517345657, status: 0 } immediate: true
[2018-1-30 21:54:17] [Hue] **Fakegato-timer: executeImmediateCallback**
[2018-1-30 21:54:17] [Hue] **Fakegato-timer callbackDoor: Washroom Door , immediate: true , entry: { time: 1517345657, status: 0 }
[2018-1-30 21:54:17] [Hue] First entry Washroom Door: 0
[2018-1-30 21:54:17] [Hue] Last entry Washroom Door: 6
[2018-1-30 21:54:17] [Hue] Used memory Washroom Door: 6
[2018-1-30 21:54:17] [Hue] 116 Washroom Door: e8000000000000001112212001 06010700c00f00000000000000000101
...
[2018-1-30 22:00:25] [Hue] **Fakegato-timer callbackDoor: Washroom Door , immediate: false , entry: { time: 1517346025, status: 0 }
[2018-1-30 22:00:25] [Hue] First entry Washroom Door: 0
[2018-1-30 22:00:25] [Hue] Last entry Washroom Door: 7
[2018-1-30 22:00:25] [Hue] Used memory Washroom Door: 7
[2018-1-30 22:00:25] [Hue] 116 Washroom Door: 58020000000000001112212001 06010800c00f00000000000000000101
...
[2018-1-30 22:07:22] [Hue] Address requested Washroom Door: b
[2018-1-30 22:07:22] [Hue] Washroom Door Entry: 11, Address: 11
[2018-1-30 22:07:22] [Hue] Washroom Door Entry: 12, Address: 12
[2018-1-30 22:07:22] [Hue] Washroom Door Entry: 13, Address: 13
[2018-1-30 22:07:22] [Hue] Washroom Door Entry: 14, Address: 14
[2018-1-30 22:07:22] [Hue] Washroom Door Entry: 15, Address: 15
[2018-1-30 22:07:22] [Hue] Data Washroom Door: 0b 0b0000007a0300000100 0b 0c000000930300000101 0b 0d0000009e0300000100 0b 0e000000a30300000101 0b 0f000000a70300000100
...
[2018-1-30 22:15:24] [Hue] Data request Washroom Door: 01141000000000
[2018-1-30 22:15:24] [Hue] Address requested Washroom Door: 10
[2018-1-30 22:15:24] [Hue] Washroom Door Entry: 16, Address: 16
[2018-1-30 22:15:24] [Hue] Data Washroom Door: 0b 10000000b00400000100
Backlog
Issues
i have just added the fakegato-history to the homebridge-them platform plugin.
basic functionality is already very nice. but I have noticed some things:
I think the documented polarity for the contact sensor events is wrong. at least I have to store 1 for closed and 0 for open. otherwise the graph and the list of events is inverted.
maybe the values follow the style of the CurrentDoorState characteristic instead of the ContactSensorState style?
as the contact sensor history will not work without the TimesOpened, SecondsOpened and SecodsClosed characteristics it would be nicht if fakegato would add them automatically and also cunt the events. the data is there :).
the same would be true for the LastActivation
would you accept a patch that adds support for these three?
Whilst the Eve app is one of the best Homekit apps around, I was wondering whether it is possible to access the history data for Eve devices from outside the app? If the app can pull the data from say its weather device could some other interface do it so that it became available in say Node-Red?
Hi,
is there a way to mix types in an accessory?
e.g. my accessory has a temperature sensor service and a switch service (power), how can i log "temp" and "state" for it?
I've been using homebridge-foobot
plugin which has logging set up like this.
I've got 3 devices and I can see they all share the same measurements history - only single device writes it and all of them show the same measurements history in Eve.
Should there be different path specified to prevent this @simont77 ?
Thanks!
Hi,
Elgato sells the Eve Light Switch in the US and interestingly it seems to offer a history for Characteristic.On. As I'm in Germany I can't use this out of the box, however it would be great to know if support for this is underway?
I'd be looking to add this to my automation switches. Incidentally if I try to expose the history for the switches, the app already shows an On History, but doesn't show any data - so the data format must differ from the others somehow.
Thanks!
Hi,
i've created some new accessories with fakegato. Everthing seems to work correctly.
How can i force the accessory to show the history? I've tried to remove the accessory from the homebridge and readd it again. Nothing happens. Is there a other solution than to completly remove the homebridge?
regards
I want to use a different filename, based on the device unique ID (ZigBee mac address) instead of on the (user changeable!) accessory name. I managed this by setting the accessory.displayName, but now it also shows the history service (007) under the ID. I figured I could create the 007 service myself, and fakegato-history would pick it up:
fakegato-history/fakegato-history.js
Lines 440 to 448 in 8e88a4a
However, my platform plugin is recognised as accessory plugin. Shouldn't line 440 check for getServices()
instead of getService()
?
I getting the following error after 1-2 minutes after startup.
RangeError [ERR_BUFFER_OUT_OF_BOUNDS]: Attempt to write outside buffer bounds
at boundsError (internal/buffer.js:53:11)
at Buffer.readFloatBackwards [as readFloatBE] (internal/buffer.js:403:5)
at Parser. (/usr/lib/node_modules/homebridge-knx/lib/knxmonitor.js:62:29)
at Parser.emit (events.js:182:13)
at /usr/lib/node_modules/homebridge-knx/node_modules/eibd/lib/parser.js:96:12
at Decoder.decode (/usr/lib/node_modules/homebridge-knx/node_modules/eibd/lib/decoder.js:233:7)
at Parser.parseTelegram (/usr/lib/node_modules/homebridge-knx/node_modules/eibd/lib/parser.js:93:18)
at Parser.onData (/usr/lib/node_modules/homebridge-knx/node_modules/eibd/lib/parser.js:150:12)
at Socket. (/usr/lib/node_modules/homebridge-knx/node_modules/eibd/lib/parser.js:36:10)
at Socket.emit (events.js:182:13)
I saw now stats so far.
Still tried to get it running.
Hello @simont77,
i have a very strange issue with fakegato-history
. 😢
I implemented since a long time in homebridge-devolo
.
I've had the problem many times when I was still using a Raspberry Pi. But after 5-10 minutes homebridge
started normally and without errors. Back then I was thinking of Read / Write IOs? Or the fact that status changes (power consumption, motion detector, contact sensor) were tried to write while loading the faktegato-history
. So I then added the isHistoryLoaded
function to onCurrentValueChanged
.
Whatever, after I moved my homebridge
installation to an Intel i3 with SSD, I never had any problems again. Til today ...
I try to summarize it.
Homebridge tried 93 times ... until I intervened manually.
Mar 12 13:11:04 frida systemd[1]: homebridge1.service: Scheduled restart job, restart counter is at 93.
The debug log always looks similar, without a real error message the start process fails. I cannot send you the entire log with all 93 attempts - because it exceeds 220 MB. I attached the last attempts here as TXT (2.3 MB).
fakegato-01-true_failstart-over-90-times_cut.txt
Now it's getting interesting. I then deactivated fakegato
for homebridge-devolo
in config.json
and homebridge
started properly. (Logfile size 43 KB)
fakegato-02-false_now-starts-fine.txt
Then, I finished homebridge
clean again, activated fakegato
. Simsalabim! Homebridge
now starts properly with activate fakegato
. (Logfile 2.3 MB) Many many historical data.
fakegato-03-true-again-starts-fine.txt
Phew. Strange right? @simont77
Do you have any idea?
My thoughts:
Homebridge
has obviously not ended "properly". Did fakegato-history
attempt to write any cached / complete data at startup before isHistoryLoaded
? Which was rejected after fakegato: false
?Thanks for your time.
Nico
My Eve app has been updated to v3.8.1 and no longer displays history graphs. Is this a problem to be solved by the EVE developers or by you?
Hello everyone,
First of all, thank you so much for this awesome work. Im using it with my Thermostat Plugin. Everything works fine.
So i wanted to create something new in regard of the Motion Sensors. And therefore i wanted to know if its possible to get the latest Entry (time, Status value) from Fakegato history
first, i'm a fan of this package!
second, i lack some clue and i'm hoping that someone can fix that. starting at https://github.com/homespun/homebridge-accessory-apcupsd/blob/master/index.js#L424
i know that addEntry is being called (i see over 220 entries in the persistance file), bu nothing ever shows for data:
what am i missing?
thank you!
Hi!
I'm working on implementing custom Eve characteristics for ESP8266 based HomeKit firmware that works without any bridge via Wi-Fi.
Characteristics that i'm looking for: Temperature offset, LED on Motion, Transitions, Power On Behavior
Also i'm looking for the correct Service/Characteristic order for Eve Room to show app at the settings page as "Eve Room" (like my Eve Degree, Motion etc). Found it 🤓
Currently I've successfully added Eve Degree (shows up as "real" Degree in Eve app), but i can't find the correct order for Eve Room! But i've found some things in Accessory Simulator, e.g: VOC density doesn't shows up on Eve app (Room's sensor can measure it...also CO2)😄
But VOC characteristic will be kept because I've the same sensor that Elgato have in Room
Other thing that cant figure out is Eve Motion have ( had???) custom "LED on Motion" characteristic for toggeling the LED when motion detected.... anybody found the proper characteristic for that?😄
It would be a nice feature to turn on/off the led when motion detected via Eve's characteristic
I have a bunch of measurements alongside their UNIX timestamp in the API I am querying for the stats on my air purifier plugin, is it supported to load in historical records using addEvent?
I have about 3k records that would need to be included, or is there a specific bulk loader?
I was considering looping over all the measurements and calling addEvent on every iteration - is there a way to push these direct to this history, or will each call need to wait for the 10-minute poll?
I'm trying to implement energy consumption history into this plugin. It appears to be creating the fakeGatoHistoryService, adding entries, and writing entries to disk properly, but I still cannot see history in the Eve app.
I also have the homebridge-weather-station-extended plugin installed it's working fine. When the Eve app is refreshed, there will be activity in the log where fakegato-history sends new weather entries to the Eve app, but not so for the energy consumption history I'm trying to implement.
I've noticed nothing in the fakeGatoHistoryService is being assigned an iid, they all remain null and I suspect this is why it's not working, but I can't figure out why this is happening or how to fix it. Any pointers?
I've uploaded a copy of my code here, and this is a sample of the fakegatoHistoryService (iids bolded):
FakeGatoHistory {
displayName: 'Computer History',
UUID: 'E863F007-079E-48FF-8F27-9C2605A29F52',
subtype: undefined,
iid: null,
characteristics:
[ Characteristic {
displayName: 'Name',
UUID: '00000023-0000-1000-8000-0026BB765291',
iid: null,
value: 'Computer History',
status: null,
eventOnlyCharacteristic: false,
props: [Object],
subscriptions: 0,
_events: [Object],
_eventsCount: 1 },
S2R1Characteristic {
displayName: 'S2R1',
UUID: 'E863F116-079E-48FF-8F27-9C2605A29F52',
iid: null,
value: '9eMFAAAAAAATibQgBAECAgIHAg8DOgLADwAAAAAAAAAAAQE=',
status: null,
eventOnlyCharacteristic: false,
props: [Object],
subscriptions: 0,
_events: [Object],
_eventsCount: 1 },
S2R2Characteristic {
displayName: 'S2R2',
UUID: 'E863F117-079E-48FF-8F27-9C2605A29F52',
iid: null,
value: null,
status: null,
eventOnlyCharacteristic: false,
props: [Object],
subscriptions: 0,
_events: [Object],
_eventsCount: 2 },
S2W1Characteristic {
displayName: 'S2W1',
UUID: 'E863F11C-079E-48FF-8F27-9C2605A29F52',
iid: null,
value: null,
status: null,
eventOnlyCharacteristic: false,
props: [Object],
subscriptions: 0,
_events: [Object],
_eventsCount: 2 },
S2W2Characteristic {
displayName: 'S2W2',
UUID: 'E863F121-079E-48FF-8F27-9C2605A29F52',
iid: null,
value: null,
status: null,
eventOnlyCharacteristic: false,
props: [Object],
subscriptions: 0,
_events: [Object],
_eventsCount: 2 } ],
optionalCharacteristics: [],
isHiddenService: false,
isPrimaryService: false,
linkedServices: [],
size: 4032,
minutes: 5,
storage: 'fs',
path: '/homebridge',
filename: undefined,
disableTimer: false,
accessoryName: 'Computer',
log:
{ [Function: bound ]
debug: [Function],
info: [Function],
warn: [Function],
error: [Function],
log: [Function],
prefix: 'TP Link' },
loaded: true,
accessoryType116: '04 0102 0202 0702 0f03',
accessoryType117: '1f',
accessoryType: 'energy',
firstEntry: 0,
lastEntry: 569,
history:
[ 'noValue',
{ time: 1527009683, setRefTime: 1 },
{ power: 22, time: 1527009683 },
{ power: 21.9, time: 1527010510 },
{ power: 27.3, time: 1527011567 },
{ power: 68, time: 1527012167 },
{ power: 0, time: 1527013284 },
{ power: 0, time: 1527013884 },
{ power: 0, time: 1527014484 },
{ power: 0, time: 1527015084 },
{ power: 0, time: 1527015684 },
{ power: 0, time: 1527016284 },
{ power: 0, time: 1527016884 },
{ power: 0, time: 1527017484 },
{ power: 0, time: 1527018084 },
{ power: 0, time: 1527018684 },
{ power: 0, time: 1527019284 },
{ power: 0, time: 1527019884 },
{ power: 0, time: 1527020484 },
{ power: 0, time: 1527021084 },
{ power: 0, time: 1527021684 },
{ power: 0, time: 1527022284 },
{ power: 0, time: 1527022884 },
{ power: 0, time: 1527023484 },
{ power: 0, time: 1527024084 },
{ power: 0, time: 1527024684 },
{ power: 0, time: 1527025284 },
{ power: 0, time: 1527025884 },
{ power: 0, time: 1527026484 },
{ power: 0, time: 1527027084 },
{ power: 0, time: 1527027684 },
{ power: 0, time: 1527028284 },
{ power: 0, time: 1527028884 },
{ power: 0, time: 1527029484 },
{ power: 0, time: 1527030084 },
{ power: 0, time: 1527030684 },
{ power: 0, time: 1527031284 },
{ power: 0, time: 1527031884 },
{ power: 0, time: 1527032484 },
{ power: 0, time: 1527033084 },
{ power: 0, time: 1527033684 },
{ power: 0, time: 1527034284 },
{ power: 0, time: 1527034884 },
{ power: 0, time: 1527035484 },
{ power: 0, time: 1527036084 },
{ power: 0, time: 1527036684 },
{ power: 0, time: 1527037284 },
{ power: 0, time: 1527037884 },
{ power: 0, time: 1527038484 },
{ power: 0, time: 1527039084 },
{ power: 0, time: 1527039684 },
{ power: 0, time: 1527040284 },
{ power: 0, time: 1527040884 },
{ power: 0, time: 1527041484 },
{ power: 0, time: 1527042084 },
{ power: 0, time: 1527042684 },
{ power: 0, time: 1527043284 },
{ power: 0, time: 1527043884 },
{ power: 0, time: 1527044484 },
{ power: 0, time: 1527045084 },
{ power: 0, time: 1527045684 },
{ power: 0, time: 1527046284 },
{ power: 0, time: 1527046884 },
{ power: 0, time: 1527047484 },
{ power: 0, time: 1527048084 },
{ power: 0, time: 1527048684 },
{ power: 0, time: 1527049284 },
{ power: 0, time: 1527049884 },
{ power: 0, time: 1527050484 },
{ power: 0, time: 1527051084 },
{ power: 0, time: 1527051684 },
{ power: 0, time: 1527052284 },
{ power: 0, time: 1527052884 },
{ power: 0, time: 1527053484 },
{ power: 0, time: 1527054084 },
{ power: 0, time: 1527054684 },
{ power: 0, time: 1527055284 },
{ power: 0, time: 1527055884 },
{ power: 0, time: 1527056484 },
{ power: 0, time: 1527057084 },
{ power: 0, time: 1527057684 },
{ power: 0, time: 1527058284 },
{ power: 0, time: 1527058884 },
{ power: 0, time: 1527059484 },
{ power: 0, time: 1527060084 },
{ power: 0, time: 1527060684 },
{ power: 0, time: 1527061284 },
{ power: 0, time: 1527061884 },
{ power: 0, time: 1527062484 },
{ power: 0, time: 1527063084 },
{ power: 0, time: 1527063684 },
{ power: 0, time: 1527064284 },
{ power: 51.1, time: 1527064884 },
{ power: 51.1, time: 1527065484 },
{ power: 51.1, time: 1527066084 },
{ power: 51.1, time: 1527066684 },
{ power: 51.1, time: 1527067284 },
{ power: 51.1, time: 1527067884 },
{ power: 51.1, time: 1527068484 },
{ power: 51.1, time: 1527069084 },
... 470 more items ],
memorySize: 4032,
usedMemory: 569,
currentEntry: 1,
transfer: false,
setTime: true,
refTime: 548702483,
memoryAddress: 0,
dataStream: '',
saving: false,
initialTime: 1527009683 }
Cheers!
Hi,
Not sure if this the best way to add some of my insights, but this seemed the only way.
I've been following this work for a few days, and I can only tell: great job!
However, I'm not sure that the "signatures" as exposed in characteristic 116 are so magical. I think they are "which data is available for logging".
For Eve Thermo, the "Signature" I have is:
06 0102 1102 1001 1201 1d01 2302
I'm "decoding" this as:
6 different types of data
0102: 01 = Type (Temperature), 02 bytes
1102: 11 = Type (Setpoint Temperature), 02 bytes
1001: 10 = Type (Valve %), 01 byte
1201: 12 = Type (Heating Mode???), 01 byte
1d01: 1d = Type (???), 01 byte
2302: 23 = Type (Battery Voltage???), 02 bytes
Then, on the logging in characteristic 117, the "entry type" is a bit mask:
e.g.: 01 would mean "I'm only reporting the 1st data type now => Temperature (2 bytes)
The Eve Thermo that I was spying on reported a few logs with "entry type" 1f: (0001111) => Temperature (2bytes), Setpoint Temp (2bytes), Valve% (1byte), Heating Mode (1byte), ????(1byte) ==>> total size 7
Newer log entries have "entry type" 3f: (0011111) => same + "battery voltage???"(2 bytes) ==>> total size 9
So, I think that 116 and 117 really work together; and I believe that not each log entry needs to report ALL data (i.e. the logging is dynamic); even though that most data will allways be reported all the time.
I also have spied on an Eve Energy (Firmware 1.2.9):
"Signature" 05 0b02 0c02 0d02 0702 0e01
5 different data types
0b02: ????, 2 bytes
0c02: Volt x 10, 2 bytes
0d02: ????, 2 bytes
0702: Watt x 10 (???), 2 bytes
0e01: On/Off, 1 byte
Extract from the log (117) for this Eve Energy
0b 21590000 b140cc00 10 01
Entry type 10 (binary: 00010000) => I'm only reporting my 5th data point
01 => Switch On (1 byte)
12 22590000 a642cc00 0f 0000 0b09 0000 0000
Entry type 0f (binary: 00001111) => I'm only reporting my first 4 data points
Data Type 0B (???), 2 bytes => 0
Data Type 0C (Volt x 10), 2 bytes => 2315 => 230,5 Volt
Data Type 0D (???), 2 bytes => 0
Data Type 07 (Watt x 10), 2 bytes => 0 => 0 Watt
(with this interpretation, it would seem that fakegato is currently sending "Temperature" (set to 0), "Humidity" (set to 0), "Watt" (filled with correct data) and "Air Quality" (set to 0) for TYPE_ENERGY ... which indicates that they are quite liberal in what they can handle in app)
Hope my contribution helps... regards, Stef
It is possible to insert the fakegato-history code into the accessory https://github.com/KhaosT/HAP-NodeJS/blob/master/accessories/TemperatureSensor_accessory.js ?
Hi,
I'm currently using a homebrdige service on rp3 with homebridge-Xiaomi-plant care plugin.
Works fine, it's working with fakegato-history too.
https://github.com/honkmaster/homebridge-mi-flower-care
But, I would like to display the lastest time on records
Do you have an idea ?
Thanks
Specifying {disableTimer: true}
in the options to the FakeGatoHistory
constructor has a side-effect, causing Eve no longer to display the history. Now the entry is passed by reference to _addEntry()
. When using the timer, the entry is re-constructed using the backlog
, effectively passing the entry by value to _addEntry()
. When the plugin calls addEntry
with new values for the same object (e.g. add.Entry(this.entry)
, all history entries change, because they refer to the same object.
Is it possible to have two FakeGatoHistoryLoggingServices/subtypes in one accessory? e.g. one for temperature/humidity and another one for an alert switch based on door type?
@simont77 Hi all, I had to restart my router, and probably the external IP address changed. From that time fakegato, that was still running on my raspberry, stopped to save the history to google drive. I suppose that it is an authentication related problem. Do you know how can we fix it? Unfortunately on my main installation I have logging disabled, so I don’t know if any error was caught.
NorthernMan54 [12:23 PM]
@simont77 If you restart homebridge does it fix itself? I'm thinking the error handling doesn't handle the forced logout scenario, and authenticate again.
simont77 [12:27 PM]
Yes, restarting homebridge fixes everything, the saved history is correctly reloaded and updated
This should be more a discussion point than a real issue:
I modded a "if cellphone is pingable, person is at home"-homebridge plugin to act as a motion-sensor with EVE compatible history.
Because cellphones are not always connected to the wifi there is a 20minute period where the plugin tries to ping the phone. If it does not answer while these 20minutes, the state of the motion-sensor goes to false. At the same time a history entry is written with the timestamp of the last successful ping, which was 20min ago.
But it seems, that in the meantime fakegato's internal timer writes two filler entries with the - until now - correct values. But chronologically these two filler (with state=true) are after the manually set false-state. This results in a 20minutes long additional true-state after the cellphone last successful ping:
Would it be best to disable the internal timer and let the plugin write it's own 10min-filler states (after a state change back till the pre-last state change) or is this something fakegato should/can handle?
Hi,
I added fakegato-history to my accessory i'm working on with the below:
this.loggingService = new FakeGatoHistoryService("room", this, {
storage:'fs'
});
this.services.push(this.loggingService);
However when the plugin loads in debug mode all I see is:
[2018-3-2 05:29:33] [BlueAir 680i] ** Fakegato-storage AddWriter : undefined
[2018-3-2 05:29:33] [BlueAir 680i] Loading...
[2018-3-2 05:29:33] [BlueAir 680i] ** Fakegato-storage read FS file:
/Users/myles.gray/.homebridge/Myless-MacBook-Pro.local_undefined_persist.json
[2018-3-2 05:29:33] [BlueAir 680i] ** Fakegato-timer Subscription : undefined
[2018-3-2 05:29:33] [BlueAir 680i] Registring Events undefined
[2018-3-2 05:29:33] [BlueAir 680i] Accessory undefined
I have followed the instructions as best I can, I have made sure this.log = log;
is also in the accessory constructor.
Any ideas?
In my setup I have integrated two components with fakegato-history
support:
homebridge-weather
homebridge-dht
Sometimes I have gaps in my history inside the Eve app (see attached screenshot, sorry for the German). My server has been running constantly without errors. The log files are inconspicuous and the components have logged their data well. This is e.g. a log from the time where no history is available:
[2018-2-1 15:14:42] [Wetter] Fetched humidity 86 of type current for Wetter
[2018-2-1 15:14:42] [Wetter] Fetched temperature 4 of type current for Wetter
[2018-2-1 15:15:12] [DHT22] DHT Status: 0, Temperature: 17.6, Humidity: 53
Do you have any idea what causes this issue and how can I help?
Hi,
Any chance you’re able to decode the thermo schedule format? I’ve included the data from your example and it show nice schedules for regular, bathroom and basement. It would be nice to add honeywell evohome’s schedule in there.
Thx!
this is not an issue with fakegato, ... but:
is there a way to force eve to set y-axis min/max?
e.g. for indoor temperature i would like to have the axis starting from 0 instead of something around the min values.
i thought about setting the first values in the json manually to 0, but they would probably get overwritten in the future.... any ideas?
When I use "motion" as the accessoryType I do see my motions in the history graph and in the data log. However, if I use "door", I don't see anything in the graph and if I click on the "..." it's just spinning and not showing any data?
Do someone else see the same issue?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.