Advertisement
gio_aggiustatutto

Example code

Feb 22nd, 2025 (edited)
382
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.77 KB | None | 0 0
  1. #This is just an example of how the code should look like in the end.
  2.  
  3. esphome:
  4.   name: rgbw-all-in-one-controller
  5.   friendly_name: RGBW all-in-one controller
  6.  
  7. esp32:
  8.   board: esp32dev
  9.   framework:
  10.     type: arduino
  11.  
  12. # Enable logging
  13. logger:
  14. # Enable Home Assistant API
  15. api:
  16.   encryption:
  17.     key: "generated_automatically"
  18.  
  19. ota:
  20.   password: "generated_automatically"
  21.  
  22. wifi:
  23.   ssid: your_wifi_ssid
  24.   password: your_wifi_password
  25.  
  26.   manual_ip:
  27.    # Set this to the IP of the ESP
  28.     static_ip: 192.168.1.96
  29.     # Set this to the IP address of the router. Often ends with .1
  30.     gateway: 192.168.1.1
  31.     # The subnet of the network. 255.255.255.0 works for most home networks.
  32.     subnet: 255.255.255.0
  33.  
  34.   # Enable fallback hotspot (captive portal) in case wifi connection fails
  35.   ap:
  36.     ssid: "Rgbw-All-In-One-Controller"
  37.     password: "generated_automatically"
  38.  
  39. captive_portal:
  40. output:
  41.   - platform: ledc
  42.     pin: 26
  43.     id: red_output
  44.  
  45.   - platform: ledc
  46.     pin: 18
  47.     id: green_output
  48.  
  49.   - platform: ledc
  50.     pin: 19
  51.     id: blue_output
  52.  
  53.   - platform: ledc
  54.     pin: 23
  55.     id: white_output
  56.  
  57. light:
  58.   - platform: rgbw
  59.     name: "LED strip"
  60.     red: red_output
  61.     green: green_output
  62.     blue: blue_output
  63.     white: white_output
  64.     color_interlock: true
  65.  
  66. i2c:
  67.   sda: GPIO21
  68.   scl: GPIO22
  69.   scan: true
  70.  
  71. sensor:
  72.   - platform: sht3xd
  73.     temperature:
  74.       name: "Temperature"
  75.     humidity:
  76.       name: "Humidity"
  77.     address: 0x44
  78.     update_interval: 5s
  79.  
  80.   - platform: bh1750
  81.     name: "Illuminance"
  82.     address: 0x23
  83.     update_interval: 5s
  84.  
  85. binary_sensor:
  86.   - platform: gpio
  87.     pin: 16
  88.     name: "Motion 1"
  89.     device_class: motion
  90.  
  91.   - platform: gpio
  92.     pin: 17
  93.     name: "Motion 2"
  94.     device_class: motion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement