openhab / openhab-pebble

Pebble client for openHAB
Apache License 2.0
11 stars 20 forks source link

Error in CloudPeble emulator with demo openHab server #13

Open clach04 opened 8 years ago

clach04 commented 8 years ago

Using the public demo server http://demo.openhab.org:9080 in the emulator results in errors in the trace:

[PHONE] pebble-app.js:?: Tue Jan 12 2016 19:26:54 GMT-0800 (PBL): config changed
[PHONE] pebble-app.js:?: (+) [window 1] : [card 2],[window 1]
[PHONE] pebble-app.js:?: (-) [card 2] : [window 1]
[PHONE] pebble-app.js:?: Tue Jan 12 2016 19:26:54 GMT-0800 (PBL): Successfully fetched sitemaps: [{"name":"demo","label":"Main Menu","link":"http://demo.openhab.org:9080/rest/sitemaps/demo","homepage":{"link":"http://demo.openhab.org:9080/rest/sitemaps/demo/demo","leaf":false,"widgets":[]}},{"name":"_default","label":"Home","link":"http://demo.openhab.org:9080/rest/sitemaps/_default","homepage":{"link":"http://demo.openhab.org:9080/rest/sitemaps/_default/_default","leaf":false,"widgets":[]}}]
[PHONE] pebble-app.js:?: JavaScript Error:
TypeError: Cannot read property 'label' of undefined
    at createSitemapMenu (sitemap.js:37:21)
    at sitemap.js:85:20
    at req.onreadystatechange (lib/ajax.js:114:9)

I've not debugged this so not sure what the issue is.

clach04 commented 8 years ago

PebbleHAB has a similar problem (property 'length'). The new demo server reports it self as OpenHAB 2.

llamahunter commented 8 years ago

Currently not supporting openhab 2 until it gets closer to release (tho it does look like it finally went to beta). They must have changed the REST api, so it's unclear if it will be straightforward to support both openhab1 and openhab2 simultaneously from the watch app.

clach04 commented 8 years ago

Understood. I can't run OpenHAB2 on my setup as the addons I need are not available, and the demo (at least when I last checked) doesn't have any switches so testing is awkward.

I have a branch of PebbleHAB (not OpenHAB.pebble) https://github.com/clach04/PebbleHAB/tree/openhabv2 that doesn't freak out with v1 or the v2 beta payload. I think the api is close enough to support (hence making https://github.com/clach04/PebbleHAB/commit/ee608b955eb1963332204d746f448db82da2c82a ) but not something to pursue for a while until testing is easier.

kaikreuzer commented 8 years ago

They must have changed the REST api, so it's unclear if it will be straightforward to support both openhab1 and openhab2 simultaneously from the watch app.

I actually tried to not do many changes and started documenting it here.

The Android and iOS apps work quite ok with openHAB 2 without any special adaptions. I don't know what exactly you do in the Pebble app, but I doubt that supporting openHAB 2 will mean much effort. But I also think that it is no priority - I just want to signal that you do not have to expect a hugh migration effort!

and the demo (at least when I last checked) doesn't have any switches so testing is awkward.

What do you mean with no switches? It is the same demo setup as on openHAB 1 and if you go to the different rooms, all of them include switches.