• 10 dec 2017: forum version update. In case of issues use this topic.
  • 30 nov 2017: pilight moved servers. In case of issues use this topic.
Hello There, Guest! Login Register


Working on a Add Device Page
#1
I'm still working on it, no fancy stuff yet. Though I got most of the PHP is working(Only part to be done is changing the actual config file instead of a fake one).

It uses pilight-receive a bit of html and the rest is php.

Demo:
http://recordit.co/Sud9JAMcFR

What do you guys think of it? Also what would be the best practise to change the config file? Stop service -> change config -> start service?
 
Reply
#2
It would be ofc best if you could help me implement this in plain jQuery. If you are willing to, i can add the API for it so we can edit the config on the fly.
 
Reply
#3
@curlymo i currently working on an ionic app and it would be nice if there would be an api for this.
 
Reply
#4
What's an ionic app?
 
Reply
#5
@curlymo http://ionicframework.com/

Could you add a API pilight-receive? The way I'm doing it now, requires www-date to have access to all of sudo without password. Then access the user pi and runs the command "timeout 5 pilight-receive".

The way I'm doing it now is complicated and is horribly insecure, also the output of pilight-receive is not valid json because it contains multiple root elements. In order to work with this invalid json I'm scraping it with reg-ex which also isn't the best way to go.

I was looking for a API along the following lines:

Code:
{
    "message": "pilight-receive",
        "time": "5"
}

and maybe to add a device to the config something like this:

Code:
{
    "message": "add-device",
    "protocol": "kaku_switch",
    "code": {
        "id": 1234,
        "unit": 0,
    }
}

Last question, on what IRC server is the #pilight channel?
 
Reply
#6
There already is a pilight-receive API. Check the pilight-receive source code.

irc.freenode.net
 
Reply
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  Cannot connect to WebGUI von BlackBerry 10 device. muecke 2 1,572 12-02-2016, 10:22 AM
Last Post: muecke
  Same device in multiple groups troccolo 3 2,350 03-17-2015, 01:52 PM
Last Post: pilino1234

Forum Jump:


Browsing: 1 Guest(s)