maxnowack / homebridge-eq3ble

Homebridge plugin to control EQ3 bluetooth thermostats
GNU General Public License v3.0
21 stars 8 forks source link

support of external temperature sensor via mqtt and fix error on connection timeout #5

Closed aleksandrsivanovs closed 7 years ago

aleksandrsivanovs commented 7 years ago

Hi!

I would like to propose more improvements to this awesome plugin :) I've noticed that the current temperature characteristic in current version has stub implementation - i.e. it just puts there the target temperature. I was thinking of some general way to submitting the current temperature in this thermostat to the homebridge and decided to go with mqtt-submitted values.

so, this PR contains changes which detect if configuration have additional subsconfiguration of current temperature and if yes - then connects and subscribes to configurable topic to get current temperature from there.

new configuration section is:

{
  "accessory": "EQ3-Thermostat",
  ...
  "currentTemperature": {
    "url": "mqtt://localhost",
    "topic": "/home/sensors/16156/temperature",
    "username": "sensors",
    "password": "GimmeSensorsYo!"
  }
}

if this additional section is not specified - then the plugin works as it was working before.

Additionally, I've fixed small issue which resulted in error in homebridge logs - in case of thermostat connection timeout the isError is passed inside arguments and not as field of the object.

maxnowack commented 7 years ago

Wow @aleksandrsivanovs, you're awesome! I've left some change requests. It would be great if you can also update the readme, that it's clear how to use the feature.

aleksandrsivanovs commented 7 years ago

please review again - fixed the unhandled promise rejection + added README.md section

maxnowack commented 7 years ago

merged! 👍 I'll release it later this day.

aleksandrsivanovs commented 7 years ago

@maxnowack please release :)

maxnowack commented 7 years ago

@aleksandrsivanovs sorry! I totally forgot this. It's now released as v1.3.0

aleksandrsivanovs commented 7 years ago

mhm, interesting it's 1.3.0 on npmjs.com, however, in git repo 1.3.0 is not tagged. I'm not very familiar how npmjs and github work together - but seeems strange :) thanks :)

maxnowack commented 7 years ago

Sorry, I've forgot to create a release on github. Now it's done: https://github.com/maxnowack/homebridge-eq3ble/releases/tag/v1.3.0