Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

List Devices and rooms #10

Open
marmil opened this issue Jun 23, 2015 · 2 comments
Open

List Devices and rooms #10

marmil opened this issue Jun 23, 2015 · 2 comments

Comments

@marmil
Copy link
Contributor

marmil commented Jun 23, 2015

Hat noch jemand ein Problem mit der example.php bei:

// Now get a list of all LogicalDevices and print their names and room
foreach ($sh->getLogicalDevices() as $ld) {
    printf("Device '%s' is a '%s' in room '%s'.", $ld->getName(), $ld->getType(), $ld->getLocation()->getName());
    if($ld->getType() == LogicalDevice::DEVICE_TYPE_SWITCH_ACTUATOR) {
        printf(" Switch state is '%s'.", $ld->getState());
    }
    if($ld->getType() == LogicalDevice::DEVICE_TYPE_WINDOW_DOOR_SENSOR) {
        printf(" %s is %s.", $ld->getInstallationType(), $ld->getState());
    }
    echo $newLine;
}

Ich erhalte immer den Fehler:

PHP Fatal error:  Uncaught exception 'Exception' with message 'Unknown GenericActuator state ""' in /var/www/server/SmartHome-API.php:533
Stack trace:
#0 /var/www/server/example.php(120): Bubelbub\SmartHomePHP\SmartHome->getAllLogicalDeviceStates()
#1 {main}
  thrown in /var/www/server/SmartHome-API.php on line 533

Jemand eine Idee? :)

@Bubelbub
Copy link
Owner

Hast du die Zugangsdaten richtig eingegeben und alles?
Könnte sein, dass er da keine Daten bekommt.

Oder was auch sein könnte, dass vllt. die Version aktualisiert wurde oder irgendwas los ist bei dir.
Ging es in der Vergangenheit schon bei dir? Oder ist das die Ersteinrichtung?

Hast du etwas an der example.php verändert, oder ist das "original" mit der veränderten Konfiguration oben?

@marmil
Copy link
Contributor Author

marmil commented Jun 24, 2015

Ich hatte bisher die alte Version laufen und habe die jetzt parallel neu installiert um mir anzuschauen ob sich ein Umstieg lohnt.
Die Zugangsdaten etc sind korrekt, die Version ist in einem eigenen Ordner über das Repo mit Composer installiert und die example ist bis auf die Config original.
Wenn ich mir das Ergebnis von getEntities und getAllLogicalDeviceStates über print_r ausgeben lasse, dann bekomme ich alle Daten.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants