diff --git a/mombox-fan.yaml b/mombox-fan.yaml new file mode 100644 index 0000000000000000000000000000000000000000..0e8af1d8abcc3178b5ee86c8cccbf2eb7514b7d9 --- /dev/null +++ b/mombox-fan.yaml @@ -0,0 +1,8 @@ +substitutions: + devicename: "mombox-fan" + comment: "Mother Fan Control" + +packages: + base: !include packages/base.yaml + time: !include packages/time.yaml + nous_a8t: !include packages/nous_a8t.yaml diff --git a/mombox-light.yaml b/mombox-light.yaml new file mode 100644 index 0000000000000000000000000000000000000000..1d94ceeccc9f123498c9b4fd1bebb6bd4ac030a4 --- /dev/null +++ b/mombox-light.yaml @@ -0,0 +1,8 @@ +substitutions: + devicename: "mombox-light" + comment: "Mother Light Control" + +packages: + base: !include packages/base.yaml + time: !include packages/time.yaml + nous_a8t: !include packages/nous_a8t.yaml diff --git a/packages/nous_a8t.yaml b/packages/nous_a8t.yaml new file mode 100644 index 0000000000000000000000000000000000000000..595062123017383bb8dc5861545240d3af4a5f21 --- /dev/null +++ b/packages/nous_a8t.yaml @@ -0,0 +1,82 @@ +substitutions: + # Higher value gives lower watt readout + current_res: "0.00126" + # Lower value gives lower voltage readout + voltage_div: "1570" + +esp32: + board: esp32dev + +light: + - platform: status_led + id: led_status + pin: + number: GPIO2 + inverted: true + +binary_sensor: + - platform: gpio + id: button_state + pin: + number: GPIO04 + mode: INPUT_PULLUP + on_press: + - switch.toggle: power + +switch: + - platform: template + name: "Power" + id: power + restore_mode: RESTORE_DEFAULT_OFF + lambda: |- + if (id(relay).state) { + return true; + } else { + return false; + } + turn_on_action: + - switch.turn_on: relay + - light.turn_on: led_status + turn_off_action: + - switch.turn_off: relay + - light.turn_off: led_status + - platform: gpio + id: relay + pin: GPIO13 + +sensor: + - platform: total_daily_energy + name: "Daily Consumption" + power_id: watt + filters: + # Multiplication factor from W to kW is 0.001 + - multiply: 0.001 + unit_of_measurement: kWh + + - platform: hlw8012 + model: BL0937 + sel_pin: + number: GPIO14 + inverted: True + cf_pin: GPIO27 + cf1_pin: GPIO26 + change_mode_every: 1 + current_resistor: ${current_res} + voltage_divider: ${voltage_div} + update_interval: 3s + + current: + name: "Ampere" + unit_of_measurement: A + accuracy_decimals: 3 + + voltage: + name: "Volt" + unit_of_measurement: V + accuracy_decimals: 1 + + power: + id: watt + name: "Watt" + unit_of_measurement: W + accuracy_decimals: 1