samfox2 / homebridge-domotiga Goto Github PK
View Code? Open in Web Editor NEWSupports domotiga devices on HomeBridge Platform
License: Apache License 2.0
Supports domotiga devices on HomeBridge Platform
License: Apache License 2.0
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)
I am only receiving on a single iOS device the other two never receive it
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
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?
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
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?
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?
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
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?
Hi, Recently installed this and when I restart homebridge I get the above error. I've tried changing config.json but still getting the same error. Interestingly when I remove the config.json entries I can see the domotiga plugin loading.
Any thoughts please?
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
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...
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)
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.
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!
Looks like a great plugin. Would love to try it, but there doesn't seem to support for the shutters i'm using (http://qubino.com/products/flush-shutter-dc/ ). Any plans for adding support for this?
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
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.
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)
Line 1533:
var value = (Number(result) == 0) ? 1 : 0;
Should that not be
var value = (Number(result) == 0) ? 0 : 1;
Line 760:
primaryservice = accessory.getService(Service.MotionkSensor);
should be
primaryservice = accessory.getService(Service.MotionSensor);
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)
Hi @Samfox2,
did you get anywhere with your historic data for energy usage? I really want to implement it into my homebridge-efergy plugin.
Hey,
while testing I found following quite strange line:
var value = (Number(result) == 0) ? 1 : 0;
Is that correct? I would expect that detected motion will be represented by a 1 and not by an 0.
Suggestion:
var value = (Number(result) == 0) ? 0 : 1;
Line 1549 in 4cbdff6
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):
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.