homebridge-edomoticz Plugin

Moderator: leecollings

Jem101
Posts: 66
Joined: Saturday 02 May 2015 21:26
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Bexleyheath, SE London, UK
Contact:

Re: homebridge-edomoticz Plugin

Post by Jem101 »

The error is 'address is already in use', port 51826 is being used for something else - probably you already have homebridge running and are trying to start another instance and that fails.

Make sure homebridge is not running first (sudo systemctl stop homebridge - if you have set it up to auto start that way), and then restart it.

Otherwise you will need to find out what process is using that port.

If you aren't using MQTT (and you really should) it should not cause an issue having the flag set to 1 , but really you might as well set it to 0 just for neatness.

Try sudo nano if you have access permission problems.
I firmly believe in having an open mind - although not so open that your brain falls out!

- sometimes attributed to Carl Sagan, but the original quote is much older than that
User avatar
lsp242
Posts: 54
Joined: Sunday 04 February 2018 8:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 12923
Location: Netherlands
Contact:

Re: homebridge-edomoticz Plugin

Post by lsp242 »

Jem101 wrote: Sunday 04 February 2018 11:34 The error is 'address is already in use', port 51826 is being used for something else - probably you already have homebridge running and are trying to start another instance and that fails.

Make sure homebridge is not running first (sudo systemctl stop homebridge - if you have set it up to auto start that way), and then restart it.

Otherwise you will need to find out what process is using that port.

If you aren't using MQTT (and you really should) it should not cause an issue having the flag set to 1 , but really you might as well set it to 0 just for neatness.

Try sudo nano if you have access permission problems.
thnx.. stop homebridge and start again, gives the same problem
Gadget freak - Domoticz beginner - ios and android user
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: homebridge-edomoticz Plugin

Post by Marci »

Then you still have a running instance that you haven't stopped. run :

Code: Select all

ps -aux | grep homebridge
Then run:

Code: Select all

sudo kill -9 {pid}
...for each process returned until you've done them all.

Now launch homebridge.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
User avatar
lsp242
Posts: 54
Joined: Sunday 04 February 2018 8:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 12923
Location: Netherlands
Contact:

Re: homebridge-edomoticz Plugin

Post by lsp242 »

Marci wrote: Sunday 04 February 2018 12:08 Then you still have a running instance that you haven't stopped. run :

Code: Select all

ps -aux | grep homebridge
Then run:

Code: Select all

sudo kill -9 {pid}
...for each process returned until you've done them all.

Now launch homebridge.
a little stupid faillure of mine.. with pm2 i setup autostart, so when i kill and than manually start... that is the second time..

to test i can better switch off autostart or not?
How can I setup mqtt?
I connected to eve on my iphone, but there's something wrong because get Gas gives : The accessory sent an invalid response please try again. In Domoticz it works fine..
Gadget freak - Domoticz beginner - ios and android user
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: homebridge-edomoticz Plugin

Post by Marci »

See first post in the thread for setting up Mqtt and supplying json output for devices not functioning.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
User avatar
lsp242
Posts: 54
Joined: Sunday 04 February 2018 8:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 12923
Location: Netherlands
Contact:

Re: homebridge-edomoticz Plugin

Post by lsp242 »

Marci wrote: Sunday 04 February 2018 12:55 See first post in the thread for setting up Mqtt and supplying json output for devices not functioning.
thnx i 'll try that, thnx for the help
Gadget freak - Domoticz beginner - ios and android user
User avatar
lsp242
Posts: 54
Joined: Sunday 04 February 2018 8:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 12923
Location: Netherlands
Contact:

Re: homebridge-edomoticz Plugin

Post by lsp242 »

lsp242 wrote: Sunday 04 February 2018 13:00
Marci wrote: Sunday 04 February 2018 12:55 See first post in the thread for setting up Mqtt and supplying json output for devices not functioning.
thnx i 'll try that, thnx for the help
MQTT says find... but...

Code: Select all

[2018-2-4 13:57:25] Homebridge is running on port 51826.
[2018-2-4 13:57:25] [eDomoticz] Could not register platform accessory! (Gas)
Error: Cannot add a bridged Accessory with the same UUID as another bridged Accessory: afa6e941-5263-43b2-8f34-317a71e7c1bf
[2018-2-4 13:57:26] [eDomoticz] Successfully connected to MQTT broker.
HAP Warning: Characteristic undefined not in required or optional characteristics for service 24a8d81a-3d7b-4965-9086-7edc3ef4fab3. Adding anyway.
^ For: Electra
and when i run

Code: Select all

mosquitto_pub -h localhost -m '{ "idx" : 4, "nvalue" : 0, "svalue" : "25.0" }' -t 'domoticz/in'
the virtual sensor in doesn't give any reading
Gadget freak - Domoticz beginner - ios and android user
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: homebridge-edomoticz Plugin

Post by Marci »

No errors there that should be causing a problem. That warning is normal. Delete your accessories and persist folders in ~/.homebridge, restart homebridge, then run Home.app, not Eve. Remove and readd Bridge to your home in Home.app - it will then take you through adding your devices. Once that's complete, then switch to Eve.
the virtual sensor in doesn't give any reading
Have you added the mqtt client hardware in Domoticz?
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
User avatar
lsp242
Posts: 54
Joined: Sunday 04 February 2018 8:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 12923
Location: Netherlands
Contact:

Re: homebridge-edomoticz Plugin

Post by lsp242 »

Marci wrote: Sunday 04 February 2018 14:15 No errors there that should be causing a problem. That warning is normal. Delete your accessories and persist folders in ~/.homebridge, restart homebridge, then run Home.app, not Eve. Remove and readd Bridge to your home in Home.app - it will then take you through adding your devices. Once that's complete, then switch to Eve.
the virtual sensor in doesn't give any reading
Have you added the mqtt client hardware in Domoticz?
Okey, but gas and Electra not supported home app.

Yes i did ADD The part with port 1883 on Domoticz also ADD virtual sensor
Gadget freak - Domoticz beginner - ios and android user
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: homebridge-edomoticz Plugin

Post by Marci »

You still need to use Home.app to add the bridge and trigger the adding of accessories.
Eve and other 3rd Party apps for some reason can have issues triggering the adding of accessories once the bridge is added - doing it in Home.app is far more reliable. It will still find and add the devices correctly regardless of whether it supports them - it’ll just list them as unsupported once added. 3rd party apps will list them correctly thereafter.

Re: mosquitto... stop homebridge, run it with

Code: Select all

DEBUG=* homebridge -D 
Change a sensor or switch in Domoticz and you should see a corresponding MQTT message appear in homebridge output. If you do, MQTT is configured correctly as far as the homebridge-edomoticz plugin is concerned.

If testing input to Domoticz manually, start simpler...

Code: Select all

{"command" : "addlogmessage", "message" : "MyMessage to log" }
Whilst watching the Domoticz log. If that doesn’t show up, create a new topic elsewhere on the forum as appropriate to getting MQTT working with Domoticz (which is not an iOS-specific issue).
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
User avatar
lsp242
Posts: 54
Joined: Sunday 04 February 2018 8:51
Target OS: Raspberry Pi / ODroid
Domoticz version: 12923
Location: Netherlands
Contact:

Re: homebridge-edomoticz Plugin

Post by lsp242 »

Hi,

Today i managed to get my RFlink connected to my Domoticz, next to the P1 meter reading.

I see some different settings about the floorplan, set on IDX for example 2 and put there the sensors etc in....

What is the advantage or disadvantage to set in de config.json the floorplan ? What would you suggest to do? :?: :?: :?:
Gadget freak - Domoticz beginner - ios and android user
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: homebridge-edomoticz Plugin

Post by Marci »

Homebridge supports a maximum of 100 devices... from opening post of thread:

q: I have LOTS of devices and can’t connect to Homebridge
a: Create a room plan within Domoticz. Add the sensors you NEED exposing to HomeKit to that roomplan within Domoticz. Note the roomplan’s idx number, and set the “roomid” value in your config.json to this number. (In the config.json example roomid is set to 0 so loads ALL sensors).


If you don’t have more than 100 devices in Domoticz, you don’t need to use the roomid feature.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
mrkrabs
Posts: 21
Joined: Sunday 12 March 2017 14:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9589
Contact:

Re: homebridge-edomoticz Plugin

Post by mrkrabs »

Hi, first of all, many thanks Marci for creating this awesome plugin for us. everything works great for me, apart from the issues outlined below. Maybe anyone could help me with this.

Let's say i have a device in domoticz (which is a esp8266 with a bme280 sensor) that provides temp+hum+baro values into domoticz. All good and the data is showed in domoticz and hence in EVE app that i'm using (not in Home app on iOS, but this is fine since it's unsupported) My issue is, I named the device "aaa" for example, then i installed homebridge on my Pi, imported a homebridge bridge into the Home (and hence in EVE) app, and then I decided to change the name of the device to "bbb" in EVE and Home app, and even in domoticz. So the device name is "bbb" on Home app, in domoticz and even in EVE in settings/accessories but when i go to Rooms and to a room where the device is added it still shows the old "aaa" name for some reason and i am unable to change this. If I click on the "aaa" device, in Rooms in EVE and go to Rooms/accessory/details it shows the "bbb" name which is correct. Also, in the "at a glance" screen the device shows as "aaa" instead of "bbb" so it looks like the name is not being changed by EVE. Could it be stored somewhere in homebridge (or in Home app?) during the first import of the bridge? I've tried everything I could think of but with no luck. Any ideas on how to fix this?

Also when I ask Siri what's the temperature in the Room is says "temperature in room "bbb" is xx", but if i ask what is the humidity in the same room is says "the reading of a device "aaa" in room is xx".
mrkrabs
Posts: 21
Joined: Sunday 12 March 2017 14:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9589
Contact:

Re: homebridge-edomoticz Plugin

Post by mrkrabs »

and on a side note - does anyone succeeded in implementing the fakegato-history plugin for showing graphs in EVE am not sure i understand on how to do this..
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: homebridge-edomoticz Plugin

Post by Marci »

Device name in Domoticz makes the UUID of the Accessory in Homebridge. Change the name in Domoticz and it can't work out what device to change in Homebridge as it can no longer find a UUID match. Long story short: if renaming things in Domoticz, remove and re-add your Bridge in Homekit.

Note, in Eve you can edit a device and change it's SIRI Name. This then applies thru-out HomeKit.

Re: fakegato... nope.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
mrkrabs
Posts: 21
Joined: Sunday 12 March 2017 14:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9589
Contact:

Re: homebridge-edomoticz Plugin

Post by mrkrabs »

Thanks Marci, but it still doesn't work. i still see all the old names in homekit after removing/readding bridge in home app (and even restarting both homebridge and domoticz). There is also this error now when i start homebridge:

Code: Select all

HAP Warning: Characteristic undefined not in required or optional characteristics for service debf1b79-312e-47f7-bf82-993d9950f3a2. Adding anyway.
^ For: Living Room
Could that be an issue, since the device is no longed called Living Room in domoticz...
mrkrabs
Posts: 21
Joined: Sunday 12 March 2017 14:42
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9589
Contact:

Re: homebridge-edomoticz Plugin

Post by mrkrabs »

ok, figured it out that all the old names were kept in accessories/cachedAccessories file. I've cleaned it, rebooted homebridge and all is good now.
User avatar
Marci
Posts: 531
Joined: Friday 22 January 2016 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Wakefield, West Yorkshire UK
Contact:

Re: homebridge-edomoticz Plugin

Post by Marci »

Sorry - I assumed removing and re-adding the bridge would purge and rebuild the accessories cache. Guess not!! Glad you’re sorted now...!

Hap Warnings are safe to ignore. It’s just a warning that the device will be unsupported in Home.app as it maps to a non-standard characteristic.
Extended Domoticz homebridge-plugin for latest Homebridge - adds temp/humidity/pressure sensors, power consumption sensors, DarkSkies virtual weather station support, YouLess Meter support, general % usage support & switch/lamp status checking!
bing69
Posts: 139
Joined: Thursday 05 June 2014 10:55
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: 's-Hertogenbosch, NL
Contact:

Re: homebridge-edomoticz Plugin

Post by bing69 »

I've been trying to get homebridge working for months now, but it just does not work. Hope someone comes with the golden tip .....


pi@raspberrypi:/usr/lib/node_modules $ homebridge
*** WARNING *** The program 'node' uses the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not supported (or only supported partially) in the Apple Bonjour compatibility layer of Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libdn ... ceRegister>
[2/18/2018, 9:46:38 AM] Warning: skipping plugin found at '/usr/local/lib/node_modules/homebridge-edomoticz' since we already loaded the same plugin from '/usr/lib/node_modules/homebridge-edomoticz'.
[2/18/2018, 9:46:39 AM] Loaded plugin: homebridge-edomoticz
[2/18/2018, 9:46:39 AM] Registering platform 'homebridge-edomoticz.eDomoticz'
[2/18/2018, 9:46:39 AM] ---
[2/18/2018, 9:46:39 AM] Loaded config.json with 0 accessories and 1 platforms.
[2/18/2018, 9:46:39 AM] ---
[2/18/2018, 9:46:39 AM] Loading 1 platforms...
[2/18/2018, 9:46:39 AM] [eDomoticz] Initializing eDomoticz platform...
[2/18/2018, 9:46:39 AM] Loading 0 accessories...
Scan this code with your HomeKit App on your iOS device to pair with Homebridge:

┌────────────┐
│ 031-45-154 │
└────────────┘

events.js:141
throw er; // Unhandled 'error' event
^

Error: listen EADDRINUSE :::51826
at Object.exports._errnoException (util.js:907:11)
at exports._exceptionWithHostPort (util.js:930:20)
at Server._listen2 (net.js:1250:14)
at listen (net.js:1286:10)
at Server.listen (net.js:1382:5)
at EventedHTTPServer.listen (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/util/eventedhttp.js:59:19)
at HAPServer.listen (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/HAPServer.js:157:20)
at Bridge.Accessory.publish (/usr/local/lib/node_modules/homebridge/node_modules/hap-nodejs/lib/Accessory.js:496:16)
at Server._publish (/usr/local/lib/node_modules/homebridge/lib/server.js:111:16)
at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:88:10)
Jem101
Posts: 66
Joined: Saturday 02 May 2015 21:26
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Bexleyheath, SE London, UK
Contact:

Re: homebridge-edomoticz Plugin

Post by Jem101 »

The clue to the problem is this line in the error message

Error: listen EADDRINUSE :::51826


What it's saying is that there is already a process running on the device which is using the TCP port (51826), which homebridge wants to use. Now the most likely reason for this is that you already have homebridge running as a background (auto started) service, so if you manually start it, you are actually trying to start a second instance and that fails out.

So from an ssl session you can type

ps faux (which lists all the running processes but that can give a long list so try

ps faux | grep homebridge which on my pi shows

pi 850 0.0 5.9 164876 59568 ? Ssl Feb11 9:24 homebridge
pi 26097 0.0 0.2 4272 2012 pts/0 S+ 09:48 0:00 \_ grep --color=auto homebridge

So I have an instance of homebridge running with a PID (process id) of 850

If I want to stop it I have a choice of

sudo systemctl stop homebridge

or even the 'nuclear option'

sudo kill -9 850

Have a look first and see what is actually running on your device, if homebridge is running then stop it and try manually starting it and see what happens.
I firmly believe in having an open mind - although not so open that your brain falls out!

- sometimes attributed to Carl Sagan, but the original quote is much older than that
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests