Jump to content

php and home automation !


Mansour

Recommended Posts

Greetings !

i  have a project to make a web application used to control 10 devices over the internet and all i can use is :

JavaScript, PHP, HTML and MySQl ... 

the problem is : i dnt know from where to start ... can anyone help me with this

Thanks in advance :D

Link to comment
Share on other sites

Step one would be figuring out what sort of protocol you need to implement to talk to the devices you want to control. Once you've got that all figured out, the rest is relatively easy.

Agreed.

 

You also need to know 1) What data you can retrieve from the home automation (HA) system and 2) what commands you can send

 

From there you can determine what kind of interface and features to create.

 

Let's analyze a "possible" example: , suppose the HA system has a list of "zones" to control lighting. You should, hopefully, be able to query the HA system to get a list of those zones and the current lighting status (on/off). But, let's assume you only get names such as zone1, zone2, zone3, etc..

 

If that was the case, I would build at least a couple features:

1) I would build a management feature that allows the user to see the current list of zones reported from the HA system and assign a "friendly" names to them.

2) I would also have a status page that lists all the zones with their "friendly" names (if entered) along with the current lighting status. That page would probably include a link for each zone to add/modify the friendly name. It would also include a button to change the status of the lights from off to on or vice versa.

Link to comment
Share on other sites

My main problem is how to connect my web app to all of these hardware via router ! 

i dnt have any skill in electronics !

 

the question is : 

if i want to control lights in zone 1, how can i connect these light to the router so my web app can control it ?! 

Link to comment
Share on other sites

You seem to be lacking quite a bit in the area of pre-planning research, which is making the whole planning process a lot harder than what it needs to be. Hard to plan something, when you don't know what you have to work with, after all.

 

That is why I recommend that you start to research what protocols, APIs, gadgets and other tools are out there for HA. As well as anything else that is related to your project. Once you know what you have, you can figure out what is missing.

That is, assuming you have compiled a list of requirements, beyond just "a web application to control 10 devices". Equally hard to plan something when you don't know where you want to go, as when you don't know what's available. Going from point A to point B requires a knowledge of both points, after all.

Link to comment
Share on other sites

My main problem is how to connect my web app to all of these hardware via router ! 

i dnt have any skill in electronics !

 

the question is : 

if i want to control lights in zone 1, how can i connect these light to the router so my web app can control it ?! 

You don't connect your lights to the router. There has to be separate hardware to actually run home automation. Think of it like a home security system. You don't connect the door trigger to your phone line and have it contact the security company when there is a problem. There will be a central device that you connect all of the door/window/fare alarm/etc triggers to. Then you can program that device as to what each trigger is and any rules for when things should be armed and such. Then, whenever a device is triggered it is picked up by the central device that then contacts the security company (over your phone line) and reports the problem.

 

In the same way, for home automation you need a central device that is connected to all of the things you want to automate. In addition, you typically need something connected to each things you want to automate. So, for a light, you would have a small device that plugs into the outlet and the light plugs into that device. That device is connected to the "central device" via the network or a proprietary communication line. That central device will be the "brains" of the home automation and run all the connected equipment. It is THIS device that you will need to communicate with. So, without such a device in hand, there is no way to tell you how to proceed. You will need to get such a device and find out how you can communicate with it. You might be able to communicate with it through the network or you may have to connect it to a PC via serial port.

 

Here is an article entitle "An Introduction To Home Automation" which discusses hardware, protocols, web-based interfaces, etc.. I suggest you read it or go find some additional information on how home automation works. http://www.tomshardware.com/reviews/home-automation-insteon,2308.html

 

Did you pick this final project without having a clue on how home automation works?

Link to comment
Share on other sites

  • 2 weeks later...

Hi Mansour,

 

first, you must have a centralize box (i call it CB) function like router/switch. and it has a zigbee and wifi connection.

nowdays zigbee is a standard communication for device thats meet functionally to support Home Automation. you must find vendors that have built an automation device with CB. CB device can manage powermeter (swtiching device) to control the lamp. it just one of example, there is alot example that CB can do like to sensing temperature, detect security door or window and etc.

 

second, you must check the communication that CB can do with WIFI

some of them can communicate with porting. like API. and then CB will processing your command and answering it with JSON/XML data.

this JSON can generate information about home automation device in that area. like device listing, device status or many.

so from this JSON you can create or ilustrate on your Home automation web such as lamp and button for toogle the lamp.

 

third, to help you quickly, you can search home automation device and CB on same Vendors

many Home Automation device heading to Home Automation Alliance, but you must prove it by buy this device if they not on same vendor (risky).

i suggest you to buy device and CB on same vendor.

 

set your pc/laptop with XAMPP or LAMPP, try to create page to communicate to CB using API and do some magic to switching the lamp device (powermeter).

to list device that in the area and you must send a listing command (porting/API) and you will get JSON/XML data and you can processing it on your web application.

 

like this,

 

[WEBSERVER] <---wifi---> [CB] <---zigbee protocol---> ONE OR LOT OF [END DEVICE]

 

thats for all,

sorry for my bad english

Edited by oecoepz
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.