Giter Club home page Giter Club logo

homebridge-domotiga's People

Contributors

brefra avatar hiddely avatar samfox2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

homebridge-domotiga's Issues

Startup failed (TypeError: Cannot read property 'on' of undefined)

Hey Samfox2,
using last committed code from Plugin-2.0 branch i run into some problems on startup (see listing below). I did a first review already, but wasn't able to locate the underlying problem.

Please note, that my line numbers differs. I'm preparing some general features (as you requested in your README.md) for getting/setting values via command execution and file interface that are - hopefully - not the underlying problem. ;)

However here is the trace:
[1/19/2017, 9:17:54 PM] [Domotiga] Setting up: TemperatureSensor
/usr/local/lib/node_modules/homebridge-domotiga/index.js:804
.on('get', this.getCurrentAirPressure.bind(this, accessory.context));
^

TypeError: Cannot read property 'on' of undefined
at DomotigaPlatform.setService (/usr/local/lib/node_modules/homebridge-domotiga/index.js:804:13)
at DomotigaPlatform.configureAccessory (/usr/local/lib/node_modules/homebridge-domotiga/index.js:160:10)
at Server._configCachedPlatformAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:342:24)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:83:8)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object. (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)

Static match on numbers not working for me

Hello, first of all thanks for the great job! Furthermore I ran into a problem. On line 169 of index.js you match on the first level of the json data blob for number 37 (if (i == 37) ..). In my installation this should be 38. Better would be to match on the right key instead of the nth number. Same for the level two and three matches. Best, Janno

NPM package one version behind

I've noticed the NPM package repository is missing the latest fixed which are committed into this github repository. Any chance to update the NPM package?

NO issue, just a discussion around the plugin

Hey Samfox2,
im not really familiar with the domotiga backend (and i'm not planning use it) but i have some question (not really an issue, but i didnt found a better way to get in contact or to discuss some things around your plugin).

Sometimes, the plugin uses integer values for device states (0 or 1), sometimes strings (On and Off). Is that a dependency from the domotiga backend? Is there a way to use always integer or boolean values for such states? Would be a bit easier. However, I already implemented that in my fork but before i'll send a larger pull request in some days (or later haha), i would like to ensure compatibility with domotiga backend...

In addition: What do you think about some "build in" sensors for raspberry's temperature, that could be enables with just two single config-line (e.g. {"service":"rpi.sysmonitor","name": "Whatever"}) and could contain some temperature warnings (just implemented that in my fork as well)? I'm using that plugin on a BSD but the command interface is already implemented and it would just be a nice feature... Not sure if the domotiga community needs/whats that...

Cheers,
nordblick

error when starting with new version

Hi,

I've updated homebridge and the homebridge-domotiga to there latest version and created a new config.json.

` {
"bridge": {
"name": "HomebridgePI",
"username": "CC:23:3D:E3:CE:30",
"port": 51826,
"pin": "031-45-156"
},

"description": "DomotiGa HomeKit enabler",

"platforms": [
    {
        "platform": "DomotiGa",
        "name": "DomotiGa",
        "host": "172.16.31.46",
        "port": "9090",
        "devices": [
            {
                "name": "Lamp",
                "service": "Contact",
                "device": "29",
                "valueContact": "1",
          	    "valueBattery": "2",
                "lowbattery": "3000"
            }
        ]
    }
],

"accessories": [ ]

}`

but getting error like this, something to do with:
/usr/lib/node_modules/homebridge-domotiga/index.js:865 .on('get', this.getCurrentAirPressure.bind(this, accessory.context));

[4/28/2017, 10:58:03 AM] Registering platform 'homebridge-domotiga.DomotiGa'
[4/28/2017, 10:58:03 AM] ---
[4/28/2017, 10:58:03 AM] Loaded config.json with 0 accessories and 1 platforms.
[4/28/2017, 10:58:03 AM] ---
[4/28/2017, 10:58:03 AM] Loading 1 platforms...
[4/28/2017, 10:58:03 AM] [DomotiGa] Initializing DomotiGa platform...
[4/28/2017, 10:58:03 AM] [DomotiGa] DomotiGa Plugin Version 0.0.20
[4/28/2017, 10:58:03 AM] [DomotiGa] Plugin by Samfox2 https://github.com/samfox2
[4/28/2017, 10:58:03 AM] [DomotiGa] DomotiGa is a Open Source Home Automation Software for Linux
[4/28/2017, 10:58:03 AM] [DomotiGa] Please report any issues to https://github.com/samfox2/homebridge-domotiga/issues
[4/28/2017, 10:58:03 AM] Loading 0 accessories...
/usr/lib/node_modules/homebridge-domotiga/index.js:865
.on('get', this.getCurrentAirPressure.bind(this, accessory.context));
^

TypeError: Cannot read property 'on' of undefined
at DomotigaPlatform.setService (/usr/lib/node_modules/homebridge-domotiga/index.js:865:17)
at DomotigaPlatform.configureAccessory (/usr/lib/node_modules/homebridge-domotiga/index.js:163:10)
at Server._configCachedPlatformAccessories (/usr/lib/node_modules/homebridge/lib/server.js:342:24)
at Server.run (/usr/lib/node_modules/homebridge/lib/server.js:83:8)
at module.exports (/usr/lib/node_modules/homebridge/lib/cli.js:40:10)
at Object. (/usr/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)

tried other devices as well but alway com back with the error on line 865.

what to do?

ECONNREFUSED

Hi Samfox2,

Not sure how, but I finally managed to sync eve with Domotiga again after upgrading to iOS10 (for some reason it would no longer work).
Only issue now is that I get error messages any time I try to change the state of a switch:

[Kitchen Door] getting SwitchState for Kitchen Door [Kitchen Door] Sorry err: { [Error: connect ECONNREFUSED] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect' } [Kitchen Door] getSwitchOn GetValue failed: connect ECONNREFUSED [Kitchen Window] getting SwitchState for Kitchen Window [Kitchen Window] Sorry err: { [Error: connect ECONNREFUSED] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect' } [Kitchen Window] getSwitchOn GetValue failed: connect ECONNREFUSED [Kitchen Door] Setting SwitchState for 'Kitchen Door' to 1 [Kitchen Door] Sorry err: { [Error: connect ECONNREFUSED] code: 'ECONNREFUSED', errno: 'ECONNREFUSED', syscall: 'connect' } [Kitchen Door] Error setting switch state to 1 on the 'Kitchen Door'

I tried to change 37 to 38 as per [issue #4], to no avail.
Any idea?

Socket hang up

Hi,

When I started homebridge with the pluging everything is ok, but sometime after (2-3 hours) I reveive this error:
[2016-09-26 21:30:18] [ACS] getting Temperature for ACS
[2016-09-26 21:30:18] [ACS] Sorry err: { [Error: socket hang up] code: 'ECONNRESET' }

If I disable and enable the JSON-RPC module in Domotiga, works again...

How can I avoid this?

Thanks

Error communicating with Domotiga

Hi,
I just installed your homebridge plugin and while trying to use the plugin, on my iPhone Homebridge app, I get error saying error communicating. I've made sure the server and port number are correct. Not sure whats going wrong. Can you please help?

Window Covering do not stop at open action

Hi, once I configured a windowcovering, as value2, I have added domotiga events to change value1 to "On" or "Off" (my coverings do not support 1-0 values, are controlled with X10).

This mechanism works ok, but in homekit the button remains at "Openning...". But the close operation works ok.

The log says: "Persiana: successfully set window covering position to 100"

Thanks
Javier

Combined TemperatureService device with valueAirPressure failed

Hey (again),
i tried to configure a combined sensor with a valueAirPressure-Item. Without valueAirPressure it works very well, but adding it results in a "null pointer"-exception (see stack trace below). In sample config file this value is mentioned, so i guess it should work well. Any idea where that error comes from and what i have to change?

accessories and persistent folder were cleared completely (rm /*) before starting homebridge - first start shows no errors but also no data, restarting homebridge results in the error below)

Config file looks like following:

{
	"name": "Gartensensor.",
	"service": "TemperatureSensor",
	"command": "/home/nbo/bin/sensors.json.sh -p $value -f plain",
	"device": "aussensensor",
	"valueTemperature": "T",
	"valueHumidity": "H",
	"valueBattery": "B",
	"valueAirPressure": "P",
	"batteryVoltage": 3.313,
	"batteryVoltageLimit": 3.000,
}

First start after clearing accessories and persistent folder ("getting pressure" part is missing here) :

[2/4/2017, 11:16:09 PM] [dev] Initializing platform accessory 'Gartensensor.'...
[2/4/2017, 11:16:09 PM] [dev] ADD PRESSURE CHARACTERISTICS:  Gartensensor.
[2/4/2017, 11:16:09 PM] [dev] Gartensensor.: getting temperature...
[2/4/2017, 11:16:09 PM] [dev] Gartensensor.: getting relative humidity...
[2/4/2017, 11:16:09 PM] [dev] Gartensensor.: getting battery level...
[2/4/2017, 11:16:09 PM] [dev] Initializing platform accessory 'Dose 1'...

Exception on second start:

/usr/local/lib/node_modules/homebridge-domotiga/index.js:1169
                primaryservice.getCharacteristic(EveAirPressure).getValue();
                                                                ^

TypeError: Cannot read property 'getValue' of undefined
    at DomotigaPlatform.getInitState (/usr/local/lib/node_modules/homebridge-domotiga/index.js:1169:65)
    at DomotigaPlatform.addAccessory (/usr/local/lib/node_modules/homebridge-domotiga/index.js:485:10)
    at DomotigaPlatform.didFinishLaunching (/usr/local/lib/node_modules/homebridge-domotiga/index.js:183:38)
    at emitNone (events.js:86:13)
    at API.emit (events.js:185:7)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:93:13)
    at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:40:10)
    at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
nbo@chaos:/home/nbo/projects/homebridge-domotiga>

Line numbers may differ...

homebridge-domotiga crashes when trying to get humidity

Opening details of a temperature module from the iOS home app homebridge crashes:

[11/1/2016, 11:41:02 PM] [Sensor Slaapkamer] getting CurrentRelativeHumidity for Sensor Slaapkamer
/usr/lib/node_modules/homebridge-domotiga/index.js:247
callback(null, data.result.values[item].value);
^

TypeError: Cannot read property 'value' of undefined
at /usr/lib/node_modules/homebridge-domotiga/index.js:247:56
at /usr/lib/node_modules/homebridge-domotiga/node_modules/jsonrequest/lib/index.js:57:9
at opt_callback (/usr/lib/node_modules/homebridge-domotiga/node_modules/tinyreq/lib/index.js:53:9)
at IncomingMessage. (/usr/lib/node_modules/homebridge-domotiga/node_modules/tinyreq/lib/index.js:85:13)
at emitNone (events.js:91:20)
at IncomingMessage.emit (events.js:185:7)
at endReadableNT (_stream_readable.js:974:12)
at _combinedTickCallback (internal/process/next_tick.js:74:11)
at process._tickCallback (internal/process/next_tick.js:98:9)

Error after upgrade to 2.0

Hello, after upgrade to the new 2.0 i get the following error message:

[2017-02-11 21:38:49] ERROR LOADING PLUGIN homebridge-domotiga:
[2017-02-11 21:38:49] SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode

2017-02-11 21:38:49] No plugins found. See the README for information on installing plugins.
[2017-02-11 21:38:49] Loaded config.json with 0 accessories and 1 platforms.
[2017-02-11 21:38:49] ---
[2017-02-11 21:38:49] Loading 1 platforms...
/usr/local/lib/node_modules/homebridge/lib/api.js:118
throw new Error("The requested platform '" + name + "' was not registered by any plugin.");
^

Error: The requested platform 'Domotiga' was not registered by any plugin.

Keep sync with iOS devices

Hi Samfox,

I have installed the plugin and works ok, I can send commands from iOS to Domotiga. And when home app starts, the status of the devices is updated. But if I change the state in Domotiga, home app doesn't update...

Is there some way to solve this?

Thanks!

Doors and windows control

Hi Sandfox,
thanks to homebridge-domotiga, I am controlling from homekit doors and windows (blinds), but as "switch" devices. So speaking with Siri I have to use the sentence "Switch on the door" or "Switch off the window", which is quite strange.

How can these devices managed as doors and windows in order to enable the right instructions for Siri?

Thanks in advance

Changes in config file will not always be applied

If i change the config file, changed settings will not (always?) applied (homebridge was restarted). Removing .persistant and .accessories folder helps, but will also break already integrated clients.

Cannot read property 'toLowerCase' of undefined

Hi

Been using this plugin for a few weeks now, which is great by the way. Yesterday I added a couple of contact sensors to domotiga which are actually home easy contact sensors interfaced to domotiga through an rfxcom device. I can see them updating in domotiga but when I include them in my config.json I get the following error in homebridge.err Any thoughts gratefully received. Thanks

/usr/lib/node_modules/homebridge-domotiga/index.js:1463
var value = (result.toLowerCase() == "on") ? Characteristic.ContactSensorState.CONTACT_DET$
^

TypeError: Cannot read property 'toLowerCase' of undefined
at /usr/lib/node_modules/homebridge-domotiga/index.js:1463:33
at /usr/lib/node_modules/homebridge-domotiga/index.js:2518:25
at maybeCallback (/usr/lib/node_modules/homebridge-domotiga/node_modules/jsonrequest/lib/index.js:$
at Function. (/usr/lib/node_modules/homebridge-domotiga/node_modules/tinyreq/lib/index.$
at res (/usr/lib/node_modules/homebridge-domotiga/node_modules/assured/lib/index.js:27:12)
at IncomingMessage. (/usr/lib/node_modules/homebridge-domotiga/node_modules/tinyreq/lib$
at IncomingMessage.emit (events.js:193:15)
at endReadableNT (_stream_readable.js:1129:12)
at process.internalTickCallback (internal/process/next_tick.js:72:19)

Flipped condition

Line 1533:

var value = (Number(result) == 0) ? 1 : 0;

Should that not be
var value = (Number(result) == 0) ? 0 : 1;

Number of mapped devices : undefined

The message will print out on right after start. I guess, it should not be "undefined", but i was not able to track that down to the underlying reason (i need some more time with 2.0 code ;))

Message comes from line 192 - could be more or less (due to some local changes on my side)

Historic energy data

Hi @Samfox2,

did you get anywhere with your historic data for energy usage? I really want to implement it into my homebridge-efergy plugin.

Service.Lightbulb support

I currently have a setup with a Velbus VMBDMI module which I use to dim my lights.
I'm using a Switch type for this device with valueSwitch set to value 1 in my homebridge configuration file.

I'm not able to dim my lights because the values of a Switch can only be On or Off. I can see the following values for my device in Domotiga (value1):

  • Off (when light is turned off)
  • On (when light is turned on)
  • Dim 75 (when dimming percentage is set to 75 with Homecenter)

I think it would be useful to add support for Service.Lightbulb which has an optional characteristic Characteristic.Brightness.

Let me know if I can help you out with this.

Dimming

Samfox2. First of all I want to thank you for the great job you did. I was wondering if you could add the dimming function if you find some time. Thank you.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.