homebridge/homekit

Begonnen von justme1968, 01 Februar 2016, 16:16:37

Vorheriges Thema - Nächstes Thema

justme1968

in der zeile ist noch ein tippfehler. ist heute abend repariert. bis dahin einfach auskommentieren. die zeile der nächsten meldung auch.

zwei mal neu starten sollte auch funktionieren.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

xMichiix

#61
Hallo, :D ich schon wieder :P

hab einmal den fehler in FHEM wen ich den Befehl aus führe : attr FHEM.Homebridge webCmd status:start:stop:restart
FHEM.Homebridge: unknown attribute webCmd. Type 'attr FHEM.Homebridge ?' for a detailed list

und den beim starten:

[FHEM] Initializing homebridge-fhem.FHEM platform...
starting longpoll: https://192.168.2.104:8083/fhem.pl?XHR=1&inform=type=status;filter=.*;since=null;fmt=JSON&timestamp=1454506171348
[FHEM] Fetching FHEM switchable devices...
[FHEM] fetching: https://192.168.2.104:8083/fhem?cmd=jsonlist2%20room=Homekit&XHR=1
Loading 0 accessories...
Server error: Error: listen EADDRINUSE :::8082

edit: der beim starten hat sich erledigt nun kommt nur:

[FHEM] Initializing homebridge-fhem.FHEM platform...
starting longpoll: https://192.168.2.104:8083/fhem.pl?XHR=1&inform=type=status;filter=.*;since=null;fmt=JSON&timestamp=1454506623271
[FHEM] Fetching FHEM switchable devices...
[FHEM] fetching: https://192.168.2.104:8083/fhem?cmd=jsonlist2%20room=Homekit&XHR=1
Loading 0 accessories...
Server listening on: http://<ip>:8082



l2r

wie sieht deine config.json aus?
Wissen ist Macht.
Ich weiß nix.
Macht nix.

xMichiix

#63
config.json
{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },

    "platforms": [
        {
            "platform": "homebridge-fhem.FHEM",
            "name": "FHEM",
            "server": "IP VOM RASPPI",
            "port": "8083",
            "auth": {"user": "MEINER", "pass": "MEINS"},
            "filter": "room=Homekit"
        }
     ],

    "accessories": []
}

homebridge

#!/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 for homebridge
# Description: Enable service provided by daemon.
### END INIT INFO
export PATH=$PATH:/usr/local/bin
export NODE_PATH=$NODE_PATH:/usr/local/lib/node_modules
PID=`pidof homebridge`
case "$1" in
start)
if ps -p $PID > /dev/null 2>&1; then
        echo "Homebridge is already running"
        perl /opt/fhem/fhem.pl 7072 "setreading FHEM.Homebridge.Status info Homebridge is allready running"
        perl /opt/fhem/fhem.pl 7072 "set FHEM.Homebridge.Status on"
        perl /opt/fhem/fhem.pl 7072 "set FHEM.Homebridge off"
else
        su - pi -c "homebridge > /dev/null 2>&1 &"
        echo "Homebridge starting"
$0 status
fi
;;
stop)
if ! ps -p $PID > /dev/null 2>&1; then
        echo "Homebridge is not running"
        perl /opt/fhem/fhem.pl 7072 "setreading FHEM.Homebridge.Status info Homebridge is not running"
        perl /opt/fhem/fhem.pl 7072 "set FHEM.Homebridge.Status off"
        perl /opt/fhem/fhem.pl 7072 "set FHEM.Homebridge off"
else
        kill $PID
        echo "Homebridge closed"
        perl /opt/fhem/fhem.pl 7072 "setreading FHEM.Homebridge.Status info Homebridge closed"
        perl /opt/fhem/fhem.pl 7072 "set FHEM.Homebridge.Status off"
        perl /opt/fhem/fhem.pl 7072 "set FHEM.Homebridge off"
fi
;;
restart)
if ! ps -p $PID > /dev/null 2>&1; then
        $0 start
else
        $0 stop
        $0 start
fi
;;
status)
if ps -p $PID > /dev/null 2>&1; then
        echo "Homebridge is running PID $PID"
        perl /opt/fhem/fhem.pl 7072 "setreading FHEM.Homebridge.Status info Homebridge running as PID $PID"
        perl /opt/fhem/fhem.pl 7072 "set FHEM.Homebridge.Status on"
        perl /opt/fhem/fhem.pl 7072 "set FHEM.Homebridge off"
else
        echo "Homebridge is not running"
        perl /opt/fhem/fhem.pl 7072 "setreading FHEM.Homebridge.Status info Homebridge is not running"
        perl /opt/fhem/fhem.pl 7072 "set FHEM.Homebridge.Status off"
        perl /opt/fhem/fhem.pl 7072 "set FHEM.Homebridge off"
fi
;;
*)
echo "Usage: $0 {start|stop|status|restart}"
exit 1
;;
esac
exit 0

sudoers

# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults        env_reset
Defaults        mail_badpass
Defaults        secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL
fhem    ALL=(ALL:ALL) ALL
homekit ALL=(ALL:ALL) ALL
homekit ALL=(ALL) NOPASSWD:/opt/fhem/FHEM/backup.sh, /etc/init.d/homebridge


# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d
pi ALL=(ALL) NOPASSWD: ALL
fhem ALL=(ALL) NOPASSWD: ALL
homekit ALL=(ALL) NOPASSWD: ALL


l2r

hast du bei dir eine Authentifizierung für die Weboberfläche eingeschaltet?

Gigt es den Raum Homekit? und sind dort die devices vorhanden, die du steuern möchtest?
Läuft homebridge auf der gleichen kiste wie fhem?

das ist meine config.json:
{
  "bridge": {
    "name": "Homebridge",
    "username": "CC:22:3D:E3:CE:30",
    "port": 51826,
    "pin": "031-45-154"
  },
  "platforms": [
        {
            "platform": "FHEM",
            "name": "FHEM",
            "server": "127.0.0.1",
            "port": "8083",
            "filter": "room=Homekit"
        }
     ],
  "accessories": []
}


Bitte nur übernehmen, wenn Homekit existiert, homebridge auf der gleichen Raspberry pi wie fhem läuft und wenn keine Authentifizierung notwendig ist.
Wissen ist Macht.
Ich weiß nix.
Macht nix.

DeeSPe

Nutzt Du Homebridge mit einem eigenen User homekit? Meine Homebridge läuft unter User pi.
MAINTAINER: 22_HOMEMODE, 98_Hyperion, 98_FileLogConvert, 98_serviced

Als kleine Unterstützung für meine Programmierungen könnt ihr mir gerne einen Kaffee spendieren: https://buymeacoff.ee/DeeSPe

xMichiix

ja die die homebridge mal auf homekit laufen lassen und mal auf pi mit pi geht es nur ich komm nicht mehr so weit bis die nummer 031-45-154 kommt zum eingeben das ging nur einmal und seit dem nicht mehr

DeeSPe

meine /etc/sudoers:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

pi ALL=(ALL) NOPASSWD: ALL
fhem ALL=(ALL) NOPASSWD:/opt/fhem/FHEM/backup.sh,/etc/init.d/homebridge


config.json:
{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },
    "platforms": [
        {
            "platform": "FHEM",
            "name": "FHEM",
            "server": "127.0.0.1",
            "port": "8083",
            "filter": "room=HomeKit",
            "auth": {"user": "USER", "pass": "PASSWORT"}
        }
    ],
    "accessories": []
}
MAINTAINER: 22_HOMEMODE, 98_Hyperion, 98_FileLogConvert, 98_serviced

Als kleine Unterstützung für meine Programmierungen könnt ihr mir gerne einen Kaffee spendieren: https://buymeacoff.ee/DeeSPe

xMichiix

Zitat von: DeeSPe am 03 Februar 2016, 14:57:44
meine /etc/sudoers:
#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults env_reset
Defaults mail_badpass
Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root ALL=(ALL:ALL) ALL

# Allow members of group sudo to execute any command
%sudo ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

pi ALL=(ALL) NOPASSWD: ALL
fhem ALL=(ALL) NOPASSWD:/opt/fhem/FHEM/backup.sh,/etc/init.d/homebridge


config.json:
{
    "bridge": {
        "name": "Homebridge",
        "username": "CC:22:3D:E3:CE:30",
        "port": 51826,
        "pin": "031-45-154"
    },
    "platforms": [
        {
            "platform": "FHEM",
            "name": "FHEM",
            "server": "127.0.0.1",
            "port": "8083",
            "filter": "room=HomeKit",
            "auth": {"user": "USER", "pass": "PASSWORT"}
        }
    ],
    "accessories": []
}


hab das mal übernommen und auch alles angepasst aber leider will es immernoch nicht :o

l2r

poste mal deine komplette ausgabe.

also den dienst stoppen, und dann einfach in die Console
homebridge

eingeben und dann sollte in der Ausgabe alles stehen.

Beenden kannst du homebridge dann wieder mit strg+c
Wissen ist Macht.
Ich weiß nix.
Macht nix.

l2r

@Andre: bei mir scheint es jetzt zu laufen, werde dann heute Abend mal genauer testen.

Einen Error haben ich allerdings noch:

[FHEM] rr_Michael: no service type detected


werden Roommate-Devices nicht standardmäßg unterstützt, oder muss ich noch einen genericDeviceType setzen?

Gruß Michael
Wissen ist Macht.
Ich weiß nix.
Macht nix.

xMichiix


root@raspberrypi:~/.homebridge# 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=libd                                                                                                                     ns_sd&e=node>
*** WARNING *** The program 'node' called 'DNSServiceRegister()' which is not su                                                                                                                     pported (or only supported partially) in the Apple Bonjour compatibility layer o                                                                                                                     f Avahi.
*** WARNING *** Please fix your application to use the native API of Avahi!
*** WARNING *** For more information see <http://0pointer.de/avahi-compat?s=libd                                                                                                                     ns_sd&e=node&f=DNSServiceRegister>
Loaded plugin: homebridge-fhem
Registering platform 'homebridge-fhem.FHEM'
---
Loaded config.json with 0 accessories and 1 platforms.
---
Loading 1 platforms...
[FHEM] Initializing FHEM platform...
starting longpoll: https://127.0.0.1:8083/fhem.pl?XHR=1&inform=type=status;filter=.*;since=null;fmt=JSON&timestamp=1454508554679
[FHEM] Fetching FHEM switchable devices...
[FHEM] fetching: https://127.0.0.1:8083/fhem?cmd=jsonlist2%20room=Homekit&XHR=1
Loading 0 accessories...
Server listening on: http://<ip>:8082


DeeSPe

Hab Roommate auch (noch) nicht hinbekommen. Das wäre schön!
Weiß aber nicht ob es überhaupt Schalter mit mehreren Schaltzuständen als an und aus in HomeKit gibt. Aber Modus hat ja sowas...

Zitat von: l2r am 03 Februar 2016, 15:07:57
@Andre: bei mir scheint es jetzt zu laufen, werde dann heute Abend mal genauer testen.

Einen Error haben ich allerdings noch:

[FHEM] rr_Michael: no service type detected


werden Roommate-Devices nicht standardmäßg unterstützt, oder muss ich noch einen genericDeviceType setzen?

Gruß Michael
MAINTAINER: 22_HOMEMODE, 98_Hyperion, 98_FileLogConvert, 98_serviced

Als kleine Unterstützung für meine Programmierungen könnt ihr mir gerne einen Kaffee spendieren: https://buymeacoff.ee/DeeSPe

justme1968

für PRESENCE und ROOMMATE hat noch der default ServiceType gefehlt.

hab es inzwischen eingebaut. bis dahin müsste es reichen genericDeviceType auf OccupancySensor zu setzen.

gruss
  andre
hue, tradfri, alexa-fhem, homebridge-fhem, LightScene, readingsGroup, ...

https://github.com/sponsors/justme-1968

l2r

@xMichiix: welche Devices sind im Raum Homekit? und was für einen Typ haben diese?
Ist ggf. genericDeviceType als attribut bei den Devices gesetzt worden?
Wissen ist Macht.
Ich weiß nix.
Macht nix.