Skip to content
This repository has been archived by the owner on Apr 20, 2021. It is now read-only.

First tries #7

Closed
ygageot opened this issue Feb 17, 2016 · 13 comments
Closed

First tries #7

ygageot opened this issue Feb 17, 2016 · 13 comments

Comments

@ygageot
Copy link
Contributor

ygageot commented Feb 17, 2016

Hello,
I just start to try your plugin and I have some troubles with version 3.35
I cannot load thermometers with
{
"id": 0,
"name": "Sejour",
"channel": 1,
"model": 0,
"te": 22.8,
"hu": 44,
"te+": 22.9,
"te+t": "00:01",
"te-": 21.8,
"te-t": "04:18",
"hu+": 44,
"hu+t": "12:30",
"hu-": 39,
"hu-t": "06:56",
"outside": "no",
"favorite": "no"
},

I cannot load kakusensors of smoke type
{
"id": 0,
"name": "Fumees Garage",
"status": null,
"type": "smoke",
"favorite": "no",
"timestamp": "00:00",
"cameraid": 0
},

I cannot load HUE lights
{
"id": 4,
"name": "Bureau",
"type": "hue",
"status": "off",
"hue_id": 0,
"light_id": 3,
"color": {
"hue": 254,
"sat": 83,
"bri": 58
},
"favorite": "no"
},

Thanks for your help

@rthewhite
Copy link
Owner

Hi,
The Hue lights and kakusensor smoke type is correct, i don't have support build in for them currently.

For the thermometer i don't know why it's not working there should be support for it. Don't know if the interface of the thermometer is the same as mine, will need to check when i get home.

@ygageot
Copy link
Contributor Author

ygageot commented Feb 18, 2016

Thanks for your help,

This one works :
{
"id": 4,
"name": "Exterieur",
"code": "4643669",
"model": 1,
"lowBattery": "no",
"version": 2.32,
"te": 10.2,
"hu": 49,
"te+": 10.2,
"te+t": "14:05",
"te-": -0.4,
"te-t": "07:10",
"hu+": 80,
"hu+t": "05:11",
"hu-": 48,
"hu-t": "13:53",
"outside": "yes",
"favorite": "no"
}
It is an outside thermometer via Smartware weatherstation.

This one doesn't
{
"id": 0,
"name": "Sejour",
"channel": 1,
"model": 0,
"te": 22.8,
"hu": 44,
"te+": 22.9,
"te+t": "00:01",
"te-": 21.8,
"te-t": "04:18",
"hu+": 44,
"hu+t": "12:30",
"hu-": 39,
"hu-t": "06:56",
"outside": "no",
"favorite": "no"
},
It is a direct thermometer.

@ygageot
Copy link
Contributor Author

ygageot commented Feb 18, 2016

Sorry, it is MY problem.
I added console.error(error.stack); in the last catch in platform.js and I understood.
I had several devices with the same name (rolling shutter, temp sensor, switch) in the same room with the name of the room...
I changed the names in HW unfortunately limited at 15c !!
It is better !!
I continue to explore

@rthewhite
Copy link
Owner

No problem at all, good that you found the problem! Indeed sadly enough the HW is limited to a 15 characters name for devices.

Btw maybe this can help you out with your HUE lights?
https://www.npmjs.com/package/homebridge-philipshue

For the smoke detection, i don't have one to test with and develop. Might be able to find the interface on the internet and implement it. So you can test it, need to build in some other functionality then as well. Currently the values in Homekit only get updated when you request the data in an app. Need to build in functionality to push changes to homebridge then, as requested in this issue: #5

Will give the plugin some love this weekend and try to sort this out 👍

@ygageot
Copy link
Contributor Author

ygageot commented Feb 19, 2016

I have in my HW configuration also Hue, Radiator and Somfy switches. After one week I will have time to try to add these devices !

@rthewhite
Copy link
Owner

Ok cool, let me know if you need help implementing them 👍

@ygageot
Copy link
Contributor Author

ygageot commented Feb 21, 2016

I founded some time to test new functions.
First I added Somfy and Hue switches directly in the JS source and it works.
Second I cloned your repository and I added Somfy support in ES2 (one new class+accessories impact) but I don't know how to run it with Homebridge to test it.
Thanks for your help

@ygageot
Copy link
Contributor Author

ygageot commented Feb 21, 2016

In my HW configuration I have switches : classic, radiator, hue lights and somfy, thermometers, kakusensors : motion and smoke, wind meter, rain meter, weather display, scenes and 1 camera. Geofencing active. Retired, I have some time to add additional devices.
Thanks.

@rthewhite
Copy link
Owner

Cool! Testing is relatively simple, make sure you have NodeJS installed on your development machine.

First thing is you need to be able to transpile the ES6 to JS node can understand, run

npm install 

When your standing in the checkt out repository and it will install all needed dependencies for development. Then you should be able to do:

grunt dev

This starts a watching process and as soon as you change some ES6 code it will transpile it and run the unit tests. To test your code install homebridge and setup a config, then in the repository folder of this plugin run:

npm link

What this does is that if any NodeJS project (homebridge) requires this plugin take it from this location instead of installing it from NPM. Now you can run homebridge on your development machine and it should pick up your local plugin 👍 Only thing is if you make a change, you will have to restart homebridge to pick it up.

Implementing things you are limited to what Homebridge supports, it uses underwater the library HAP-NodeJS. Here you can find a list of all characteristics it support: https://github.com/KhaosT/HAP-NodeJS/blob/master/lib/gen/HomeKitTypes.js

Good luck and thanks for your help!

@ygageot
Copy link
Contributor Author

ygageot commented Feb 22, 2016

Thanks for the help. It works.
I create a local branch with a first commit about somfy shutters. I tried to publish it in your repository without success. Probably a permission issue. Can you help me once more ?

@rthewhite
Copy link
Owner

Sure, since this is my repository i am the only one that has access to push changes, branches etc directly to it.

How it works on Github when someone wants to contribute to a repository is that you fork the project (see the button at the top right of the page). This will create a copy of the project under your own name which then can checkout, create branches, publish them etc. Once you are done and want to submit your work back to my repo, you publish the branch to your repository and then you will have the option to create a pull request.

When you open a pull request, i can review the changes and merge them into my repository 👍

Since you already made your changes, you can take the more difficult route of forking, checking out and re-apply/copy your changes from the current checkt out project. Or if your more familiar with Git, remove your current origin and add your forked repository as the new origin 👍

@ygageot
Copy link
Contributor Author

ygageot commented Feb 23, 2016

Thanks, I tried with the master branch

@rthewhite
Copy link
Owner

Think we can close this one, since your fully up-to-speed and doing great work 👍

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

No branches or pull requests

2 participants