Compare commits
2 commits
dc0e87fd69
...
c78965e56c
| Author | SHA1 | Date | |
|---|---|---|---|
| c78965e56c | |||
| ef8ea0162c |
10 changed files with 416 additions and 27 deletions
|
|
@ -9,19 +9,31 @@
|
||||||
substitutions:
|
substitutions:
|
||||||
node_name: back-irrigation
|
node_name: back-irrigation
|
||||||
node_friendly_name: Back Yard Irrigation
|
node_friendly_name: Back Yard Irrigation
|
||||||
http_timeout: 3s
|
node_area: Garage
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
- !include ../common/esp32-idf.yaml
|
|
||||||
- !include ../common/esp32r4.yaml
|
|
||||||
- !include ../common/wifi-influxdb.yaml
|
|
||||||
- !include ../common/wifi-km6g-iot.yaml
|
|
||||||
- !include ../common/base-influxdb.yaml
|
|
||||||
- !include ../common/sntp-time.yaml
|
|
||||||
- !include ../common/http-request-idf.yaml
|
|
||||||
- !include ../common/influxdb.yaml
|
|
||||||
- !include
|
- !include
|
||||||
file: ../common/sprinklers.yaml
|
file: framework/esp32_idf.yaml
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: unit/esp32_r4.yaml
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: domain/base.yaml
|
||||||
|
- !include
|
||||||
|
file: domain/influxdb_v2_oss/base.yaml
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: domain/time/sntp.yaml
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: domain/http_request_idf.yaml
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: domain/influxdb_v2_oss/core.yaml
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: domain/sprinkler/sprinklers.yaml
|
||||||
vars:
|
vars:
|
||||||
irrigation_area_name: Back Yard
|
irrigation_area_name: Back Yard
|
||||||
zone_1_switch: relay1
|
zone_1_switch: relay1
|
||||||
|
|
@ -30,8 +42,9 @@ packages:
|
||||||
zone_2_switch: relay2
|
zone_2_switch: relay2
|
||||||
zone_2_name: Side
|
zone_2_name: Side
|
||||||
zone_2_duration: '30'
|
zone_2_duration: '30'
|
||||||
|
|
||||||
- !include
|
- !include
|
||||||
file: ../common/drip.yaml
|
file: domain/sprinkler/drip.yaml
|
||||||
vars:
|
vars:
|
||||||
irrigation_area_name: Back Yard
|
irrigation_area_name: Back Yard
|
||||||
zone_1_switch: relay3
|
zone_1_switch: relay3
|
||||||
|
|
|
||||||
11
prod/domain/binary_sensor/gpio.yaml
Normal file
11
prod/domain/binary_sensor/gpio.yaml
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
defaults:
|
||||||
|
id: _binary_sensor
|
||||||
|
|
||||||
|
binary_sensor:
|
||||||
|
- id: ${id}
|
||||||
|
name: ${name}
|
||||||
|
platform: gpio
|
||||||
|
pin:
|
||||||
|
number: ${pin}
|
||||||
|
mode:
|
||||||
|
input: true
|
||||||
111
prod/domain/sprinkler/drip.yaml
Normal file
111
prod/domain/sprinkler/drip.yaml
Normal file
|
|
@ -0,0 +1,111 @@
|
||||||
|
esphome:
|
||||||
|
on_boot:
|
||||||
|
priority: -100
|
||||||
|
then:
|
||||||
|
- text_sensor.template.publish:
|
||||||
|
id: drip_status
|
||||||
|
state: "Idle"
|
||||||
|
|
||||||
|
sprinkler:
|
||||||
|
- id: drip
|
||||||
|
main_switch:
|
||||||
|
name: ${irrigation_area_name} Drip Start/Resume/Stop
|
||||||
|
auto_advance_switch:
|
||||||
|
name: ${irrigation_area_name} Drip Auto-Advance
|
||||||
|
multiplier_number:
|
||||||
|
name: ${irrigation_area_name} Drip Multiplier
|
||||||
|
mode: box
|
||||||
|
icon: mdi:timer-cog-outline
|
||||||
|
initial_value: 1
|
||||||
|
min_value: 0
|
||||||
|
max_value: 6
|
||||||
|
step: .1
|
||||||
|
restore_value: true
|
||||||
|
valves:
|
||||||
|
- valve_switch:
|
||||||
|
name: ${irrigation_area_name} Drip ${zone_1_name}
|
||||||
|
on_turn_on:
|
||||||
|
- text_sensor.template.publish:
|
||||||
|
id: drip_status
|
||||||
|
state: ${zone_1_name} Active
|
||||||
|
on_turn_off:
|
||||||
|
- text_sensor.template.publish:
|
||||||
|
id: drip_status
|
||||||
|
state: Idle
|
||||||
|
enable_switch:
|
||||||
|
name: ${irrigation_area_name} Enable Drip ${zone_1_name}
|
||||||
|
run_duration_number:
|
||||||
|
name: ${irrigation_area_name} Drip ${zone_1_name} Duration
|
||||||
|
unit_of_measurement: min
|
||||||
|
mode: box
|
||||||
|
icon: mdi:timer-outline
|
||||||
|
initial_value: ${zone_1_duration}
|
||||||
|
min_value: 0
|
||||||
|
max_value: 120
|
||||||
|
step: 1
|
||||||
|
restore_value: true
|
||||||
|
valve_switch_id: ${zone_1_switch}
|
||||||
|
- valve_switch:
|
||||||
|
name: ${irrigation_area_name} Drip ${zone_2_name}
|
||||||
|
on_turn_on:
|
||||||
|
- text_sensor.template.publish:
|
||||||
|
id: drip_status
|
||||||
|
state: ${zone_2_name} Active
|
||||||
|
on_turn_off:
|
||||||
|
- text_sensor.template.publish:
|
||||||
|
id: drip_status
|
||||||
|
state: Idle
|
||||||
|
enable_switch:
|
||||||
|
name: ${irrigation_area_name} Enable Drip ${zone_2_name}
|
||||||
|
run_duration_number:
|
||||||
|
name: ${irrigation_area_name} Drip ${zone_2_name} Duration
|
||||||
|
unit_of_measurement: min
|
||||||
|
mode: box
|
||||||
|
icon: mdi:timer-outline
|
||||||
|
initial_value: ${zone_2_duration}
|
||||||
|
min_value: 0
|
||||||
|
max_value: 120
|
||||||
|
step: 1
|
||||||
|
restore_value: true
|
||||||
|
valve_switch_id: ${zone_2_switch}
|
||||||
|
|
||||||
|
button:
|
||||||
|
- id: drip_pause
|
||||||
|
name: ${irrigation_area_name} Drip Pause
|
||||||
|
platform: template
|
||||||
|
on_press:
|
||||||
|
then:
|
||||||
|
- sprinkler.pause: drip
|
||||||
|
|
||||||
|
text_sensor:
|
||||||
|
- id: drip_status
|
||||||
|
name: ${irrigation_area_name} Drip Status
|
||||||
|
platform: template
|
||||||
|
update_interval: never
|
||||||
|
icon: mdi:information-variant
|
||||||
|
|
||||||
|
api:
|
||||||
|
services:
|
||||||
|
- service: start_full_cycle_drip
|
||||||
|
then:
|
||||||
|
- sprinkler.start_full_cycle: drip
|
||||||
|
|
||||||
|
switch:
|
||||||
|
- id: drip_zone_1_valve
|
||||||
|
name: ${irrigation_area_name} Drip ${zone_1_name} Valve
|
||||||
|
platform: template
|
||||||
|
turn_on_action:
|
||||||
|
- switch.turn_on: ${zone_1_switch}
|
||||||
|
turn_off_action:
|
||||||
|
- switch.turn_off: ${zone_1_switch}
|
||||||
|
lambda: |-
|
||||||
|
return id(${zone_1_switch}).state;
|
||||||
|
- id: drip_zone_2_valve
|
||||||
|
name: ${irrigation_area_name} Drip ${zone_2_name} Valve
|
||||||
|
platform: template
|
||||||
|
turn_on_action:
|
||||||
|
- switch.turn_on: ${zone_2_switch}
|
||||||
|
turn_off_action:
|
||||||
|
- switch.turn_off: ${zone_2_switch}
|
||||||
|
lambda: |-
|
||||||
|
return id(${zone_2_switch}).state;
|
||||||
117
prod/domain/sprinkler/sprinklers.yaml
Normal file
117
prod/domain/sprinkler/sprinklers.yaml
Normal file
|
|
@ -0,0 +1,117 @@
|
||||||
|
esphome:
|
||||||
|
on_boot:
|
||||||
|
priority: -100
|
||||||
|
then:
|
||||||
|
- text_sensor.template.publish:
|
||||||
|
id: sprinklers_status
|
||||||
|
state: "Idle"
|
||||||
|
|
||||||
|
sprinkler:
|
||||||
|
- id: sprinklers
|
||||||
|
|
||||||
|
main_switch:
|
||||||
|
name: ${irrigation_area_name} Sprinkler Start/Resume/Stop
|
||||||
|
|
||||||
|
auto_advance_switch:
|
||||||
|
name: ${irrigation_area_name} Sprinkler Auto-Advance
|
||||||
|
|
||||||
|
multiplier_number:
|
||||||
|
name: ${irrigation_area_name} Sprinkler Multiplier
|
||||||
|
mode: box
|
||||||
|
icon: mdi:timer-cog-outline
|
||||||
|
initial_value: 1
|
||||||
|
min_value: 0
|
||||||
|
max_value: 6
|
||||||
|
step: .1
|
||||||
|
restore_value: true
|
||||||
|
|
||||||
|
valves:
|
||||||
|
- valve_switch:
|
||||||
|
name: ${irrigation_area_name} Sprinkler ${zone_1_name}
|
||||||
|
on_turn_on:
|
||||||
|
- text_sensor.template.publish:
|
||||||
|
id: sprinklers_status
|
||||||
|
state: ${zone_1_name} Active
|
||||||
|
on_turn_off:
|
||||||
|
- text_sensor.template.publish:
|
||||||
|
id: sprinklers_status
|
||||||
|
state: Idle
|
||||||
|
enable_switch:
|
||||||
|
name: ${irrigation_area_name} Enable Sprinkler ${zone_1_name}
|
||||||
|
run_duration_number:
|
||||||
|
name: ${irrigation_area_name} Sprinkler ${zone_1_name} Duration
|
||||||
|
unit_of_measurement: min
|
||||||
|
mode: box
|
||||||
|
icon: mdi:timer-outline
|
||||||
|
initial_value: ${zone_1_duration}
|
||||||
|
min_value: 0
|
||||||
|
max_value: 120
|
||||||
|
step: 1
|
||||||
|
restore_value: true
|
||||||
|
valve_switch_id: ${zone_1_switch}
|
||||||
|
|
||||||
|
- valve_switch:
|
||||||
|
name: ${irrigation_area_name} Sprinkler ${zone_2_name}
|
||||||
|
on_turn_on:
|
||||||
|
- text_sensor.template.publish:
|
||||||
|
id: sprinklers_status
|
||||||
|
state: ${zone_2_name} Active
|
||||||
|
on_turn_off:
|
||||||
|
- text_sensor.template.publish:
|
||||||
|
id: sprinklers_status
|
||||||
|
state: Idle
|
||||||
|
enable_switch:
|
||||||
|
name: ${irrigation_area_name} Enable Sprinkler ${zone_2_name}
|
||||||
|
run_duration_number:
|
||||||
|
name: ${irrigation_area_name} Sprinkler ${zone_2_name} Duration
|
||||||
|
unit_of_measurement: min
|
||||||
|
mode: box
|
||||||
|
icon: mdi:timer-outline
|
||||||
|
initial_value: ${zone_2_duration}
|
||||||
|
min_value: 0
|
||||||
|
max_value: 120
|
||||||
|
step: 1
|
||||||
|
restore_value: true
|
||||||
|
valve_switch_id: ${zone_2_switch}
|
||||||
|
|
||||||
|
button:
|
||||||
|
- id: sprinklers_pause
|
||||||
|
name: ${irrigation_area_name} Sprinkler Pause
|
||||||
|
platform: template
|
||||||
|
on_press:
|
||||||
|
then:
|
||||||
|
- sprinkler.pause: sprinklers
|
||||||
|
|
||||||
|
text_sensor:
|
||||||
|
- id: sprinklers_status
|
||||||
|
name: ${irrigation_area_name} Sprinkler Status
|
||||||
|
platform: template
|
||||||
|
update_interval: never
|
||||||
|
icon: mdi:information-variant
|
||||||
|
|
||||||
|
api:
|
||||||
|
services:
|
||||||
|
- service: start_full_cycle_sprinklers
|
||||||
|
then:
|
||||||
|
- sprinkler.start_full_cycle: sprinklers
|
||||||
|
|
||||||
|
switch:
|
||||||
|
- id: sprinklers_zone_1_valve
|
||||||
|
name: ${irrigation_area_name} Sprinkler ${zone_1_name} Valve
|
||||||
|
platform: template
|
||||||
|
turn_on_action:
|
||||||
|
- switch.turn_on: ${zone_1_switch}
|
||||||
|
turn_off_action:
|
||||||
|
- switch.turn_off: ${zone_1_switch}
|
||||||
|
lambda: |-
|
||||||
|
return id(${zone_1_switch}).state;
|
||||||
|
|
||||||
|
- id: sprinklers_zone_2_valve
|
||||||
|
name: ${irrigation_area_name} Sprinkler ${zone_2_name} Valve
|
||||||
|
platform: template
|
||||||
|
turn_on_action:
|
||||||
|
- switch.turn_on: ${zone_2_switch}
|
||||||
|
turn_off_action:
|
||||||
|
- switch.turn_off: ${zone_2_switch}
|
||||||
|
lambda: |-
|
||||||
|
return id(${zone_2_switch}).state;
|
||||||
|
|
@ -5,3 +5,4 @@ status_led:
|
||||||
pin:
|
pin:
|
||||||
number: ${pin}
|
number: ${pin}
|
||||||
inverted: ${inverted}
|
inverted: ${inverted}
|
||||||
|
ignore_strapping_warning: true
|
||||||
|
|
|
||||||
9
prod/domain/switch/gpio.yaml
Normal file
9
prod/domain/switch/gpio.yaml
Normal file
|
|
@ -0,0 +1,9 @@
|
||||||
|
defaults:
|
||||||
|
id: _switch
|
||||||
|
|
||||||
|
switch:
|
||||||
|
- id: ${id}
|
||||||
|
name: ${name}
|
||||||
|
platform: gpio
|
||||||
|
pin:
|
||||||
|
number: ${pin}
|
||||||
|
|
@ -9,19 +9,31 @@
|
||||||
substitutions:
|
substitutions:
|
||||||
node_name: front-irrigation
|
node_name: front-irrigation
|
||||||
node_friendly_name: Front Yard Irrigation
|
node_friendly_name: Front Yard Irrigation
|
||||||
http_timeout: 3s
|
node_area: Basement
|
||||||
|
|
||||||
packages:
|
packages:
|
||||||
- !include ../common/esp32-idf.yaml
|
|
||||||
- !include ../common/esp32r4.yaml
|
|
||||||
- !include ../common/wifi-influxdb.yaml
|
|
||||||
- !include ../common/wifi-km6g-iot.yaml
|
|
||||||
- !include ../common/base-influxdb.yaml
|
|
||||||
- !include ../common/http-request-idf.yaml
|
|
||||||
- !include ../common/sntp-time.yaml
|
|
||||||
- !include ../common/influxdb.yaml
|
|
||||||
- !include
|
- !include
|
||||||
file: ../common/sprinklers.yaml
|
file: framework/esp32_idf.yaml
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: unit/esp32_r4.yaml
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: domain/base.yaml
|
||||||
|
- !include
|
||||||
|
file: domain/influxdb_v2_oss/base.yaml
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: domain/time/sntp.yaml
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: domain/http_request_idf.yaml
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: domain/influxdb_v2_oss/core.yaml
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: domain/sprinkler/sprinklers.yaml
|
||||||
vars:
|
vars:
|
||||||
irrigation_area_name: Front Yard
|
irrigation_area_name: Front Yard
|
||||||
zone_1_switch: relay1
|
zone_1_switch: relay1
|
||||||
|
|
@ -30,8 +42,9 @@ packages:
|
||||||
zone_2_switch: relay2
|
zone_2_switch: relay2
|
||||||
zone_2_name: Upper
|
zone_2_name: Upper
|
||||||
zone_2_duration: '30'
|
zone_2_duration: '30'
|
||||||
|
|
||||||
- !include
|
- !include
|
||||||
file: ../common/drip.yaml
|
file: domain/sprinkler/drip.yaml
|
||||||
vars:
|
vars:
|
||||||
irrigation_area_name: Front Yard
|
irrigation_area_name: Front Yard
|
||||||
zone_1_switch: relay3
|
zone_1_switch: relay3
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ packages:
|
||||||
file: framework/esp32_idf.yaml
|
file: framework/esp32_idf.yaml
|
||||||
|
|
||||||
- !include
|
- !include
|
||||||
file: unit/olimex_esp32_poe.yaml
|
file: board/olimex_esp32_poe.yaml
|
||||||
|
|
||||||
- !include
|
- !include
|
||||||
file: domain/base.yaml
|
file: domain/base.yaml
|
||||||
|
|
|
||||||
114
prod/unit/esp32_r4.yaml
Normal file
114
prod/unit/esp32_r4.yaml
Normal file
|
|
@ -0,0 +1,114 @@
|
||||||
|
esphome:
|
||||||
|
platformio_options:
|
||||||
|
upload_speed: 460800
|
||||||
|
|
||||||
|
esp32:
|
||||||
|
board: esp32dev
|
||||||
|
|
||||||
|
packages:
|
||||||
|
- !include
|
||||||
|
file: ../domain/status_led.yaml
|
||||||
|
vars:
|
||||||
|
pin: GPIO2
|
||||||
|
inverted: "true"
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: ../domain/network/wifi.yaml
|
||||||
|
- !include
|
||||||
|
file: ../domain/influxdb_v2_oss/wifi.yaml
|
||||||
|
- !include
|
||||||
|
file: ../domain/network/wifi_km6g_iot.yaml
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: ../domain/switch/gpio.yaml
|
||||||
|
vars:
|
||||||
|
id: relay1
|
||||||
|
name: Relay 1
|
||||||
|
pin: GPIO25
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: ../domain/switch/gpio.yaml
|
||||||
|
vars:
|
||||||
|
id: relay2
|
||||||
|
name: Relay 2
|
||||||
|
pin: GPIO26
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: ../domain/switch/gpio.yaml
|
||||||
|
vars:
|
||||||
|
id: relay3
|
||||||
|
name: Relay 3
|
||||||
|
pin: GPIO33
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: ../domain/switch/gpio.yaml
|
||||||
|
vars:
|
||||||
|
id: relay4
|
||||||
|
name: Relay 4
|
||||||
|
pin: GPIO32
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: ../domain/binary_sensor/gpio.yaml
|
||||||
|
vars:
|
||||||
|
id: button1
|
||||||
|
name: Button 1
|
||||||
|
pin: GPIO34
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: ../domain/binary_sensor/gpio.yaml
|
||||||
|
vars:
|
||||||
|
id: button2
|
||||||
|
name: Button 2
|
||||||
|
pin: GPIO35
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: ../domain/binary_sensor/gpio.yaml
|
||||||
|
vars:
|
||||||
|
id: button3
|
||||||
|
name: Button 3
|
||||||
|
pin: GPIO36
|
||||||
|
|
||||||
|
- !include
|
||||||
|
file: ../domain/binary_sensor/gpio.yaml
|
||||||
|
vars:
|
||||||
|
id: button4
|
||||||
|
name: Button 4
|
||||||
|
pin: GPIO39
|
||||||
|
|
||||||
|
switch:
|
||||||
|
- id: !extend relay1
|
||||||
|
internal: true
|
||||||
|
restore_mode: RESTORE_DEFAULT_OFF
|
||||||
|
|
||||||
|
- id: !extend relay2
|
||||||
|
internal: true
|
||||||
|
restore_mode: RESTORE_DEFAULT_OFF
|
||||||
|
|
||||||
|
- id: !extend relay3
|
||||||
|
internal: true
|
||||||
|
restore_mode: RESTORE_DEFAULT_OFF
|
||||||
|
|
||||||
|
- id: !extend relay4
|
||||||
|
internal: true
|
||||||
|
restore_mode: RESTORE_DEFAULT_OFF
|
||||||
|
|
||||||
|
binary_sensor:
|
||||||
|
- id: !extend button1
|
||||||
|
internal: true
|
||||||
|
pin:
|
||||||
|
inverted: true
|
||||||
|
|
||||||
|
- id: !extend button2
|
||||||
|
internal: true
|
||||||
|
pin:
|
||||||
|
inverted: true
|
||||||
|
|
||||||
|
- id: !extend button3
|
||||||
|
internal: true
|
||||||
|
pin:
|
||||||
|
inverted: true
|
||||||
|
|
||||||
|
- id: !extend button4
|
||||||
|
internal: true
|
||||||
|
pin:
|
||||||
|
inverted: true
|
||||||
Loading…
Add table
Add a link
Reference in a new issue