Advertisement
Guest User

Untitled

a guest
Jul 14th, 2023
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
YAML 1.65 KB | None | 0 0
  1. substitutions:
  2.   devicename: heatpump
  3.   description: Heatpump Controller
  4.   entity_prefix: Heatpump
  5.  
  6. globals:
  7.   - id: unmasked_value_water_temperature_t1s
  8.     type: int
  9.     restore_value: no
  10.     initial_value: '0'
  11.   - id: unmasked_curve_selection
  12.     type: int
  13.     restore_value: no
  14.     initial_value: '0'
  15.  
  16. esphome:
  17.   name: "${devicename}"
  18.   comment: "${description}"
  19.  
  20. esp32:
  21.   board: esp32dev
  22.   framework:
  23.     type: arduino
  24.  
  25. # Enable logging
  26. logger:
  27.   level: INFO
  28.   baud_rate: 0
  29.  
  30. # Enable Home Assistant API
  31.  
  32. ota:
  33. wifi:
  34.   ssid: !secret wifi_ssid
  35.   password: !secret wifi_password
  36.  
  37.   # Enable fallback hotspot (captive portal) in case wifi connection fails
  38.   ap:
  39.     ssid: "Esphome-Web-3F8D40"
  40.     password: "zHZ2Ur5uDMVz"
  41.  
  42. captive_portal:
  43. mqtt:
  44.   broker: "mqtt_broker_ip_address"
  45.   username: "mqtt_username"
  46.   password: "mqtt_password"
  47.  
  48. uart:
  49.   id: mod_bus
  50.   tx_pin: 17
  51.   rx_pin: 16
  52.   baud_rate: 9600
  53.   stop_bits: 1
  54.  
  55. modbus:
  56.   flow_control_pin: 5
  57.   id: heatpump_modbus
  58.  
  59. modbus_controller:
  60.   - id: "${devicename}"
  61.     ## the Modbus device addr
  62.     address: 0x1
  63.     modbus_id: heatpump_modbus
  64.     setup_priority: -10
  65.     update_interval: 10s
  66.  
  67. sensor:
  68.  # Register: 1
  69.   - platform: modbus_controller
  70.     modbus_controller_id: "${devicename}"
  71.     name: "${entity_prefix} Operational Mode"
  72.     id: "${devicename}_operational_mode"
  73.     register_type: holding
  74.     address: 0x1
  75.     value_type: U_WORD
  76.     on_value:
  77.         - mqtt.publish_json:
  78.             topic: "heatpump/operational_mode"
  79.             payload: |-
  80.               root["${entity_prefix} Operational Mode"] = id(${devicename}_operational_mode).state;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement