simont77 / fakegato-history

Module to emulate Elgato Eve history
MIT License
167 stars 15 forks source link

Can only see "undefined" when passing 'this' as an Accessory. #47

Closed mylesagray closed 6 years ago

mylesagray commented 6 years ago

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?

ebaauw commented 6 years ago

Fakegato expects a this.displayName.

simont77 commented 6 years ago

you probably don’t have displayName properties in your accessory

mylesagray commented 6 years ago

Thanks guys, that appears to be working now and displaying history for Temp and Humidity, however Air Quality is showing no data in measurements or the graph - debug output showing as expected however - passing particulate data in ppm:

[2018-3-2 13:18:21] [BlueAir 680i] **Fakegato-timer: addData  BlueAir 680i { time: 1519996701,
  temp: 20.464,
  humidity: 29.698,
  ppm: 6.686035 }  immediate:  false
simont77 commented 6 years ago

Did you add the custom characteristic E863F10B for ppm?

mylesagray commented 6 years ago

I didn't, but I don't see that in the docs anywhere?

simont77 commented 6 years ago

"Your plugin should expose the corresponding custom Elgato services and characteristics in order for the history to be seen in Eve.app." :-) Have a look at the characteristics list in the wiki.

mylesagray commented 6 years ago

Excellent, sorry about that @simont77 - I've implemented it now and working as expected, are you opposed to me doing some documentation revisions to try and make it easier to follow for outsiders and non-programmers (like me) and issuing a PR?

simont77 commented 6 years ago

No problem at all, any help is appreciated