-
-
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":{"o":1,"l":13,"i":1},"a":[{"t":1,"0":{"r":[{"g":12,"v":0}]},"1":{"r":[{"g":12,"v":1}]},"b":[{"g":0,"p":1,"t":1},{"g":14,"p":1,"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 JSON
"c": { <- General config section
"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
"p": 1, <- Enable internal pull-up resistor
"t": 1 <- Set button to single press type
}, <- End of first button
{ <- Second button
"g": 14,<- Second button at GPIO 14
"p": 1, <- Enable internal pull-up resistor
"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 JSON
- {"a":[{"t":1},{"t":2}]}
{ <- Start of JSON
"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 JSON
- {"c":{"l":13,"b":[{"g":0,"t":5}]},"a":[{"0":{"r":[{"g":12}]},"1":{"r":[{"g":12,"v":1}]},"b":[{"g":0}]}]}
- {"c":{"l":13,"b":[{"g":0,"t":5}]},"a":[{"0":{"r":[{"g":12}]},"1":{"r":[{"g":12,"v":1}]},"b":[{"g":0},{"g":14},{"g":14,"t":0}]}]}
- {"c":{"l":13,"b":[{"g":0,"t":5}]},"a":[{"0":{"r":[{"g":12}]},"1":{"r":[{"g":12,"v":1}]},"b":[{"g":0},{"g":4},{"g":4,"t":0}]}]}
- {"c":{"l":13,"b":[{"g":10,"t":5}]},"a":[{"0":{"r":[{"g":12}]},"1":{"r":[{"g":12,"v":1}]},"b":[{"g":0}]},{"0":{"r":[{"g":5}]},"1":{"r":[{"g":5,"v":1}]},"b":[{"g":9}]}]}
- {"c":{"l":13,"b":[{"g":0,"t":5}]},"a":[{"0":{"r":[{"g":12}]},"1":{"r":[{"g":12,"v":1}]},"b":[{"g":0}]},{"0":{"r":[{"g":5}]},"1":{"r":[{"g":5,"v":1}]},"b":[{"g":9}]},{"0":{"r":[{"g":4}]},"1":{"r":[{"g":4,"v":1}]},"b":[{"g":10}]}]}
- {"c":{"l":13,"b":[{"g":0,"t":5}]},"a":[{"0":{"r":[{"g":15}]},"1":{"r":[{"g":15,"v":1}]},"b":[{"g":14}]},{"0":{"r":[{"g":12}]},"1":{"r":[{"g":12,"v":1}]},"b":[{"g":0}]},{"0":{"r":[{"g":5}]},"1":{"r":[{"g":5,"v":1}]},"b":[{"g":9}]},{"0":{"r":[{"g":4}]},"1":{"r":[{"g":4,"v":1}]},"b":[{"g":10}]}]}
Shelly1 Switch with external toggle switch. Note that "t":1 is not present because is the default option:
- {"a":[{"0":{"r":[{"g":4}]},"1":{"r":[{"g":4,"v":1}]},"b":[{"g":5,"p":0},{"g":5,"t":0}]}]}
- {"c":{"b":[{"g":5,"p":0,"i":1,"t":5}]},"a":[{"0":{"r":[{"g":4}]},"1":{"r":[{"g":4,"v":1}]},"b":[{"g":5}]}]}
- {"c":{"l":0},"a":[{"0":{"r":[{"g":15}]},"1":{"r":[{"g":15,"v":1}]},"b":[{"g":4,"p":0},{"g":4,"t":0}]}]}
- {"c":{"l":0,"b":[{"g":2,"t":5}]},"a":[{"0":{"r":[{"g":15}]},"1":{"r":[{"g":15,"v":1}]},"b":[{"g":5,"p":0},{"g":5,"t":0}]},{"0":{"r":[{"g":4}]},"1":{"r":[{"g":4,"v":1}]},"b":[{"g":13,"p":0},{"g":13,"t":0}]}]}
- {"c":{"l":0,"b":[{"g":2,"t":5}]},"a":[{"0":{"r":[{"g":15}]},"1":{"r":[{"g":15,"v":1}]},"b":[{"g":5,"p":0,"i":1}]},{"0":{"r":[{"g":4}]},"1":{"r":[{"g":4,"v":1}]},"b":[{"g":13,"p":0,"i":1}]}]}
- {"c":{"l":13,"b":[{"g":0,"t":5}]},"a":[{"t":2,"0":{"r":[{"g":12}]},"1":{"r":[{"g":12,"v":1}]},"b":[{"g":0}]}]}
- {"c":{"l":4,"b":[{"g":13,"t":5}]},"a":[{"t":2,"0":{"r":[{"g":5}]},"1":{"r":[{"g":5,"v":1}]},"b":[{"g":13}]}]}
- {"c":{"b":[{"g":0,"t":5}]},"a":[{"t":3,"f0":[{"g":0}],"f1":[{"g":0,"t":2}],"f2":[{"g":0,"t":3}]}]}
- {"c":{"b":[{"g":0,"t":5}]},"a":[{"t":3,"f0":[{"g":0}],"f1":[{"g":0,"t":2}],"f2":[{"g":0,"t":3}]},{"t":3,"f0":[{"g":2}],"f1":[{"g":2,"t":2}],"f2":[{"g":2,"t":3}]},{"t":1}]}
Sonoff Basic with Switch and Motion Sensor connected to GPIO 14, with status LED, and button to enter setup mode:
- {"c":{"l":13,"b":[{"g":0,"t":5}]},"a":[{"0":{"r":[{"g":12}]},"1":{"r":[{"g":12,"v":1}]},"b":[{"g":0}]},{"t":12,"i":10,"f1":[{"g":14}]}]}
- {"c":{"l":13,"b":[{"g":0,"t":5}]},"a":[{"0":{"r":[{"g":12}]},"1":{"r":[{"g":12,"v":1}]},"b":[{"g":0}]},{"0":{"r":[{"g":5}]},"1":{"r":[{"g":5,"v":1}]},"b":[{"g":9}]},{"0":{"r":[{"g":4}]},"1":{"r":[{"g":4,"v":1}]},"b":[{"g":10}]}]}
- {"c":{"l":13,"b":[{"g":0,"t":5}]},"a":[{"0":{"r":[{"g":12}]},"1":{"r":[{"g":12,"v":1}],"m":[{"g":2},{"g":3}]},"b":[{"g":0}]},{"0":{"r":[{"g":5}]},"1":{"r":[{"g":5,"v":1}],"m":[{"g":1},{"g":3}]},"b":[{"g":9}]},{"0":{"r":[{"g":4}]},"1":{"r":[{"g":4,"v":1}],"m":[{"g":1},{"g":2}]},"b":[{"g":10}]}]}
- {"c":{"l":13,"b":[{"g":0,"t":5}]},"a":[{"t":21,"s":5,"g":14,"0":{"r":[{"g":12}]},"1":{"a":0},"3":{"r":[{"g":12,"v":1}]},"5":{"a":0}}]}
- {"c":{"l":13,"b":[{"g":0,"t":5}]},"a":[{"t":22,"g":14,"n":3},{"0":{"r":[{"g":12}]},"1":{"r":[{"g":12,"v":1}]},"b":[{"g":0}]}]}
- {"c":{"l":2,"b":[{"g":13,"t":5}]},"a":[{"t":2,"0":{"r":[{"g":15},{"g":0,"v":1}]},"1":{"r":[{"g":15,"v":1},{"g":0}]},"b":[{"g":13}]}]}
- {"c":{"l":2,"b":[{"g":13,"t":5}]},"a":[{"t":30,"r":15,"g":12,"v":14,"w":4,"b":[{"g":5,"p":0},{"g":5,"t":0},{"g":13}]}]}
- {"c":{"b":[{"g":0}]},"a":[{"t":30,"r":14,"g":12,"v":13,"w":4,"fr":4,"fg":4,"fv":4}]}
- {"c":{"b":[{"g":0,"t":5}]},"a":[{"t":30,"r":15,"g":13,"v":12,"w":14,"b":[{"g":0}]}]}
- {"c":{"b":[{"g":0,"t":5}]},"a":[{"t":30,"r":15,"g":13,"v":12,"b":[{"g":0}]}]}
Sonoff with HomeKit Garage Door adaptation (Working time: 18 seconds. Only close sensor connected to GPIO 14 and stop-step. Dry relay connected to action garage door button):
- {"c":{"l":13,"b":[{"g":0,"t":5}]},"a":[{"t":40,"d":18,"f3":[{"g":14,"t":0}],"f4":[{"g":14}],"0":{"r":[{"g":12,"v":1,"i":0.5}]},"1":{"a":0},"2":{"r":[{"g":12,"i":1.5},{"g":12,"v":1,"i":0.5},{"g":12,"v":1,"i":2}]},"3":{"a":2}}]}
Sonoff SV with HomeKit Garage Door adaptation and additional switch to emergency stop (Working time: 18 seconds. Close and open sensor connected to GPIO 14 and 4. With stop-step. Dry relay connected to action garage door button):
- {"c":{"l":13,"b":[{"g":0,"t":5}]},"a":[{"t":40,"d":18,"f3":[{"g":14,"t":0}],"f4":[{"g":14}],"f2":[{"g":4,"t":0}],"f5":[{"g":4}],"0":{"r":[{"g":12,"v":1,"i":0.5}]},"1":{"a":0},"2":{"r":[{"g":12,"i":1.5},{"g":12,"v":1,"i":0.5},{"g":12,"v":1,"i":2}]},"3":{"a":2},"10":{"a":0}},{"i":1,"1":{"m":[{"g":1,"v":2}]}}]}
Sonoff Dual Window Covering driver with external push buttons, status LED and built-in setup button (Opening time: 18 seconds. Closing time: 14 seconds. Non-lineal correction: 70%):
- {"c":{"l":13,"b":[{"g":10,"t":5}]},"a":[{"t":45,"o":18,"c":14,"f":70,"0":{"r":[{"g":12,"v":1},{"g":5}]},"1":{"r":[{"g":12},{"g":5,"v":1}]},"2":{"r":[{"g":12},{"g":5}]},"3":{"r":[{"g":12,"i":1},{"g":5}]},"4":{"r":[{"g":12},{"g":5,"i":1}]},"f3":[{"g":0}],"f4":[{"g":9}]}]}
Shelly2.5 Window Covering driver with external switches, status LED and built-in setup button (Opening time: 18 seconds. Closing time: 14 seconds. Non-lineal correction: 70%):
- {"c":{"l":0,"b":[{"g":2,"t":5}]},"a":[{"t":45,"o":18,"c":14,"f":70,"0":{"r":[{"g":15,"v":1},{"g":4}]},"1":{"r":[{"g":15},{"g":4,"v":1}]},"2":{"r":[{"g":15},{"g":4}]},"3":{"r":[{"g":15,"i":1},{"g":4}]},"4":{"r":[{"g":15},{"g":4,"i":1}]},"f0":[{"g":5,"p":0}],"f1":[{"g":13,"p":0}],"f2":[{"g":5,"t":0},{"g":13,"t":0}]}]}
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