Upload
peter-bosmans
View
112
Download
2
Tags:
Embed Size (px)
DESCRIPTION
A presentation about how Drupal can be used to control a home automation system build on VSCP.
Citation preview
Drupal Home automation with VSCP
Peter Bosmans
Concept
• Central swithpoint (teleruptors, relais)• Simple network of distributed controllers (Ex.
One for each room)• No master-slave network (SPOF), No need to
develop a new protocol• Open source – Open hardware– Firmware , protocol– Controle software
Home automation controle software
• Home remote (java – tomcat)• Linux MCE (based on Ubuntu)• Misterhouse (Perl – VSCP enabled)• Drupal– Webbased, permissions, taxonomy, …– Connection with a database (logging, views, …)– Expandable -> VSCP module
VSCP
• Very Simple Control Protocolhttp://sourceforge.net/projects/m2m/files/VSCP%20Specification/http://en.wikipedia.org/wiki/Very_Simple_Control_Protocol
• Open source multiplatform : windows, linux – multicontroller : PIC, AVR, ARM, …
• Runs on different physical layers–Level I : RS232, RS485, RF, CAN–Level II : Ethernet
• Event based• Configurable Modules
–Registers : I/O behavior, I/O zones-subzones –DM (Decision matrix) : Filter - Action
VSCP events
• Class : Collection of event types– INFORMATION(20) , ALARM(1), MEASUREMENT(10), ….
• Type : Type of event– CLASS INFORMATION : BUTTON(1), ON(3), OFF(4), BELOW LIMIT(10), …– CLASS MEASUREMENT : COUNT(1), TEMPERATURE(6), WEIGTH(3), …
• Zone : origination of event class-type– Basement(1), Ground floor(2), …
• Subzone : sub-origination of event class-type– Kitchen(1), Living room(2), Storage(3), Hall(4), …
Communicatie Drupal <-> VSCP
VSCPD– Gateway daemon between the CAN-network and IP-network.– DM for filter – action
•Incomming VSCP eventsCANbus -> USB2CAN convertor -> USB -> VSCPD -> DM -> PHPscript ->
XMLPRC• DM starts PHPscript with an INFORMATION ON/OFF VSCP event• PHPscript creates an XMLRPC call to drupal
•Outgoing VSCP eventsDrupal VSCP module -> VSCPD -> USB -> USB2CAN convertor -> CANbus
VSCP module• Taxonomy
– Level I Events : Already configured within xml-file (Taxonomy import/export module) – Zones-Subzones : configurable by user
• Hiërarchical• Synonymous field contains the de zone- of subzonenumber
• Contenttypes– VSCPevent : Elk VSCPevent heeft een corresponderende Drupal node
• Taxonomy : Determines het VSCP-event (class, type, zone, subzone)• Byte0 : Needed by specific events• Data : Needed by specific events• Node references (sended, received) : Connection between, the sended and received ,
VSCP events• Logtype : Type of logging ; through revisions of nodes of the contenttype VSCPlog• Log reference : Reference to the logging-node when using the type of logging through
revisions.• Button : The corresponding VSCP event of the node will be sended
– VSCPlog• Class, Type, Byte0, Zone, Subzone, Data : Field for the corresponding values.
VSCP module• Self-learning by every received event
– On Node niveau• check the VSCP class, type, zone en subzone• If the node doesn’t exists : create node• If the node exists :
– update node timestamp – Indien referentie naar een send event node : update de receive referentie in de send event
node – On Taxonomie niveau (Zone-Subzone)
• If the zone and/or subzone doesn’t exists : create the new term
• ReferencesTo connect the last received VSCP event to his corresponding sending VSCP event Ex.: - Connect ‘on/off events’ on ‘button events’.- Connect the event of a measured value on the determination event that sets a temperature.
VSCP module• Rules integration– Rule trigger :
• After a VSCP event is received
– Rule conditions : • VSCP event has zone• VSCP event has subzone• VSCP event has class• VSCP event had type• VSCP event had byte0• VSCP event had databytes
– Rule action : • Send a VSCP event
– Rule sets• Useful for scheduling VSCPevents
Demo : Technical structure
• Electrical installation
• Nodes : CAN based modulesConfiguration : IN1, OUT1 => Zone = 1 = ‘Basement’ ; Subzone = 1 = ‘Supply’IN2, OUT2 => Zone = 2 = ‘Ground floor’ ; Subzone = 1 = ‘Kitchen’IN3, OUT3 => Zone = 2 = ‘Ground floor’ ; Subzone = 2 = ‘Living room’
Demo : Drupal - VSCP• Configuration :
– Manual setup• Taxonomy ‘Zone-Subzone’• Content VSCPevent ‘Information – Button’
– Semi-Automatic with the self-learning mode• Taxonomy ‘Zone-Subzone’• Content VSCPevent ‘Information – On/Off’
– Connect the received VSCPevent to the corresponding sended VSCPevent.
• Views : – Buttons view : List of ‘Information - button’ VSCP events which contains a
relation to the last received ‘Information – On/Off’ event • Some rules examples :
– ButtonSendEvent : responsible to send the VSCPevent and refresh the page, after a little time delay.
– Basement Supply ON – Email : Sends a mail when someone the on the light of a specific room.
• Rulessets : – Schedules VSCPevents. Ex. Switch lights every 2 minutes– …
Future developments• More sensor integration (temperature, light, …)
• More widgets for drupal • Ajax integration• Drupal 7 migration• Integration of MQTT within the VSCP daemon
MQTT (MQ Telemetry Transport) : extremely lightweight ‘publish/subscribe’ messaging transport through a ‘broker’
• Integration of WS within the VSCP daemon (HTML5)
• https://www.thingspeak.com/, https://pachube.com/, …
Questions ??
Useful Links
VSCP : http://www.vscp.org/
VSCP source : http://sourceforge.net/projects/m2m/?source=directory
VSCP drupal module : http://drupal.org/sandbox/pbosmans/1429844
VSCP kiewit hardware module : https://sourceforge.net/p/vscpmodules/kiewit
Feedback & follow-up: http://drupalcampgent.be/feedback