Is Shelly RGBW2 supported?

For all fans, my complete yaml with power measurement and the whole shabang :slight_smile:

substitutions:
  device_name: shelly_rgbw_01

esphome:
  name: ${device_name}
  platform: ESP8266
  board: esp01_1m
  esp8266_restore_from_flash: true

wifi:
  ssid: "ssid"
  password: !secret ssid_wifi_key
  domain: !secret domain
  #use_address: 192.168.6.70
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "${device_name} Fallback Hotspot"
    password: !secret Fallback_Hotspot
  #fast_connect: true

captive_portal:

# Enable logging
logger:
  level: DEBUG

# Enable Home Assistant API
api:

ota:

web_server:
  port: 80

time:
  - platform: homeassistant
    id: homeassistant_time

sensor:
  - platform: wifi_signal
    name: "${device_name} - WiFi Signal"
    update_interval: 60s
  - platform: uptime
    name: "${device_name} - Uptime"
    icon: mdi:clock-outline
    update_interval: 60s
  - platform: uptime
    name: "${device_name} - Uptime Seconds"
    id: uptime_sensor
    update_interval: 60s
    on_raw_value:
      then:
        - text_sensor.template.publish:
            id: uptime_human
            state: !lambda |-
              int seconds = round(id(uptime_sensor).raw_state);
              int days = seconds / (24 * 3600);
              seconds = seconds % (24 * 3600);
              int hours = seconds / 3600;
              seconds = seconds % 3600;
              int minutes = seconds /  60;
              seconds = seconds % 60;
              return (
                (days ? String(days) + "d " : "") +
                (hours ? String(hours) + "h " : "") +
                (minutes ? String(minutes) + "m " : "") +
                (String(seconds) + "s")
              ).c_str();
  - platform: adc
    pin: A0
    name: "${device_name} - adc"
    update_interval: 1s
    accuracy_decimals: 4
    id: current_raw
    internal: true
  - platform: template
    name: "${device_name} - Power"
    unit_of_measurement: W
    accuracy_decimals: 1
    device_class: power
    update_interval: 30s
    id: my_power
    lambda: return id(current_raw).state;
    filters:
      - calibrate_linear:
        - 0.4000 -> 0.0
        - 0.4043 -> 0.14
        - 0.4053 -> 0.20
      - multiply: 12 # 12V lamp
  - platform: total_daily_energy
    name: "${device_name} - Total Daily Energy"
    power_id: my_power
    filters:
          # Multiplication factor from W to kW is 0.001
          - multiply: 0.001
    unit_of_measurement: kW

light:
  - platform: monochromatic
    name: ${device_name}_R
    id: ${device_name}_R
    output: ${device_name}_out_R
    restore_mode: RESTORE_DEFAULT_OFF
  - platform: monochromatic
    name: ${device_name}_G
    id: ${device_name}_G
    output: ${device_name}_out_G
    restore_mode: RESTORE_DEFAULT_OFF
  - platform: monochromatic
    name: ${device_name}_B
    id: ${device_name}_B
    output: ${device_name}_out_B
    restore_mode: RESTORE_DEFAULT_OFF
  - platform: monochromatic
    name: ${device_name}_W
    id: ${device_name}_W
    output: ${device_name}_out_W
    restore_mode: RESTORE_DEFAULT_ON

output:
  - platform: esp8266_pwm
    id: ${device_name}_out_R
    pin: GPIO12
    frequency: 1000 Hz
  - platform: esp8266_pwm
    id: ${device_name}_out_G
    pin: GPIO15
    frequency: 1000 Hz
  - platform: esp8266_pwm
    id: ${device_name}_out_B
    pin: GPIO14
    frequency: 1000 Hz
  - platform: esp8266_pwm
    id: ${device_name}_out_W
    pin: GPIO4
    frequency: 1000 Hz
    
text_sensor:
  - platform: template
    name: "${device_name} - Uptime"
    id: uptime_human
    icon: mdi:clock-start
    update_interval: 60s
  - platform: version
    name: "${device_name} - ESPHome Version"
  - platform: wifi_info
    ip_address:
      name: "${device_name} - IP"

switch:
  - platform: restart
    name: "${device_name} - Restart"
5 Likes

Will copy few items from your config!

Also I learned just now that underscores should not be used in the device names.