]> www.infradead.org Git - users/dwmw2/esp32-pool.git/commitdiff
Add heishamon
authorDavid Woodhouse <dwmw@amazon.co.uk>
Sat, 28 Sep 2024 09:26:59 +0000 (10:26 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Sat, 28 Sep 2024 09:26:59 +0000 (10:26 +0100)
heishamon.yaml [new file with mode: 0644]

diff --git a/heishamon.yaml b/heishamon.yaml
new file mode 100644 (file)
index 0000000..09b77b7
--- /dev/null
@@ -0,0 +1,271 @@
+# https://www.tindie.com/products/thehognl/heishamon-communication-pcb
+
+# inOTPin 6
+# outOTPin 7
+# 1wire 3
+# DEFAULT_SO_PIN_1 1
+# DEFAULT_SO_PIN_2 2
+# Neopixel 42
+# ENABLEPIN 5
+# ENABLEOTPIN 4
+# BOOTPIN 0
+#define HEATPUMPRX 18
+#define HEATPUMPTX 17
+#define PROXYRX 9
+#define PROXYTX 8
+
+#HeishaMon/gpio.h:  unsigned int gpioPin[NUMGPIO] = {33, 34, 35, 36, 37, 21, 47};
+
+
+substitutions:
+  name: heishamon
+# heatpump heating/cooling switch
+# available modes: HEAT_ROOM_TEMP, HEAT_FLOW_TEMP, HEAT_COMPENSATION_CURVE, COOL_ROOM_TEMP, COOL_FLOW_TEMP
+  default_heating_switch_mode: HEAT_COMPENSATION_CURVE
+  default_cooling_switch_mode: COOL_FLOW_TEMP
+
+#one_wire:
+# - platform: gpio
+#   pin: 3
+
+esphome:
+  name: ${name}
+  platformio_options:
+    board_build.flash_mode: dio
+  on_boot:
+    then:
+      - light.turn_on:
+          id: led
+          red: 100%
+          green: 0%
+          blue: 0%
+
+esp32:
+  board: esp32-s3-devkitc-1
+  framework:
+    type: esp-idf
+    version: recommended
+    # Custom sdkconfig options
+    sdkconfig_options:
+      COMPILER_OPTIMIZATION_SIZE: y
+    # Advanced tweaking options
+    advanced:
+      ignore_efuse_mac_crc: false
+
+external_components:
+ - source:
+     type: local
+     path: ../git/esphome-ecodan-hp/components
+   components: [ ecodan ]
+ - source: github://ssieb/esphome_components
+   components: [ uart_mitm ]
+packages:
+  base: !include base.yaml
+  ecodan:
+    url: file:/home/dwmw/git/esphome-ecodan-hp/
+    ref: main
+    refresh: always
+    files: [
+            confs/base.yaml,
+            #confs/esp32s3.yaml, # confs/esp32.yaml, for regular board
+            confs/zone1.yaml,
+            ## enable if you want to use zone 2
+            #confs/zone2.yaml,
+            ## enable label language file
+            confs/ecodan-labels-en.yaml,
+            #confs/ecodan-labels-nl.yaml,
+            #confs/ecodan-labels-it.yaml,
+            #confs/server-control.yaml,
+            #confs/debug.yaml,
+           ]
+
+mqtt:
+  on_connect:
+    then:
+      - light.turn_on:
+         id: led
+         blue: 100%
+         red: 0%
+         green: 0%
+  on_disconnect:
+    then:
+      - light.turn_on:
+         id: led
+         blue: 0%
+         red: 100%
+         green: 0%
+
+  on_json_message:
+    - topic: domoticz/out
+      then:
+        - lambda: |-
+            int idx = x["idx"];
+            int nvalue = x["nvalue"].as<int>();
+
+            // ESP_LOGD("on_json_message", x["name"]);
+            switch (idx) {
+               case 87: /* Boiler */
+                  int svalue1 = x["svalue1"].as<int>();
+                  ESP_LOGI("Evohome", "Boiler set to %d/%d", nvalue, svalue1);
+                  id(tell_domo_svalue)->execute(908, std::to_string(svalue1/2));
+                  break;
+            }
+
+
+uart:
+ - id: uart_ecodan
+   rx_pin:
+      number: GPIO18
+      mode:
+        input: true
+        pullup: true
+   tx_pin:
+      number: GPIO17
+      mode:
+        output: true
+   baud_rate: 2400
+   parity: EVEN
+   stop_bits: 1
+   debug:
+     direction: BOTH
+     dummy_receiver: false
+     after:
+       timeout: 10ms
+     sequence:
+       - lambda: |-
+          UARTDebug::log_hex(direction, bytes, '_');
+##         id(uart_proxy).write_array(&bytes[0], bytes.size());
+###         if (bytes.size() == 18 && bytes[0] == 0x02 && bytes[17] == 0xb5) {
+###           ESP_LOGI("proxy", "Change baud rate to 9600");
+###           id(uart_proxy).flush();
+###           id(uart_proxy).set_baud_rate(9600);
+###           id(uart_proxy).load_settings();
+###           id(uart_ecodan).set_baud_rate(9600);
+###           id(uart_ecodan).load_settings();
+###         }
+###
+ - id: uart_proxy
+   rx_pin:
+    number: GPIO9
+    mode:
+      input: true
+      pullup: true
+   tx_pin:
+    number: GPIO8
+    mode:
+     output: true
+   baud_rate: 9600
+   parity: EVEN
+   stop_bits: 1
+   debug:
+    direction: BOTH
+    dummy_receiver: false
+    after:
+      timeout: 10ms
+    sequence:
+      - lambda: |-
+           UARTDebug::log_hex(direction, bytes, ' ');
+##         if (id(mqtt_client).is_connected()) {
+##           id(uart_ecodan).write_array(&bytes[0], bytes.size());
+##         }
+#
+#uart_mitm:
+# uart1: uart_ecodan
+# uart2: uart_proxy
+#remote_receiver:
+# - id: proxy_rx
+#   pin:
+#     number: GPIO9
+#     inverted: true
+#   dump: raw
+#   rmt_channel: 4
+#   clock_divider: 40
+#   filter: 5us
+#   idle: 100ms
+#   on_raw:
+#     then:
+#       - if:
+#          condition:
+#            mqtt.connected:
+#          then:
+#           - remote_transmitter.transmit_raw:
+#              transmitter_id: ecodan_tx
+#              code: !lambda return x;
+# - id: ecodan_rx
+#   pin:
+#     number: GPIO18
+#     inverted: true
+#   dump: raw
+#   rmt_channel: 5
+#   clock_divider: 40
+#   filter: 5us
+#   idle: 100ms
+#   on_raw:
+#     then:
+#       - remote_transmitter.transmit_raw:
+#          transmitter_id: proxy_tx
+#          code: !lambda return x;
+
+#remote_transmitter:
+# - id: proxy_tx
+#   pin:
+#    number: GPIO8
+#    inverted: true
+#   rmt_channel: 1
+#   carrier_duty_percent: 100
+# - id: ecodan_tx
+#   pin:
+#     number: GPIO17
+#     inverted: true
+#   rmt_channel: 3
+#   carrier_duty_percent: 100
+   
+sensor:
+  - platform: internal_temperature
+    name: ${internal_esp_temperature}
+    entity_category: diagnostic
+
+# is mutual exclusive with wifi
+# ethernet:
+#   type: W5500
+#   reset_pin: GPIO14
+#   interrupt_pin: GPIO15
+#   cs_pin: GPIO10
+#   mosi_pin: GPIO11
+#   clk_pin: GPIO12
+#   miso_pin: GPIO13
+
+# relay
+switch:
+  - platform: gpio
+    pin: GPIO5
+    restore_mode: ALWAYS_ON
+    id: enable
+    name: Enable
+  - platform: gpio
+    pin: GPIO21
+    restore_mode: RESTORE_DEFAULT_OFF
+    id: relay_1
+    name: Relay 1
+  - platform: gpio
+    pin: GPIO47
+    restore_mode: RESTORE_DEFAULT_OFF
+    id: relay_2
+    name: Relay 2
+
+light:
+  - platform: esp32_rmt_led_strip
+    pin: GPIO42
+    num_leds: 1
+    rmt_channel: 0
+    chipset: WS2812
+    name: "RGB LED"
+    id: led
+    restore_mode: ALWAYS_ON
+    rgb_order: GRB
+
+ecodan:
+  id: ecodan_instance
+  uart_id: uart_ecodan
+  proxy_uart_id: uart_proxy