Relay Configuration (Raspberry Pi)

Relays are a great way to control high power devices using our raspberry pis low voltage GPIO. MudPi allows you add relays and control them by publishing events over redis to the channel the relay is listening on.

Below is an example of a relay configuration.

    "relays": [
            "name": "Relay 1",
            "pin": 27,
            "normally_open": true,
            "group": "group1",
            "topic": "garden/pi/relays/1",
            "key": "relay_1"


name[String]NoFriendly display name of the relay. Useful for UI.
pin[Integer]YesGPIO pin on the raspberry pi the relay is connected to.
normally_open[Boolean]NoType of relay connection normally open or normally closed. Default False
key[String]YesA unique slug value that is used to identify the relay. This value with also used as they key with '_state' appended to store relay state in redis. i.e. relay_1_state
group[String]NoAssign relay to a group to control multiple relays at once.
topic[String]NoChannel that relay will listen for command on. If relays share a channel they will both trigger when a command is sent! Default 'mudpi/relay'
restore_last_known_state[Boolean]NoA setting that when the system crashes, it enables relays to look for the last saved state in redis and attempt to restore it. Default False

Learn more about relays and how to trigger them under the relay docs.