Skip to content
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

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open

Conversation

tritter
Copy link

@tritter tritter commented Sep 3, 2021

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)

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"
Copy link
Author

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') {
Copy link
Author

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?

@tritter tritter force-pushed the master branch 4 times, most recently from 80fd971 to 2b9a1a9 Compare June 17, 2022 09:15
@@ -1,6 +1,6 @@
/* eslint-env mocha */

const shellies = require('shellies')
const shellies = require('@tritter/shellies')
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs to be reverted

@Idomo
Copy link

Idomo commented Dec 10, 2022

I've currently tested it with 1 temperature sensor and it seems to work great beside that it ignoring the "heating" and the "cooling" settings; even tho they are both set to false, I still have the option to set the temperature and turn it on/off like its a real thermostat.
I've seen that with mongoose-os-apps/shelly-homekit it shows the temperature as a single value like you get with humidity sensors (that you can't set the value).

@Idomo
Copy link

Idomo commented Dec 12, 2022

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).
tritter/homebridge-shelly#1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants