Intro: Smart House Web Interface With VSCP
VSCP is a great solution to connect real life objects to the Internet, but in order to interact with a user you need to get some kind of interface.
This instructable shows a web interface that includes a few features for home automation e.g. house setup, light management, heating management, ventilation control, temperature and and resource statistics.
The purpose is to give an idea of what can be found in this kind of tool. This is just a very simple interface.
Step 1: Hardware and Software
What has been used here is:
- Raspberry Pi to host the VSCP deamon, the web interface and the database
- Latching relay module
- Temperature and humidity module
- UTP cable
- USB2CAN interface
- 24 V power supply to bring power over the UTP cable
The RPi hosts an apache web server, a MariaDB database and the VSCP deamon.
The web interface has been written from scratch using the Symfony PHP framework, the detail of the code will not be shown here, I will focus on the features of the web app, however I have no problem with sharing the code.
Step 2: The Main Menu
Access to all features is done via a drop down menu. It was a quick way for me to publish links to pages but I think it would be better to have big icons/buttons instead.
The menu is divided in three:
- Settings: create a house, its zones and subzones, register the nodes, etc...
- Action: act on the house e.g. switch lights, control heating and ventilation, open a door
- Visualization: get reports and charts on temperature, humidity, energy consumption
Step 3: Settings
You can create a house and save its characteristics.
All zones of the house can be created here. You can define the zone name and if it is heated (used later in the heating page). Each zone has a unique ID which is used to communicate with the nodes via VSCP.
3. Sub zones
It is a sub division of a zone, there is no connection between zones and subzones i.e. kitchen and bathroom zones can have the same "radiator" subzone. Each subzone has a unique ID which is used to communicate with the nodes via VSCP.
Nodes are registered with their unique VSCP ID. Each node is connected to a zone and subzone. A type is also connected to a node to get the function of the node.
Step 4: Action
1. Light management
All nodes with type "Light switch" are listed on this page.
Two buttons ON and OFF are used to control the lights, the status of the switch is displayed in real time with the bulb image.
The switch node sends it's status (ON or OFF) to the network and the VSCP daemon receives this message and updates a variable, this variable is then read every second by the web page using websockets.
All heated zones are displayed on this page showing eco, comfort and current temperature, heating mode and heating status. It also shows outside temperature and boiler status if a switch node is connected to a boiler.
Heating settings can be edited for each zone. Heating mode can be 'Eco', 'Comfort', 'No frost' (temperature won't go below 5 degrees celsius) or 'Auto'. If heating mode is auto then the week schedule is used to set the temperature to eco or comfort value depending on the current day and time.
A script runs every minute and reads all the above settings. Depending on the result it will send messages to the nodes to turn on or off radiators and the boiler.
This is the same as light management, you can turn on or off the ventilation system of the house.
Step 5: Visualization
This page displays a chart of the temperature for the selected date range. A table lists the details. Temperature nodes send the data every 15 minutes.
Same as for temperature
3. Resources (electricity, gas, water)
Nodes can be connected to meters and count consumption (Watts and Liters) and send the result every 15 minutes. The information can be viewed per month, week or day in order to get a detailed idea of how much is consumed, when and by which appliance.
Step 6: What's Next?
As you can see you can basically connect any real object to the Internet using VSCP, your imagination is the limit.
My ideas for the future is to connect motion detectors, smoke sensors, doors and locks and I'm sure I will find more ideas :-)
Thank you for reading!