-
-
Notifications
You must be signed in to change notification settings - Fork 45
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added support for the Shelly1AddOn #336
base: master
Are you sure you want to change the base?
Conversation
package.json
Outdated
@@ -37,7 +37,7 @@ | |||
"colors": "^1.4.0", | |||
"command-line-commands": "^3.0.2", | |||
"express": "^4.17.1", | |||
"shellies": "^1.6.0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be changed whenever shellies has been updated.
@@ -427,6 +433,30 @@ module.exports = homebridge => { | |||
get numberOfPowerMeters() { | |||
return 0 | |||
} | |||
|
|||
get numberOfAccessories() { | |||
if (this.config.type === 'thermostat') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately I can't find out without the settings how many sensors are connected at only the device state. Maybe it's also useful for other accessories to have the config inside the factory. Is there a better way?
80fd971
to
2b9a1a9
Compare
@@ -1,6 +1,6 @@ | |||
/* eslint-env mocha */ | |||
|
|||
const shellies = require('shellies') | |||
const shellies = require('@tritter/shellies') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be reverted
I've currently tested it with 1 temperature sensor and it seems to work great beside that it ignoring the |
Just for reference (since it seems like this library have been abounded), I'm attaching the PR that fixes the forcing of enabling heating/cooling and set the default behavior to act like a read-only temperature sensor (yet giving the option to use it as a real thermostat). |
As many and myself would like to have a thermostat I created one based on the shelly actions therefore the MR of alexryd/node-shellies#30 required.
To install and test, (you may need to re-add your shelly):
sudo npm i -g @tritter/homebridge-shelly
Shelly 1AddOn configurations
Applies to Shelly 1, 1PM
"sensors"
- 1-3, number of sensors connected to the addon. (default:1 , max: 3)"type"
- when the relais should act like a thermostat set the type to"thermostat"
"humidity"
- false, shows humitidy (only applicable to one sensor)"heating"
- true|false, enable heating on the thermostat. (default: true)"cooling"
- true|false, enable cooling on the thermostat. (default: false)"hysteresis"
- Sets a hysteresis at which difference the thermostat should switch on/off. (default: 0.5)