New PHP Web Interface

  • 708 Views
  • Last Post 11 March 2016
Axial-User posted this 10 October 2014

I am working on an inControl web interface written in PHP with jquery. It is dynamic HTML using ajax, and is intended to eventually be a functional clone of the inControl widows interface.

There is a screenshot here, with the a thermostat device selected: http://snag.gy/8I4of.jpg

The source is on GitHub : https://github.com/ahagadorn/incontrol-web

Take a look at the README.md, all you have to do is get the zip file, unzip it on your web server and change the config.php. No other software besides PHP is required, and it does not use a database.

Please give it a try and let me know here if you find any bugs. I will be working on many enhancements, this is just the beginning of what I plan to do with it. I have found it to be very stable and useful to me anyway, hopefully others will find it useful too.

Order By: Standard | Newest | Votes
monkey-magic posted this 12 October 2014

I'll give it a go if it can turn on individual devices.

Just have to get a VM setup.

josh

Axial-User posted this 12 October 2014

It generally works just like the standard interface, except instead of having power buttons for on/off you click on the device icon.

Let me know here if you have any issues.

Axial-User posted this 12 October 2014

I just committed an update that groups devices by room, if you already got it, just grab functions.php and styles.css. I have not updated the screenshot yet.

ftsikogi posted this 17 October 2014

  1. I have installed the WinLAMP mini installation
    http://winlamp.sourceforge.net/?module=download
    2. I have decompressed the source code
    3. And configured the config file.

    The result is that the page loads with no errors and with tab name showing "incontrol", but the rest of the page is empty.

    Any ideas?

    I am using the 3.114 version of Incontrol

Axial-User posted this 17 October 2014

Most likely it is a PHP problem. Check your web server error log, and there is also a log for the app called api_error.log.

monkey-magic posted this 17 October 2014

Seems to work pretty well so far. Only issue I've hit is that for lights it can turn off the light but doesn't seem to turn them on.

When the toggle is pressed inControl changes to powered but after a few seconds it switches back to off.

Are you thinking of adding scenes in at some stage in the future?

@ftsikogi
for the IP address of inControl, are you using local host or IP address? there is no http:// in it, just 192.168.xx.xx
Picked that up looking at the logs.

Josh

Axial-User posted this 18 October 2014

When you switch something, it should show the status from InControl within 5 seconds. It may depend on how short your InControl polling interval is set for. Mine is set for 5 seconds.

I already have scenes working in the next version, I just haven't uploaded it to GitHub yet. It also shows rooms now.

monkey-magic posted this 18 October 2014

Incontrol does show the status change but the lights don't go on. After a few seconds it updated back to off (since they didn't turn on) and the the welfare updates as well if that makes sense.
Josh

Axial-User posted this 18 October 2014

That is really strange, it works perfectly for me, I have been using it regularly. Just to clarify, are you saying that InControl shows the change temporarily, but the light doesn't come on and then the status changes back to off? Are you using a Z-Stick? Lights work correctly from InControl?

monkey-magic posted this 18 October 2014

Correct.

Web Off - InControl Off - Light Off

Web On - InControl On - Light Off
Couple of seconds
Web Off - Incontrol Off - Light still Off.

Josh

Ryan-Scott posted this 18 October 2014

Correct.

Web Off - InControl Off - Light Off

Web On - InControl On - Light Off
Couple of seconds
Web Off - Incontrol Off - Light still Off.

Josh


So it seems like the web is telling InControl to to turn the light on, but the z-wave signal isn't making it out to the light?

@ahagadorn: how are you sending a power on/off command to InControl?

@Josh: Does the light turn on/off OK if you use the native GUI? If you audit that light, do you get any logs in your logfile.txt suggesting it attempted to turn on/off?

Axial-User posted this 18 October 2014

You are running it on Linux, right? It sounds like an older version of functions.php.

I just uploaded the lates version with scene support to GitHub. You can grab the whole thing using the "Download ZIP" button on the lower right. You can just unzip it in your web directory, the only file you need to retain is your config.php, and that is now config.php.sample in the distribution with instructions on renaming it in the README.md for new installations. Let me know if that fixes it, I am still a little new at GitHub.

And thanks for trying it, I need to get your issue fixed.

Andy

Axial-User posted this 18 October 2014

Ryan,

This is snipped right out of the code - it works perfectly every time for me. powered is true for any on level, false for off.

[code]setDeviceState?nodeId=".$id."&powered=" . $powered . "&level=".$level."&password=".$pass;[/code]

Josh, you are not by chance double-clicking the icon, are you? Dumb question I know, but it will cause what you describe. Single click is what it expects. <- this="" turns="" out="" to="" be="" false,="" it="" works="" fine="" either="" way,="" single="" click="" or="">

Andy

Axial-User posted this 18 October 2014

Here's a couple screenshots of the latest version

http://snag.gy/plcoc.jpg

http://snag.gy/A3JNP.jpg

Axial-User posted this 18 October 2014

Hey Josh - what browser are you using?

monkey-magic posted this 19 October 2014

Hey thanks for doing this, I like the individual activation of devices. It was the main drawback of the other one that was there for a bit.

Light turns on and off okay with InControl's GUI.

Turns off okay with the webpage but not on.
InControl GUI shows that it registers the command from the webpage as the Power Icon lights up but after a second or two it turns off again and the webpages updates back to off.
Running Chrome but have also tried on IE.
have restarted both VMs, the Windows running InControl and Ubuntu 14.04.1 Server running LAMP stack.
Not double clicking.

The log file does sometimes show, but not always:
: Properties requested for device xxxxxxx (Which is the correct light)
: Found device: yes

Hope that helps but I'm not sure what is happening.

Josh

ftsikogi posted this 19 October 2014

Most likely it is a PHP problem. Check your web server error log, and there is also a log for the app called apierror.log.


I tried to reinstall PHP and apache but with the same results.
The only error I can find from the PHP log is the following:
PHP Notice: Undefined index: visible in C:\xampp\htdocs\functions.php on line 53

api
error.log is empty.

Any ideas?

Thanks

Axial-User posted this 19 October 2014

Most likely it is a PHP problem. Check your web server error log, and there is also a log for the app called apierror.log.

I tried to reinstall PHP and apache but with the same results.
The only error I can find from the PHP log is the following:
PHP Notice: Undefined index: visible in C:\xampp\htdocs\functions.php on line 53

api
error.log is empty.

Any ideas?

Thanks



Is it completely blank, or do you see two grey boxes? PHP Notice can be ignored, if you get PHP Error, that's a problem. Ar there any errors in the Apache error_log?

Axial-User posted this 19 October 2014

Josh,

What kind of device is it? Do you have more than one device and they all act the same way? Do you have a thermostat, and have you tried that?

I am running on Debian, which is the same as Ubuntu. I'm sure we will figure it out, but right now I am stumped. You don't get a question mark for an icon, do you?

One thing to try is if it is defined as a StandardSwitch in IC, change it to DimmerSwitch, or vice-versa. See if that makes it work.

Andy

ftsikogi posted this 19 October 2014

Most likely it is a PHP problem. Check your web server error log, and there is also a log for the app called apierror.log.

I tried to reinstall PHP and apache but with the same results.
The only error I can find from the PHP log is the following:
PHP Notice: Undefined index: visible in C:\xampp\htdocs\functions.php on line 53

api
error.log is empty.

Any ideas?

Thanks



Is it completely blank, or do you see two grey boxes? PHP Notice can be ignored, if you get PHP Error, that's a problem. Ar there any errors in the Apache errorlog?


There are no errors in the Apache error
_log. I can see the two grey boxes.

Show More Posts
Close