-
-
Notifications
You must be signed in to change notification settings - Fork 361
HAA Templates
EXAMPLE TO LEARN: HomeKit Switch with UART output, inverted status LED, relay on GPIO 12, button connected to GPIO 0 and toggle connected to GPIO 14:
-
{"c":{"io":[[[13],3],[[12],2],[[0],6],[[14],6,1]],"o":1,"l":13,"i":1},"a":[{"t":1,"0":{"r":[{"g":12,"v":0}]},"1":{"r":[{"g":12,"v":1}]},"b":[{"g":0,"t":1},{"g":14,"t":1},{"g":14,"t":0}]}]}
-
Simplified version, removing all default values:
{"c":{"o":1,"l":13},"a":[{"0":{"r":[{"g":12}]},"1":{"r":[{"g":12,"v":1}]},"b":[{"g":0},{"g":14},{"g":14,"t":0}]}]}
{ <- Start of MEPLHAA Script
"c": { <- General config section
"io": [...], <- GPIOS Configuration
"o": 1, <- Enable UART log output
"l": 13, <- Enable status LED at GPIO 13
"i": 1 <- Set status LED to inverted mode
}, <- End of general config section
"a": [ <- Accessory section. Must be an array
{ <- First accessory, and the only
"t": 1, <- Accessory type 1 (Switch)
"0": { <- Actions triggered when HomeKit switch is set to OFF
"r": [ <- Digital outputs. Must be an array
{ <- First digital output (a relay), and the only
"g": 12, <- Relay connected to GPIO 12
"v": 0 <- Value assigned to the relay
} <- End of first relay
] <- End of relays array
},
"1": { <- Actions triggered when HomeKit switch is set to ON
"r": [ <- Digital outputs. Must be an array
{ <- First digital output (a relay), and the only
"g": 12, <- Relay connected to GPIO 12
"v": 1 <- Value assigned to the relay
} <- End of first relay
] <- End of relays array
},
"b": [ <- Buttons. Must be an array
{ <- First button
"g": 0, <- First button at GPIO 0
"t": 1 <- Set button to single press type
}, <- End of first button
{ <- Second button
"g": 14,<- Second button at GPIO 14
"t": 1 <- Set button to single press type
}, <- End of second button
{ <- Third button
"g": 14,<- Third button at GPIO 14, same as second button
"t": 0 <- Set button to single press opposite to 1 type
} <- End of third button
] <- End of buttons array
} <- End of first accessory
] <- End of accessories array
} <- End of MEPLHAA Script
{"a":[{"t":1},{"t":2}]}
{ <- Start of MEPLHAA Script
"a": [ <- Accessory section. Must be an array
{ <- First accessory
"t": 1 <- Accessory type Switch
}, <- End of first accessory
{ <- Second accessory
"t": 2 <- Accessory type Outlet
} <- End of second accessory
] <- End of accessories array
} <- End of MEPLHAA Script
Home Accessory Architect
Home Accessory
Installation
Setup Mode
HAA Home Manager App
Configuration
About
General
| GPIOs Configuration
Accessory
| Actions
Service Types
Air Quality
Battery
Data History
Fan
Free Monitor
Garage Door
HAA iAirZoning
Heater Cooler
Humidifier
Light Sensor
Lightbulb
Lock Mechanism
Sensors
Power Measure
Security System
Stateless Button & Doorbell
Switch & Outlet
Temperature & Humidity
TV
Water Valve
Window Covering