Webpage for mobile phone

Functionality and usage of the OpenNethome Server
Post Reply
pulse
Posts: 2
Joined: Fri Oct 23, 2015 6:29 pm

Webpage for mobile phone

Post by pulse »

Hi,

I was wondering if ONH comes with a mobile version of the site or is it possible to make it one yourself?


Image

regards,
pulse
stefangsbb
Site Admin
Posts: 313
Joined: Sun Nov 30, 2014 2:16 pm

Re: Webpage for mobile phone

Post by stefangsbb »

Unfortunately I have not had time to add a more mobile adapted WEB interface. I do use the current one on my phone, but it is not really adapted for the use...

It is possible to build your own web interface on top of OpenNetHome, there is an open REST-Interface suited for building WEB interfaces. See the documentation on: http://opennethome.org/interfaces/rest/.
pulse
Posts: 2
Joined: Fri Oct 23, 2015 6:29 pm

Re: Webpage for mobile phone

Post by pulse »

Thank you the answer, will look into the dokumentation!
regards/pulse
jas
Posts: 8
Joined: Wed Apr 15, 2015 7:35 am

Re: Webpage for mobile phone

Post by jas »

There is a small error in the REST documentation. In the beginning of the document the "action" syntax is shown correctly (POST /items/[ItemId]/actions/[action]/invoke), but later in section 1.5 is is show as /rest/items/[ItemId]/action, which is not correct.

I stumbled to this when I was using the REST interface in Python code which I called from the server. I could not get the actions working until I checked from the Java source code how it is supposed to be working :)
Later I got a bit tired with the external Python code and integrated jython into the server. Now I can call Python functions directly and access all items from Python code without the REST interface.
stefangsbb
Site Admin
Posts: 313
Joined: Sun Nov 30, 2014 2:16 pm

Re: Webpage for mobile phone

Post by stefangsbb »

Thanks for pointing out the typo on the REST page - fixed now!

The jython stuff sounded REALLY cool!! Integrating Python via jython into the server is on my (very long) wish list of things to have time to do... How did you do the integration? Is it something you would be willing to contribute to the project?
jas
Posts: 8
Joined: Wed Apr 15, 2015 7:35 am

Re: Webpage for mobile phone

Post by jas »

The jython integration was not really that complicated.
The most difficult part (at least for me) was to get the correct jython library to the maven repository.
I downloaded a jython library to the repository, but could not get it working. In the end I had to manually add the .jar file to the library before I was able to call the jython functions I wanted. I'm not really familiar with maven, so probably someone who knows what he is doing doesn't need to spend so much time with that :)

Python functions are called in a similar way as set, exec, etc. from the server: python,functionName('parameters')
Function parameters are passed as is and are not expanded. Parameter evaluation is done inside jython with eval() function.
From nethome server jython can access server and log instances, which are used for accessing items and writing to the log file.

Of course I'm willing to contribute to the project, if you think this would be useful.

I've done some other stuff too, which might be of interest to nethome users.
OnOffLogger
- this is like a lamp and has on and off actions, but instead of turning anything on/off, it logs the on/off times to a file.

SmsClient
- similar to XmppClient, but can send text messages via Dovado router.
Post Reply