GPIO Inputs used in input board, presented as Event entity in Home Assistant. It works only with Home Assistant 2023.8 and newer!
Event entity sends mqtt message for actions single
, double
and long
presses.
event:
- id: IN_29
pin: P8_36
actions:
single:
- action: output
pin: light
action_output: toggle
```yaml title=“Example config if you use boneio:
configuration”
event:
## Configuration variables:
**All variables below are overwritting variables provided in `boneio:` configuration.**
- **id** (_Optional_, string, default: value of `{pin}`) - uniquely identifies this device in MQTT and Home Assistant.
- **boneio_input** (_Optional_, string, default) - Input name from boneIO controller.
- **pin** (**Required**, string) - GPIO id of Beaglebone board eg `P9_33`.
- **gpio_mode** (_Optional_, string, default: `gpio`, allowed_values: `['gpio', 'gpio_pu', 'gpio_pd', 'gpio_input']`) - How to run this gpio. gpio means default gpio mode. gpio_pu = gpio pull up, gpio_pd = gpio pull down, gpio_input - to be checked.
- **detection_type** (_Optional_, string, default: new, allowed_values: `['new', 'old']`) - There are 2 detector algorithms in dev version. Old consumes more CPU, but we got feedback that it works for everyone. new is more optimized, but needed users to test it. To get it done we introduced this option.
- **clear_message** (_Optional_, boolean, default: False) - Decide if after press/release callback send empty message to mqtt. Same as Zigbee2Mqtt is doing in button actions. Till 0.6.x it was true by default.
- **bounce_time** (_Optional_, timeperiod, default: 25 ms) - bounce time for GPIO to invoke callback. Use if default doesn't work for you. Making it to high might break click events functions for switch kind.
- **show_in_ha** (_Optional_, boolean, default: True) - Send autodiscovery message to Home Assistant.
- **device_class** (_Optional_, string, default: button, allowed_values: `["button", "doorbell", "motion"]`) - Type of device to see in Home Assistant.
- **inverted** (_Optional_, boolean, default: False) - Invert value of sensor input displayed in MQTT.
- **actions** (Optional, dictionary) - dictionary of predefined actions ([single, double, long]).
### Configuration variables if you use `boneio:` and `boneio_input:` configuration that can be ommited:
- **pin** (**Required**, string) - GPIO id of Beaglebone board eg `P9_33`.
- **gpio_mode** (_Optional_, string, default: `gpio`, allowed_values: `['gpio', 'gpio_pu', 'gpio_pd', 'gpio_input']`) - How to run this gpio. gpio means default gpio mode. gpio_pu = gpio pull up, gpio_pd = gpio pull down, gpio_input - to be checked.
## Actions
- **single** (_Optional_, list): list of actions to use if switch is single pressed.
- **double** (_Optional_, list): list of actions to use if switch is double pressed.
- **long** (_Optional_, list): list of actions to use if switch is long pressed.
## Action variables for action list
- **action** (_Optional_, string, default: output, allowed_values: `['mqtt', 'output', 'cover']`) - action type. Output and cover means that command is send directly to output relay or cover. This mode doesn't need network to work. Mqtt mean that there is extra action send to mqtt. For example you can directly control second boneIO!
- **pin** (Optional, string) - output pin id to perform action on. Use only with action type `output` or `cover`.
- **topic** (Optional, string) - topic to use if `mqtt` action is chosen
- **action_cover** (Optional, string, allowed_values: `['toggle', 'open', 'close', 'stop', 'toggle_open', 'toggle_close']`) - action to perform on `cover` type action. `toggle` is actions between open/close. `toggle_open` means actions between open/stop, `toggle_close` means actions between close/stop.
- **action_output** (Optional, string, allowed_values: `['toggle', 'on', 'off']`) - action to perform on `output` type action.
- **action_mqtt_msg** (Optional, string) - message to send to mqtt topic if action is `mqtt`.