kaikreuzer / openhab.winrt

Repository to host openHABs' native Windows client
5 stars 3 forks source link

openhab App for Windows 10 #1

Open altima opened 8 years ago

altima commented 8 years ago

Hi,

I start developing a new openhab app for Windows 10. Currently it is in an early state, but first stuff is working right: https://github.com/altima/openhabUWP

https://youtu.be/M-G_SNrDUqk

I would like to share the code with this repository to get an app that seamless work with the new windows 10 systems (phone and desktop/table)

When you want more inforamtion, ask me :)

kaikreuzer commented 8 years ago

@altima, that's great news!

I would like to share the code with this repository

You probably mean to replace the code of this repository with yours, right? I doubt that there is anything that could be merged and reused. As this code here never made it to an real app, I would very much welcome this. You could become the official maintainer of the Windows app with full access to the repo.

As you are just starting with the app, I wonder if it might not be a better idea to directly target openHAB 2 with it. You might have come across https://github.com/openhab/openhab/issues/765, which prevents proper server push of events - which is likely to be a pain for your app. In openHAB 2, I have introduced SSE that work pretty well for server push. Let me know, if you have any questions!

altima commented 8 years ago

Thanks for reply. Currently I'm using openhab 1 on a raspi. It is only a small setup for integrating RWE samrthome and using it via mobile. That's the way why I started the development for openhab 1. On the other side I have to reinstall my notebook... I will also setup a openhab 2 demo instance for checking the rest service. I will also migrate my openhab 1 instance to the new version and reimplement the service to my current small app.

btw. SSE was new to me :) so this link os only for me as a hint: https://github.com/ServiceStack/ServiceStack/wiki/Server-Events

have a nice week :+1:

kobush commented 8 years ago

@altima I have started work on another Win8.1 client some time ago but never actually finished it. Still maybe you can pick something from it https://github.com/kobush/OpenHab.Windows

Let me know if you need some help with coding.

kaikreuzer commented 8 years ago

I will also setup a openhab 2 demo instance for checking the rest service.

Should be fairly easy if you follow https://github.com/openhab/openhab2/blob/master/docs/sources/development/ide.md.

btw. SSE was new to me :)

Yeah, this isn't well known, but I think it is just the right thing for push events and it works pretty smoothly so far.

altima commented 8 years ago

@kobush thanks for sharing the repo, I will have a look :+1: @kaikreuzer thanks for the link, but for now I only use the openhab 2 runtime package with demo stuff :)

I will commit an update with the new rest service from openhab 2. It contains the initial sitemap loading... after it, I will try to implement the SSE stuff ;)

gn8 :+1:

kaikreuzer commented 8 years ago

for now I only use the openhab 2 runtime package

Ok, that is of course even simpler :-)

FYI: Please be aware of https://github.com/eclipse/smarthome/issues/640 - there is still a missing feature to get the correct formatting of values through SSE, but this should not stop you from using SSE.

altima commented 8 years ago

found a simple way to get events by http long polling. for c# there is no lib to retrieve SSE. :D It is more simple and great workaround to get the events from openhab ;)

http://danielwertheim.se/2013/09/15/using-c-and-httpclient-to-consume-continuously-streamed-results/ (many thanks to the author of the article)

i will update also the openhab 1 lib for using same stuff. With this snippet it could be possible to create a client that can interact with both versions of openhab (like the android app already do) :)

UPDATE:

here the line of the updated method to retrieve events: https://github.com/altima/openhabUWP/commit/d94e822319cca876fb71373ee779794645044007#diff-5cd1ded90572d9a324a89aa56698643eR113 :+1:

danielwertheim commented 8 years ago

The link above has changed and should be: http://danielwertheim.se/using-c-and-httpclient-to-consume-continuously-streamed-results/