Hi Richard,
It is great to see how users of WebBricks start to write their own scripts to run functions and we like to encurage this development. I shall answer your questions in two ways:
Option 1:
Option one to solve your problem ('pressing a button on one webbrick and issuing a single or multiple commands to other webbricks') is straight forward and suitable for the majority of WebBrick users and installers. We offer the WebBrick Gateway, which is a software application that can easily be configured to listen to WebBrick events and send out commands to other WebBricks. The WebBrick Gateway provides what we refer to as 'global inteligence', whilst the WebBrick Controllers provide 'local control'. The gateway provides many other useful features apart from simply mapping events from one WebBrick to another, such as:
- Central Scheduling Facilities
- HVAC Control
- Temperature and Energy Monitoring
- Conditional Evaluation of states around the house
- Astronomic Scheduling (i.e. based on sunrise & sunset)
- A rich User Itnerface
- etc.
At the moment the Webrick Gateway is distributed as a preinstalled appliance (a low-power embedded PC). We have a public WebBrick Gateway you can take a look at, to get an idea of the default userinterface we provide.
http://195.26.42.82:8080/
Option 2:
If you however want to keep writing your own python code, then by no means would we want to discourage this. I have to point out though that we cannot offer support for your custom code or be of assistance on queries about general python coding. We will however do out best to make sure that you have all the information about WebBricks you need to be able to write your own code.
As you rightly say WebBricks send out UDP packets on port 2552. These packets are boradcast packets and hence can be picked up by network device that is on the same subnet. You can use the WebBrick Monitor (which can be found here: http://community.webbricksystems.com/files/folders/441/download.aspx) to see these packets on your network or alernatively use a free application like Wire Shark. To write an application in python that listens for these UDP packets, you will have to open a socket and listen for packets on taht socket. Have a look at the inbuilt socket library in python, a minimal bit of code that opens a socket and listens for a single packet could look something like this:
>>> import socket
>>> s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
>>> s.bind(('',2552))
>>> s.setsockopt(socket.SOL_SOCKET, socket.SO_RCVBUF, 65536)
>>> data = s.recvfrom(32)
>>> data
('\rGST\t\x1a\\R\x00\x01X\xb0\xb0\x00\x00\x00', ('10.100.100.82', 4096))