Skip to content

Latest commit

 

History

History

ha_mqtt_switch

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 

MQTT Switch - Home Assistant

A simple example to control a switch connected to a NodeMCU board (ESP8266).

Configuration

configuration.yaml :

switch:
  platform: mqtt
  name: 'Office Switch'
  state_topic: 'office/switch1/status'
  command_topic: 'office/switch1/set'
  retain: true
  optimistic: false

Schematic

  • Switch leg 1 - VCC
  • Switch leg 2 - D1/GPIO5 - Resistor 10K Ohms - GND

Schematic