homebridge-edomoticz Plugin

Moderator: leecollings

harrykausl
Posts: 177
Joined: Sunday 13 November 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Germany
Contact:

Re: homebridge-edomoticz Plugin

Post by harrykausl »

Hello, I installed homebridge and had the problem with the notifications. So I found this plugin and installed it with mqtt and mosquito too some days ago. It seemed to work. Now at the moment, I dont get any notification updates in home or eve, I have to restart the app and after some time it shows the correct status of the devices. So I looked into the logfiles (homebridge.err) and there I saw a error with bonjpur. Perhaps this could cause the problem. I attached the error-log. Or is there any other location, where I can see what happens? It seems, that the plugin doesn't work correctly. Thanks a lot

PS: I updated all programs (homebridge, edomoticz-homebridge). The same problem, I don't get updates in eve. In the homebridge.log I see, that the plugin is started.

Perhaps I have a problem with the mqtt. In the config.json I wrote
"platforms": [
{
"platform": "eDomoticz",
"name": "Domoticz",
"server": "127.0.0.1",
"port": "8080",
"ssl": 0,
"roomid": 0,
"loadscenes": 1,
"mqtt" : 1
}
I'm not sure, if this parameter mqtt is correct. I also tried 0 but this didn't work too.
Attachments
homebridge_err.txt
(1.18 KiB) Downloaded 106 times
Last edited by harrykausl on Wednesday 07 December 2016 15:13, edited 1 time in total.
User avatar
TheRamon
Posts: 126
Joined: Tuesday 12 July 2016 11:32
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: NL/DE
Contact:

Re: homebridge-edomoticz Plugin

Post by TheRamon »

anba wrote:Thanks for your reply.
I don't have a water flow device as the code says. I got three counters and they output the following:
Could you please try the latest version? It's on GitHub and npm.. simply update though npm.

TroisSix wrote:Thanks, but there isn't anything such as homebridge.err or homebridge.log in /var/log
I use "sudo systemctl start homebridge" to start homebridge, but is there a script or config file that we can modify to define where the logs are written? :roll:
Alright, by default all logs are written to that location.
You could try dropping the systemctl part and just using a init.d script. I'll post mine below.
You then just use /etc/init.d/homebridge start, /etc/init.d/homebridge stop, /etc/init.d/homebridge restart etc..
Logs will be in /var/log/homebridge.log and /var/log/homebridge.err.
Spoiler: show

Code: Select all

#!/bin/sh
### BEGIN INIT INFO
# Provides: homebridge
# Required-Start:    $network $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start daemon at boot time
# Description:       Enable service provided by daemon.
### END INIT INFO

dir="/home/pi"
cmd="/usr/bin/homebridge"
user="pi"

name=`basename $0`
pid_file="/var/run/$name.pid"
stdout_log="/var/log/$name.log"
stderr_log="/var/log/$name.err"

get_pid() {
    cat "$pid_file"
}

is_running() {
    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
}

case "$1" in
    start)
    if is_running; then
        echo "Already started"
    else
        echo "Starting $name"
        cd "$dir"
        if [ -z "$user" ]; then
            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
        else
            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
        fi
        echo $! > "$pid_file"
        if ! is_running; then
            echo "Unable to start, see $stdout_log and $stderr_log"
            exit 1
        fi
    fi
    ;;
    stop)
    if is_running; then
        echo -n "Stopping $name.."
        kill `get_pid`
        for i in {1..10}
        do
            if ! is_running; then
                break
            fi

            echo -n "."
            sleep 1
        done
        echo

        if is_running; then
            echo "Not stopped; may still be shutting down or shutdown may have failed"
            exit 1
        else
            echo "Stopped"
            if [ -f "$pid_file" ]; then
                rm "$pid_file"
            fi
        fi
    else
        echo "Not running"
    fi
    ;;
    restart)
    $0 stop
    if is_running; then
        echo "Unable to stop, will not attempt to start"
        exit 1
    fi
    $0 start
    ;;
    status)
    if is_running; then
        echo "Running"
    else
        echo "Stopped"
        exit 1
    fi
    ;;
    *)
    echo "Usage: $0 {start|stop|restart|status}"
    exit 1
    ;;
esac

exit 0
harrykausl wrote:Hello, I installed homebridge and had the problem with the notifications. So I found this plugin and installed it with mqtt and mosquito too some days ago. It seemed to work. Now at the moment, I dont get any notification updates in home or eve, I have to restart the app and after some time it shows the correct status of the devices. So I looked into the logfiles (homebridge.err) and there I saw a error with bonjpur. Perhaps this could cause the problem. I attached the error-log. Or is there any other location, where I can see what happens? It seems, that the plugin doesn't work correctly. Thanks a lot
I'm not sure, but it looks like it has something to do with your avahi installation. Try out the following command:
sudo apt-get install avahi-daemon avahi-discover libnss-mdns libavahi-compat-libdnssd-dev
If that is not working, I'm afraid I can't help.. Try with the guys of avahi or Homebridge..
harrykausl
Posts: 177
Joined: Sunday 13 November 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Germany
Contact:

Re: homebridge-edomoticz Plugin

Post by harrykausl »

I did the install you proposed. But it didn't help. In config.json is it correct to use
"platforms": [
{
"platform": "eDomoticz",
"name": "Domoticz",
"server": "127.0.0.1",
"port": "8080",
"ssl": 0,
"roomid": 0,
"loadscenes": 1,
"mqtt" : 0
}
],

for starting mqtt?

PS: I changed to mqtt : true and now it works.
User avatar
TheRamon
Posts: 126
Joined: Tuesday 12 July 2016 11:32
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: NL/DE
Contact:

Re: homebridge-edomoticz Plugin

Post by TheRamon »

Ehm nope, you'd have to use "mqtt": 1 to enable mqtt. "mqtt": 0 or leaving the whole "mqtt" option out is disabling mqtt.
So weird avahi is still crashing. Is this just on boot? I'm having problems on boot too, but that's just because homebridge is starting too fast. Avahi not loaded yet.
What platform are you using? Are you on Apple Mac by any chance?
harrykausl
Posts: 177
Joined: Sunday 13 November 2016 10:43
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: Germany
Contact:

Re: homebridge-edomoticz Plugin

Post by harrykausl »

Hello,
thanks fpr your answer. I'm on a raspberry. Since I changed to true (I found this in this post) it works. So I think the error in the homebridge.err had nothing to do with this (fixed) problem. But I put a question to the homebridge post, perhaps someone can answer it.
jovo
Posts: 15
Joined: Thursday 12 March 2015 16:57
Target OS: Linux
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by jovo »

Hi,
I am asking the community for help on the following 2 issues:

1) A sensor registers temp and humidity. I call this device "temperature" and I can succeed asking Siri the temperature for this sensor. Siri also reports the "degrees celcius" part. When I ask Siri for the Humidity, it reports the correct humidity, but calls this "temperature" (because the siri name is temperature". Needless to say, but when i rename this device to "Humidity", Siri nicely tells me the correct answer, but then temperature no longer works.
Is it possible for such combined sensor to have two Siri Names so I can ask both for temperature and for humidity?
An alternative approach could be to call this sensor "climate" and expect Siri to give both readings. But when calling this sensor in Siri, it will only and always only read the temperature.

2) Eve shows the reading from my P1 smart energy meter and my water meter. However, it defaults to the reading of total energy, gas and water. I am more interested in getting the daily totals. Is there a way to set the default preferred output?
2b) my water meter in Eve is listed in Watt while Domoticz shows m3. How can I change this in Eve/Homebridge/Homekit?

3) this is a question (not issue): Is it possible to have Eve somehow show graphs? I dont think so, but it would be nice.

Perhaps these issues have been discussed before, but I failed to find the answer in this lengthy discussion...
madrian
Posts: 231
Joined: Saturday 27 August 2016 1:18
Target OS: -
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by madrian »

@TheRamon:

I updated to the beta version.
I removed the whole scripts folder from domoticz and tried to ask "set bed led to 100%", guess what :) :

2016-12-09 18:21:51.894 User: Admin initiated a switch command (31/BEDLED/Set Level)
2016-12-09 18:21:51.894 (LED) Lighting 5 (BEDLED)
2016-12-09 18:21:51.901 User: Admin initiated a switch command (31/BEDLED/On)
2016-12-09 18:21:51.902 (LED) Lighting 5 (BEDLED)

:twisted:
User avatar
TheRamon
Posts: 126
Joined: Tuesday 12 July 2016 11:32
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: NL/DE
Contact:

Re: homebridge-edomoticz Plugin

Post by TheRamon »

hpapagaj wrote:@TheRamon:

I updated to the beta version.
I removed the whole scripts folder from domoticz and tried to ask "set bed led to 100%", guess what :) :

2016-12-09 18:21:51.894 User: Admin initiated a switch command (31/BEDLED/Set Level)
2016-12-09 18:21:51.894 (LED) Lighting 5 (BEDLED)
2016-12-09 18:21:51.901 User: Admin initiated a switch command (31/BEDLED/On)
2016-12-09 18:21:51.902 (LED) Lighting 5 (BEDLED)

:twisted:
So it's still sending the on command? Oh boy. How! :|
User avatar
TheRamon
Posts: 126
Joined: Tuesday 12 July 2016 11:32
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: NL/DE
Contact:

Re: homebridge-edomoticz Plugin

Post by TheRamon »

jovo wrote:Hi,
I am asking the community for help on the following 2 issues:

1) A sensor registers temp and humidity. I call this device "temperature" and I can succeed asking Siri the temperature for this sensor. Siri also reports the "degrees celcius" part. When I ask Siri for the Humidity, it reports the correct humidity, but calls this "temperature" (because the siri name is temperature". Needless to say, but when i rename this device to "Humidity", Siri nicely tells me the correct answer, but then temperature no longer works.
Is it possible for such combined sensor to have two Siri Names so I can ask both for temperature and for humidity?
An alternative approach could be to call this sensor "climate" and expect Siri to give both readings. But when calling this sensor in Siri, it will only and always only read the temperature.

2) Eve shows the reading from my P1 smart energy meter and my water meter. However, it defaults to the reading of total energy, gas and water. I am more interested in getting the daily totals. Is there a way to set the default preferred output?
2b) my water meter in Eve is listed in Watt while Domoticz shows m3. How can I change this in Eve/Homebridge/Homekit?

3) this is a question (not issue): Is it possible to have Eve somehow show graphs? I dont think so, but it would be nice.

Perhaps these issues have been discussed before, but I failed to find the answer in this lengthy discussion...

Hi, I don't think it is possible to change Siri commands. You'll have to get creative with Domoticz devices.

I'll investigate the meter part! I might make a config variable for it. Daily output seems more logical!

3. - I'm not too familiar with Eve, but I don't think you can. If it can, it'd be an Eve functionality only. There is no standard HomeKit way to draw a graph.
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 »

3) No. Eve tech support won't reveal the UUIDs needed.
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
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 »

2b) you can't.
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
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 »

1) No. Split the device in Domoticz by hiding it then making 3x individual custom devices, and add relevant lua or http scripts in Domoticz to update them from the hidden device.
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!
fennec62
Posts: 43
Joined: Sunday 26 October 2014 22:11
Target OS: Linux
Domoticz version:
Location: france
Contact:

Re: homebridge-edomoticz Plugin

Post by fennec62 »

Hi

After update homebridge and homebridge-edomoticz

i have a little bug with cache or something like that

First i delete persist folder

the bug is only with blind percentage

when open close or move my blind the command is ok and statut of blind change in Home and domoticz

So i close home on my iphone

And when i reopen home, home update status but my blind is not in same position before quit, the position is another position but always the same

in domoticz

I thinks home or homebridge don't save the last value when quit home and after restart restore the wrong value

Thanks for your help
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 »

possible wrote:New problem.

I installed the WOL plugin to turn on my NAS server with siri.

I installed the plugin but it fails with:

DEBUG:

Code: Select all

usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/index.js:47
        this.wrap = new raw.SocketWrap (
                    ^

Error: Operation not permitted
    at Error (native)
    at new Socket (/usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/index.js:47:14)
    at Object.exports.createSocket (/usr/local/lib/node_modules/homebridge-wol/node_modules/raw-socket/index.js:202:9)
    at Session.getSocket (/usr/local/lib/node_modules/homebridge-wol/node_modules/net-ping/index.js:147:20)
    at new Session (/usr/local/lib/node_modules/homebridge-wol/node_modules/net-ping/index.js:101:7)
    at Object.exports.createSession (/usr/local/lib/node_modules/homebridge-wol/node_modules/net-ping/index.js:545:9)
    at new Pinger (/usr/local/lib/node_modules/homebridge-wol/index.js:114:24)
    at new Computer (/usr/local/lib/node_modules/homebridge-wol/index.js:28:16)
    at Server._loadAccessories (/usr/local/lib/node_modules/homebridge/lib/server.js:264:29)
    at Server.run (/usr/local/lib/node_modules/homebridge/lib/server.js:80:38)
    
Go ask via whatever medium the authors of homebridge-wol advertise on npmjs.org or wherever you got it from. We didn't write homebridge, or homebridge-wol.

This thread is for issues with the homebridge-edomoticz plugin only, as that's the only thing we've written.
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!
BasPost
Posts: 13
Joined: Thursday 25 June 2015 15:14
Target OS: Raspberry Pi / ODroid
Domoticz version: V2.2563
Contact:

Re: homebridge-edomoticz Plugin

Post by BasPost »

Hello,
maybe a n00b question, but I have the plugin running fine for a while, but have added new devices in Domoticz and roomplan. How do I proceed to add these in Homebridge, Also how do I update Homebridge en you're plugin to latest versions?
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 »

Read the first post of the thread.
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!
thebeetleuk
Posts: 115
Joined: Saturday 21 December 2013 23:50
Target OS: Linux
Domoticz version:
Location: Scotland
Contact:

Re: homebridge-edomoticz Plugin

Post by thebeetleuk »

This is driving me mad :) Please help!! :)

OK so I have installed a fresh image and recently got my amazon dash buttons up and running. All good :) Now on to Homebridge and I just cant get tings working correctly.

I have npm and node installed as below.

Code: Select all

pi@raspberrypi:/ $ npm -v
node4.0.3
pi@raspberrypi:/ $ node -v
v6.3.1
but one thing I have noticed is that this isn't in the directory as the install instructions for homebridge is expecting /usr/lib/node_modules. Instead its in /home/pi/node_modules. so I'm assuming I may have done something incorrect when installing node?

I have followed all the instructions as per post 1 (with the exception of editing the config file in the /home/pi/homebridge/ directory) .

Everything seemed to run without error but when I try to run the 'homebridge' command it just says command not found.

Any help would be appreciated. Thanks!!

I think the install locations below might be incorrect?

Code: Select all

pi@raspberrypi:/ $ cd home/pi/
pi@raspberrypi:~ $ ls -l
total 32
drwxr-xr-x  2 pi pi 4096 Sep 23 04:52 Desktop
drwxr-xr-x  5 pi pi 4096 Sep 23 04:52 Documents
drwxr-xr-x  6 pi pi 4096 Dec 11 10:09 domoticz
drwxr-xr-x  2 pi pi 4096 Sep 23 05:03 Downloads
drwxr-xr-x  7 pi pi 4096 Nov 24 13:17 homebridge
drwxr-xr-x  2 pi pi 4096 Nov 24 12:17 node.js
drwxr-xr-x 11 pi pi 4096 Dec  3 09:02 node_modules
drwxr-xr-x  6 pi pi 4096 Jul 21 22:45 node-v6.3.1-linux-armv6l
Update: I just ran "bin/homebridge" and at least it runs. That said I dont like the error. I think however this might be due to install locaiton as well. Thoughts?

Code: Select all

pi@raspberrypi:~/homebridge $ bin/homebridge
/home/pi/homebridge/node_modules/hap-nodejs/node_modules/mdns/lib/dns_sd.js:35
    throw ex;
    ^

Error: Module version mismatch. Expected 48, got 46.
    at Error (native)
    at Object.Module._extensions..node (module.js:568:18)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/home/pi/homebridge/node_modules/hap-nodejs/node_modules/mdns/lib/dns_sd.js:24:20)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)
My Setup: Pi, RFXtrx433, HomeEasy: 13 Dimmers & 4 Sockets, 2 motion-sensors, 3 magnetic switches, 1 OWL Electricity Sensor, 3 Oregon Temp Sensor.
User avatar
TheRamon
Posts: 126
Joined: Tuesday 12 July 2016 11:32
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: NL/DE
Contact:

Re: homebridge-edomoticz Plugin

Post by TheRamon »

Hi,

To get modules in use/lib, you'll have to install them globally. This means everyone can access them. Install homebridge this way, too.

npm install -g homebridge

The DNS error could be something else. Please try this first.
Don't forget to change your config.
thebeetleuk
Posts: 115
Joined: Saturday 21 December 2013 23:50
Target OS: Linux
Domoticz version:
Location: Scotland
Contact:

Re: homebridge-edomoticz Plugin

Post by thebeetleuk »

Thanks. I'll start with a fresh image and try again. :)
My Setup: Pi, RFXtrx433, HomeEasy: 13 Dimmers & 4 Sockets, 2 motion-sensors, 3 magnetic switches, 1 OWL Electricity Sensor, 3 Oregon Temp Sensor.
Purejet
Posts: 12
Joined: Wednesday 07 October 2015 14:07
Target OS: -
Domoticz version:
Contact:

Re: homebridge-edomoticz Plugin

Post by Purejet »

Trying to install Homebridge again. Service is running now. But when i open an Homekit app i don't see my bridge to connect with...
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests