Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- substitutions:
- device_name: sonoff4ch_genny
- friendly_name: Sonoff 4CH Pro Genny
- ignition: GPIO12 #Relay1
- crank: GPIO5 #Relay2
- power_good: GPIO4 #Relay 3
- shutoff: GPIO15 #Relay4
- sensor_temp: GPIO0 # DHT11
- esphome:
- name: sonoff4chpror3
- platform: ESP8266
- board: nodemcuv2
- # Enable logging
- logger:
- # Enable Home Assistant API
- api:
- ota:
- password: "1ea575456fb1d95ecd2cb71f67fb65c1"
- wifi:
- ssid: !secret iot_ssid
- password: !secret iot_pass
- # Enable fallback hotspot (captive portal) in case wifi connection fails
- ap:
- ssid: "Nocemcu Fallback Hotspot"
- password: "gQSbSS5bC4HZ"
- captive_portal:
- sensor:
- - platform: dht
- pin: ${sensor_temp}
- temperature:
- name: "Generator Temperature"
- humidity:
- name: "Generator Humidity"
- update_interval: 60s
- switch:
- - platform: gpio
- pin: ${ignition}
- name: "ignition"
- id: IN1
- - platform: gpio
- pin: ${crank}
- name: "crank"
- id: IN2
- - platform: gpio
- pin: ${power_good}
- name: "power_good"
- id: IN3
- - platform: gpio
- pin: ${shutoff}
- name: "shutoff"
- id: IN4
- - platform: template
- name: "Generator"
- id: Generator
- turn_on_action:
- - then:
- - switch.turn_on: IN1
- - delay: 2s
- - switch.turn_on: IN2
- - delay: 2s
- - switch.turn_off: IN2
- - delay: 10s
- - switch.turn_on: IN3
- - delay: 1s
- - switch.turn_off: IN3
- - switch.template.publish:
- id: Generator
- state: ON
- turn_off_action:
- - then:
- - switch.turn_on: IN4
- - delay: 1s
- - switch.turn_off: IN4
- - delay: 15s
- - switch.turn_off: IN1
- - switch.template.publish:
- id: Generator
- state: OFF
Add Comment
Please, Sign In to add comment