A (hopefully) simple exmple of how to read and write to a Raspberry Pi gpio pins using Home Assistant.
Home Assistant utilizes binary_sensor to READ gpio ports and [switch] (https://home-assistant.io/components/switch/) to SET the state of gpio ports. This does not make intuitive sense when looking at the schematic.
-
Hardware
-
Upload code
Upload yamal files to /config directory
-
Restart Home Assistant
Open http://hassio.local:8123/states/group.foo . You should have port_21 sensor and led_1 switch. Toggle led_1 to turn on/off the physical LED.
The physical switch should also toggle the physical LED.
Feel free to remove any sections that aren't applicable to your project.
Please open an issue for support.
Please contribute using Github Flow. Create a branch, add commits, and open a pull request