Page 24 of 86
Re: eDomoticz Homebridge-Plugin
Posted: Tuesday 09 August 2016 14:40
by TheRamon
Coolio! Any thoughts on when to release this update? I mean we could always add more sensors with time.

Re: eDomoticz Homebridge-Plugin
Posted: Tuesday 09 August 2016 15:16
by Marci
At the moment the issue is that unsupported switch types get forced into being an On/Off switch on the first MQTT update of that device - essentially we just need to make sure that every switch type possible is supported. Sensors are covered in the empty 'else' so shouldn't cause any problems (for now).
I'll check it all out tonight when I get home and report back...
Re: eDomoticz Homebridge-Plugin
Posted: Tuesday 09 August 2016 15:52
by TheRamon
Whoops! Wanted to look into that issue. Completely forgot. It is because I had changed the if condition of 'getServices'. With the old statement the 'Fan' type switches would never show up as fan, but as a Switch. Not because of the word "Fan" not appearing in the name, but because the default of 'Sensor' (else clause) is also a 'Switch'.
Details in GitHub.
I have fixed the issue and am creating a pull request now.
Re: eDomoticz Homebridge-Plugin
Posted: Tuesday 09 August 2016 23:34
by Marci
There were still some devices being broken - have just applied some ugly workarounds for now - feel free to improve if you’re able, but, that all seems to be working now without destroying any of my plethora of sensors
Excellent work fella! As it stands, we’re definitely at ReleaseCandidate stage...
https://github.com/PatchworkBoy/homebri ... /issues/29
EDIT: just noticed, the refactoring has improved/reduced memory usage also... *applause*
Will give it some thorough testing between now and the weekend and see if anything unexpected crops up... then we can think about Release!
For reference, just so you’ve an idea of my “test” setup, here’s a full sweep of all accessories from Homebridge:
- Spoiler: show
Code: Select all
[Tue Aug 09 2016 22:31:36 GMT+0100 (BST)] [eDomoticz] Data Received for Household Gas: 0.0 Watt
[Tue Aug 09 2016 22:31:37 GMT+0100 (BST)] [eDomoticz] Data Received for Amp Background Volume: 0
[Tue Aug 09 2016 22:31:37 GMT+0100 (BST)] [eDomoticz] Data Received for Amp Mute: 0
[Tue Aug 09 2016 22:31:37 GMT+0100 (BST)] [eDomoticz] Data Received for Amp Vol Normal: 0
[Tue Aug 09 2016 22:31:38 GMT+0100 (BST)] [eDomoticz] Data Received for Barometer: 12.5
[Tue Aug 09 2016 22:31:38 GMT+0100 (BST)] [eDomoticz] Data Received for Barometer: 80
[Tue Aug 09 2016 22:31:38 GMT+0100 (BST)] [eDomoticz] Data Received for Barometer: 1024hPa
[Tue Aug 09 2016 22:31:39 GMT+0100 (BST)] [eDomoticz] Data Received for AppleTV: 0
[Tue Aug 09 2016 22:31:40 GMT+0100 (BST)] [eDomoticz] Data Received for Amp: 1
[Tue Aug 09 2016 22:32:16 GMT+0100 (BST)] [eDomoticz] Data Received for Kitchen Occupied: 0
[Tue Aug 09 2016 22:32:16 GMT+0100 (BST)] [eDomoticz] Data Received for Node1 /boot: 36.73%
[Tue Aug 09 2016 22:32:17 GMT+0100 (BST)] [eDomoticz] Data Received for Bedroom Occupied: 0
[Tue Aug 09 2016 22:32:17 GMT+0100 (BST)] [eDomoticz] Data Received for Node1: 48.7
[Tue Aug 09 2016 22:32:17 GMT+0100 (BST)] [eDomoticz] Data Received for My light: 1
[Tue Aug 09 2016 22:32:17 GMT+0100 (BST)] [eDomoticz] Data Received for Temperature (LR3): 20.6
[Tue Aug 09 2016 22:32:18 GMT+0100 (BST)] [eDomoticz] Data Received for Node3: 44.4
[Tue Aug 09 2016 22:32:18 GMT+0100 (BST)] [eDomoticz] Data Received for RasPi3: 0
[Tue Aug 09 2016 22:32:18 GMT+0100 (BST)] [eDomoticz] Static Data for Upper Setpoint: 1
[Tue Aug 09 2016 22:32:18 GMT+0100 (BST)] [eDomoticz] Data Received for Upper Setpoint: 15
[Tue Aug 09 2016 22:32:18 GMT+0100 (BST)] [eDomoticz] Static Data for Upper Setpoint: 1
[Tue Aug 09 2016 22:32:18 GMT+0100 (BST)] [eDomoticz] Data Received for Upper Setpoint: 15
[Tue Aug 09 2016 22:32:18 GMT+0100 (BST)] [eDomoticz] Data Received for Node2: 49.4
[Tue Aug 09 2016 22:32:19 GMT+0100 (BST)] [eDomoticz] Data Received for Shed Motion: false
[Tue Aug 09 2016 22:32:19 GMT+0100 (BST)] [eDomoticz] Data Received for Fan: 0
[Tue Aug 09 2016 22:32:19 GMT+0100 (BST)] [eDomoticz] Data Received for Node1 Mem: 61.70%
[Tue Aug 09 2016 22:32:19 GMT+0100 (BST)] [eDomoticz] Data Received for Living Room Lamp: 0
[Tue Aug 09 2016 22:32:19 GMT+0100 (BST)] [eDomoticz] Data Received for Gas Usage: 9186.730
[Tue Aug 09 2016 22:32:19 GMT+0100 (BST)] [eDomoticz] Data Received for Living Room Occupied: 1
[Tue Aug 09 2016 22:32:20 GMT+0100 (BST)] [eDomoticz] Data Received for Node3 /boot: 31.02%
[Tue Aug 09 2016 22:32:20 GMT+0100 (BST)] [eDomoticz] Data Received for Router: 1
[Tue Aug 09 2016 22:32:20 GMT+0100 (BST)] [eDomoticz] Data Received for Household Power: 270.0 Watt
[Tue Aug 09 2016 22:32:20 GMT+0100 (BST)] [eDomoticz] Data Received for Temperature (Outdoor Shade): 17.1
[Tue Aug 09 2016 22:32:20 GMT+0100 (BST)] [eDomoticz] Data Received for Node1 CPU: 20.39%
[Tue Aug 09 2016 22:32:20 GMT+0100 (BST)] [eDomoticz] Data Received for Shed Light: 0
[Tue Aug 09 2016 22:32:21 GMT+0100 (BST)] [eDomoticz] Data Received for Barometer: 12.5
[Tue Aug 09 2016 22:32:21 GMT+0100 (BST)] [eDomoticz] Data Received for Barometer: 80
[Tue Aug 09 2016 22:32:21 GMT+0100 (BST)] [eDomoticz] Data Received for Barometer: 1024hPa
[Tue Aug 09 2016 22:32:21 GMT+0100 (BST)] [eDomoticz] Data Received for Raspir: 0
[Tue Aug 09 2016 22:32:21 GMT+0100 (BST)] [eDomoticz] Data Received for Temperature (Shed): 17.3
[Tue Aug 09 2016 22:32:21 GMT+0100 (BST)] [eDomoticz] Data Received for Helens Light: 1
[Tue Aug 09 2016 22:32:22 GMT+0100 (BST)] [eDomoticz] Data Received for Temperature (Kitchen): 18.6
[Tue Aug 09 2016 22:32:22 GMT+0100 (BST)] [eDomoticz] Data Received for Marci Presence: 1
[Tue Aug 09 2016 22:32:22 GMT+0100 (BST)] [eDomoticz] Data Received for Amp Vol Normal: 0
[Tue Aug 09 2016 22:32:22 GMT+0100 (BST)] [eDomoticz] Data Received for Node2 CPU: 2.39%
[Tue Aug 09 2016 22:32:22 GMT+0100 (BST)] [eDomoticz] Data Received for TV: 1
[Tue Aug 09 2016 22:32:22 GMT+0100 (BST)] [eDomoticz] Data Received for Shed Heater: 0
[Tue Aug 09 2016 22:32:23 GMT+0100 (BST)] [eDomoticz] Data Received for House Occupied: 1
[Tue Aug 09 2016 22:32:23 GMT+0100 (BST)] [eDomoticz] Data Received for PondCam Reset: 1
[Tue Aug 09 2016 22:32:23 GMT+0100 (BST)] [eDomoticz] Data Received for Amp Background Volume: 0
[Tue Aug 09 2016 22:32:23 GMT+0100 (BST)] [eDomoticz] Data Received for Amp Mute: 0
[Tue Aug 09 2016 22:32:23 GMT+0100 (BST)] [eDomoticz] Data Received for Node3 Mem: 55.74%
[Tue Aug 09 2016 22:32:23 GMT+0100 (BST)] [eDomoticz] Data Received for Node2 Mem: 29.28%
[Tue Aug 09 2016 22:32:23 GMT+0100 (BST)] [eDomoticz] Data Received for Node1 /: 57.58%
[Tue Aug 09 2016 22:32:24 GMT+0100 (BST)] [eDomoticz] Data Received for Rainfall: 0.8mm
[Tue Aug 09 2016 22:32:24 GMT+0100 (BST)] [eDomoticz] Data Received for Node2 /boot: 32.01%
[Tue Aug 09 2016 22:32:24 GMT+0100 (BST)] [eDomoticz] Data Received for Household Gas: 0.0 Watt
[Tue Aug 09 2016 22:32:24 GMT+0100 (BST)] [eDomoticz] Data Received for Household Gas: 0.075 kWh
[Tue Aug 09 2016 22:32:24 GMT+0100 (BST)] [eDomoticz] Data Received for Household Gas: 0.0 Watt
[Tue Aug 09 2016 22:32:25 GMT+0100 (BST)] [eDomoticz] Data Received for TV Vol Normal: 0
[Tue Aug 09 2016 22:32:25 GMT+0100 (BST)] [eDomoticz] Data Received for Visibility: 10.0 mi
[Tue Aug 09 2016 22:32:25 GMT+0100 (BST)] [eDomoticz] Data Received for Temperature (Living Room): 19.6
[Tue Aug 09 2016 22:32:25 GMT+0100 (BST)] [eDomoticz] Data Received for TV Vol Bgrnd: 0
[Tue Aug 09 2016 22:32:26 GMT+0100 (BST)] [eDomoticz] Data Received for AppleTV: 0
[Tue Aug 09 2016 22:32:26 GMT+0100 (BST)] [eDomoticz] Data Received for Temperature (Bedroom): 18.5
[Tue Aug 09 2016 22:32:26 GMT+0100 (BST)] [eDomoticz] Data Received for Node3 /: 35.17%
[Tue Aug 09 2016 22:32:26 GMT+0100 (BST)] [eDomoticz] Data Received for Solar Radiation: 1
[Tue Aug 09 2016 22:32:27 GMT+0100 (BST)] [eDomoticz] Data Received for Hx Presence: 1
[Tue Aug 09 2016 22:32:27 GMT+0100 (BST)] [eDomoticz] Data Received for Wind: 12.5
[Tue Aug 09 2016 22:32:27 GMT+0100 (BST)] [eDomoticz] Data Received for Wind: 1.4
[Tue Aug 09 2016 22:32:27 GMT+0100 (BST)] [eDomoticz] Data Received for Wind: 360 (N)
[Tue Aug 09 2016 22:32:27 GMT+0100 (BST)] [eDomoticz] Data Received for Wind: 12.5
[Tue Aug 09 2016 22:32:28 GMT+0100 (BST)] [eDomoticz] Data Received for Tylers Light: 0
[Tue Aug 09 2016 22:32:28 GMT+0100 (BST)] [eDomoticz] Data Received for Node3 CPU: 1.00%
[Tue Aug 09 2016 22:32:28 GMT+0100 (BST)] [eDomoticz] Data Received for Amp: 1
[Tue Aug 09 2016 22:32:28 GMT+0100 (BST)] [eDomoticz] Data Received for Node2 /: 22.85%
[Tue Aug 09 2016 22:32:28 GMT+0100 (BST)] [eDomoticz] Data Received for Central Heating: 0
[Tue Aug 09 2016 22:32:29 GMT+0100 (BST)] [eDomoticz] Data Received for Shed Router: 1
[Tue Aug 09 2016 22:32:29 GMT+0100 (BST)] [eDomoticz] Static Data for Lower Setpoint: 1
[Tue Aug 09 2016 22:32:29 GMT+0100 (BST)] [eDomoticz] Data Received for Lower Setpoint: 13
[Tue Aug 09 2016 22:32:29 GMT+0100 (BST)] [eDomoticz] Static Data for Lower Setpoint: 1
[Tue Aug 09 2016 22:32:29 GMT+0100 (BST)] [eDomoticz] Data Received for Lower Setpoint: 13
[Tue Aug 09 2016 22:32:29 GMT+0100 (BST)] [eDomoticz] Data Received for Pond Motion: false
..and I’ve attached my full Domoticz JSON Devices output (cos it’s over the max post length on here)
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 9:36
by TheRamon
My goodie, that's a vast list you have there.
Good to hear memory usage has improved. We should probably remove the logging of MQTT messages too, easy win there.
So basically, anyone that wants to help testing this is free to try:
Clone the repo in your node_modules directory that contains the plugin.
(usually /usr/lib/node_modules or /usr/local/lib/node_modules/)
Code: Select all
$ git clone -b mqtt-integration https://github.com/PatchworkBoy/homebridge-eDomoticz.git
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 13:18
by Marci
(and refer to last post at
https://github.com/PatchworkBoy/homebri ... /issues/29 for setting up MQTT in Domoticz etc)
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 21:40
by deejc
followed all the instructions and i get below error and my Home app doesn't update in real time
Code: Select all
8/10/2016, 8:38:58 PM] ====================
[8/10/2016, 8:38:58 PM] ERROR LOADING PLUGIN homebridge-eDomoticz:
[8/10/2016, 8:38:58 PM] Error: Cannot find module 'request'
at Function.Module._resolveFilename (module.js:440:15)
at Function.Module._load (module.js:388:25)
at Module.require (module.js:468:17)
at require (internal/module.js:20:19)
at Object.<anonymous> (/usr/local/lib/node_modules/homebridge-eDomoticz/index.js:43:15)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
at Module.load (module.js:458:32)
at tryModuleLoad (module.js:417:12)
at Function.Module._load (module.js:409:3)
[8/10/2016, 8:38:58 PM] ====================
[8/10/2016, 8:39:00 PM] Loaded plugin: homebridge-edomoticz
i notice that the git clone command has a capital D in eDomoticz but my usual plugin node folder is all lower case
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 21:44
by Marci
2 options...
Copy contents of new folder over old folder, delete new folder... assuming you're in your node_modules folder:
Code: Select all
sudo cp -R homebridge-eDomoticz/* homebridge-edomoticz/
sudo rm -rf homebridge-eDomoticz
OR...
Remove old folder from your node_modules folder:
Then navigate into your homebridge-eDomoticz folder and run...
...and it should then pull in the dependencies. Once done, restart homebridge.
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 21:51
by deejc
won't start at all now.
Code: Select all
8/10/2016, 8:50:28 PM] Loaded plugin: homebridge-eDomoticz
[8/10/2016, 8:50:28 PM] Registering accessory 'homebridge-edomoticz.eDomoticz'
[8/10/2016, 8:50:28 PM] Registering platform 'homebridge-edomoticz.eDomoticz'
[8/10/2016, 8:50:28 PM] ---
[8/10/2016, 8:50:30 PM] Loaded plugin: homebridge-edomoticz
/usr/local/lib/node_modules/homebridge/lib/api.js:76
throw new Error("Attempting to register an accessory '" + fullName + "' which has already been registered!");
^
Error: Attempting to register an accessory 'homebridge-edomoticz.eDomoticz' which has already been registered!
at API.registerAccessory (/usr/local/lib/node_modules/homebridge/lib/api.js:76:11)
at Plugin.module.exports [as initializer] (/usr/local/lib/node_modules/homebridge-edomoticz/index.js:67:16)
at Server.<anonymous> (/usr/local/lib/node_modules/homebridge/lib/server.js:130:14)
at Array.forEach (native)
at Server._loadPlugins (/usr/local/lib/node_modules/homebridge/lib/server.js:108:22)
at new Server (/usr/local/lib/node_modules/homebridge/lib/server.js:43:24)
at module.exports (/usr/local/lib/node_modules/homebridge/lib/cli.js:26:16)
at Object.<anonymous> (/usr/local/lib/node_modules/homebridge/bin/homebridge:17:22)
at Module._compile (module.js:541:32)
at Object.Module._extensions..js (module.js:550:10)
error: Forever detected script exited with code: 1
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 21:53
by Marci
See edits above - you still have 2x plugin folders, therefore all devices duplicate, which breaks the unique-device-name rule.
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 21:56
by deejc
got it, will remove it
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 21:56
by chrispazz
Marci wrote:
Do the following:
Code: Select all
cd /
sudo find ./ -name homebridge-edomoticz
...and copy/paste the output.
I was on travel...
Here it is
./root/.npm/registry.npmjs.org/homebridge-edomoticz
./root/.npm/homebridge-edomoticz
./usr/local/lib/node_modules/homebridge-edomoticz
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 21:58
by Marci
deejc wrote:got it, will remove it
Once it hits Release and I package it into npmjs it'll be back to 'usual' all-lowercase name.
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 22:04
by Marci
chrispazz wrote:Also deleting accessory files and repairing is doing the same result...
Could it be the new version still not working good?
Ty
Did you delete contents of persist folder, or just the accessories folder? Need to empty both.
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 22:15
by deejc
ok everything is back up and running, although I'm not seeing the mqtt messages in the plugin log, i am running domo in docker so i reconfigured the docker to open port 1883 etc
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 22:18
by chrispazz
Marci wrote:chrispazz wrote:Also deleting accessory files and repairing is doing the same result...
Could it be the new version still not working good?
Ty
Did you delete contents of persist folder, or just the accessories folder? Need to empty both.
I just did both again but the result is again the same.
Is there any way to debug this?
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 22:21
by Marci
deejc wrote:ok everything is back up and running, although I'm not seeing the mqtt messages in the plugin log, i am running domo in docker so i reconfigured the docker to open port 1883 etc
Check with an MQTT iPhone app or other MQTT client to make sure Domoticz is sending output. Presume you've added the hardware MQTT over LAN device in Domoticz?
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 22:23
by Marci
chrispazz wrote:
I just did both again but the result is again the same.
Is there any way to debug this?
Not easily, no. Leave it with me.
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 22:31
by Marci
@chrispazz - what HomeKit app are you using, and what version of iOS?
Re: eDomoticz Homebridge-Plugin
Posted: Wednesday 10 August 2016 22:32
by chrispazz
I am using standard home app with iOS 10 beta 4