Skip to content

Home assistant MQTT discovery to GPIO as switch enteties

Notifications You must be signed in to change notification settings

klaspihl/pico-gpio-mqtt

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Raspberry Pico to Home Assistant by MQTT

Home assistant MQTT discovery to GPIO as switch entities.

main.py in this project acts as a bridge between Home Assistant and your Raspberry Pico's GPIO pins. It connects to an MQTT broker, listens for Home Assistant's discovery messages, and configures GPIO pins as switch entities based on these messages. It also listens for commands from Home Assistant to control the state of these GPIO pins.

Installation

Update secrets.py with your WiFi and MQTT broker details.

Upload the project to your Raspberry Pico.

Home assistant MQTT discovery

platform: mqtt
device:
  name: Lego controller
  identifiers:
    - pico_1
  manufacturer: Raspberry
  model: Pico W
name: GPIO 0
payload_on: '1'
unique_id: pico_1_0
state_topic: pico/1/status/0
state_on: '1'
state:off: '0'
command_topic: pico/1/set/0
payload_off: '0'

Home assistant device

Home assistant device

About

Home assistant MQTT discovery to GPIO as switch enteties

Topics

Resources

Stars

Watchers

Forks

Languages