diff --git a/esphome/devices/shelly/plus2PM.yaml b/esphome/devices/shelly/plus2PM.yaml new file mode 100644 index 00000000..51bc229d --- /dev/null +++ b/esphome/devices/shelly/plus2PM.yaml @@ -0,0 +1,52 @@ +# Based on https://devices.esphome.io/devices/Shelly-Plus-2PM. +--- +packages: + common: !include 'packages/common.yaml' + platform: !include + file: '../../packages/platform/esp32.yaml' + vars: + board: 'esp32doit-devkit-v1' + + status_led: !include 'packages/status_led.yaml' + + input1: !include + file: 'packages/input.yaml' + vars: + id: 1 + pin: 'GPIO5' + input2: !include + file: 'packages/input.yaml' + vars: + id: 2 + pin: 'GPIO18' + + output1: !include + file: 'packages/output.yaml' + vars: + id: 1 + pin: 'GPIO12' + output2: !include + file: 'packages/output.yaml' + vars: + id: 2 + pin: 'GPIO13' + +binary_sensor: + - platform: 'gpio' + pin: + number: 'GPIO4' + inverted: true + mode: + input: true + pullup: true + id: 'button1' + internal: true + filters: + delayed_on_off: '5s' + on_press: + then: + button.press: 'button_restart' + +i2c: + sda: 'GPIO26' + scl: 'GPIO25' diff --git a/esphome/laundry_shelly.yaml b/esphome/laundry_shelly.yaml index 3ce2f6d5..4ef2bcb5 100644 --- a/esphome/laundry_shelly.yaml +++ b/esphome/laundry_shelly.yaml @@ -5,4 +5,4 @@ substitutions: device_name: 'Laundry Shelly' packages: - device: !include 'devices/shelly/25.yaml' + device: !include 'devices/shelly/plus2PM.yaml'