Garadget is the garage door "futurizer". It allows to monitor and operate your existing garage doors from smartphones, wearables and other devices. It's inexpensive, easy to install and developer friendly. For more information please visit http://www.garadget.com
The code in this repository is for the program that controls Garaget's hardware. It's C++ application similar to those created for popular Arduino boards. You are encouraged to study it, report the problems, modify it, try it with your Garadget and share.
At the core of the device is Particle Photon P1 module allowing Garadget to benefit from:
- powerful hardware
- feature rich firmware libraries
- LAN and Internet connectivity
- numerous developer resources
Garadget communicates with the clients via Particle cloud by
- exposing variables to report status and configuration
- accepting function calls to change status and update configuration
- publishing events to report status changes and send alerts
String status=%s|time=%u%c|sensor=%u|signal=%d
where
status
- is current status of the door such asopen
,closed
etctime
- time in that status 0-119s, 2-119m, 2-47h, 2+dsensor
is the sensor reflection rate 0-100signal
is WiFi signal strength in dB
String ver=%d.%d|cnt=%d|rdt=%d|mtt=%d|mot=%d|rlt=%d|rlp=%d|srr=%d|srt=%d|aev=%d|aot=%d|ans=%d|ane=%d
containing pipe separated value for firmware version and timing parameters (all numeric):
ver
- version, dot separated major and minor (currently 1.6)rdt
- sensor scan interval in mS (200-60,000, default 1,000)mtt
- door moving time in mS from completely completely opened to completely closed (1,000 - 120,000, default 10,000)rlt
- button press time mS, time for relay to keep contacts closed (10-2,000, default 300)rlp
- delay between consecutive button presses in mS (10-5,000 default 1,000)srr
- number of sensor reads used in averaging (1-20, default 3)srt
- reflection threshold below which the door is considered open (1-80, default 25)aev
- number serving as bitmap for enabling status alerts (starting from LSB: closed, open, closing, opening, stopped, init, online, offline, config)aot
- alert for open timeout in seconds (0 disables, default 1,200 - 20min)ans
- alert for night time start in minutes from midnight (same value as ane disables, default 1320 - 10pm)ane
- alert for night time end in minutes from midnight (same value as ans disables, default 360 - 6am)tzo
- float number for hours offset from GMT and optional character to resolve ambiguity where multiple locations are in the same offset. Full list is available in alerts configuration page of web interface
String ip=%d.%d.%d.%d|snet=%d.%d.%d.%d|gway=%d.%d.%d.%d|mac=%02X:%02X:%02X:%02X:%02X:%02X|ssid=%s
where
ip
- IP addresssnet
- subnetgway
- gatewaymac
- MAC address of the device
Requests change of door state. As parameter the function receives a string containing a new state such as (open
, closed
, stop
)
Updates doorConfig parameters as listed above. As parameter the function receives a string containing pipe delimited values for doorConfig
that need to be updated e.g. srr=5|rlp=%d
. Omitted parameters will remain unchanged, the order of parameters is not important. The length is limited to 63 characters so the request for multiple changes may need to be split into multiple calls. Additional write only nme
parameter is available to notify the unit about the name change.
Published when state of the door changes, parameter is the new state. This event can be used to update the UI.
Published when alert is generated or device configuration changes. Parameter is JSON with the type of alert and related data. Multiple alert types are supported:
Published when state of the door or device changes and alert for the new state is enabled in configuration (aev
setting).
Example JSON: {"name": "Home", "type": "state", data: "opening"}
Published when door remains open longer than the configured timeout, parameter is the configured timeout (aot
setting).
Example JSON: {"name": "Home", "type": "timeout", "data": "20m"}
Published when door remains opens at the beginning of the configured night period or opened during that period. Parameter is the configured time of start of the night period. Parameter is configured time range (ans
and ane
settings).
Example JSON: {"name": "Home", "type": "night", "data": "1320-360"}
Published when device configuration is updated, parameter is the updated configuration string.
Example JSON: {"name": "Home", "type": "config", "data": "ans=1320|ane=360|tzo=-7.0"}
- Garadget Community Forum - post your questions, ideas and requests.
- Particle Build - web based development environment. Edit, compile and upload your new code wirelessly.
- Particle Dashboard - monitor cloud events
- Particle Documentation - Photon documentation
- Particle Community Forum