Created
August 26, 2021 16:37
-
-
Save bessarabov/35ef907af6b475b0f3f3bb230d97a5fa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Based on https://community.home-assistant.io/t/esphome-blitzwolf-bw-shp6-configuration/113938/13?u=bessarabov | |
substitutions: | |
device_name: bw_shp8_boiler | |
upper_devicename: "BW-SHP8 Boiler" | |
# Higher value gives lower watt readout | |
current_res: '0.00221' | |
# Lower value gives lower voltage readout | |
voltage_div: '825' | |
esphome: | |
name: ${device_name} | |
platform: ESP8266 | |
board: esp8285 | |
on_boot: | |
priority: -10 | |
then: | |
- light.turn_on: ${device_name}_blue_led_light | |
wifi: | |
ssid: !secret wifi_ssid | |
password: !secret wifi_password | |
logger: | |
api: | |
password: !secret api_password | |
ota: | |
password: !secret ota_password | |
time: | |
- platform: homeassistant | |
id: homeassistant_time | |
binary_sensor: | |
- platform: gpio | |
id: ${device_name}_button | |
pin: | |
number: GPIO3 | |
inverted: True | |
mode: INPUT_PULLUP | |
on_press: | |
- switch.toggle: ${device_name}_relay | |
- platform: status | |
name: "${upper_devicename} Status" | |
id: ${device_name}_status | |
output: | |
- platform: esp8266_pwm | |
pin: GPIO13 | |
inverted: true | |
id: ${device_name}_blue_led | |
light: | |
- platform: monochromatic | |
name: "${upper_devicename} Blue LED" | |
output: ${device_name}_blue_led | |
id: ${device_name}_blue_led_light | |
switch: | |
- platform: gpio | |
pin: GPIO14 | |
id: ${device_name}_relay | |
name: '${upper_devicename} Relay' | |
on_turn_on: | |
- light.turn_off: ${device_name}_blue_led_light | |
on_turn_off: | |
- light.turn_on: ${device_name}_blue_led_light | |
- platform: restart | |
name: "${upper_devicename} Restart switch" | |
sensor: | |
- platform: uptime | |
name: '${upper_devicename} Uptime' | |
update_interval: 60s | |
- platform: wifi_signal | |
name: "${upper_devicename} WiFi Signal Sensor" | |
update_interval: 300s | |
id: ${device_name}_wifisignal | |
- platform: hlw8012 | |
sel_pin: | |
number: GPIO12 | |
inverted: true | |
cf_pin: GPIO04 | |
cf1_pin: GPIO05 | |
current_resistor: ${current_res} | |
voltage_divider: ${voltage_div} | |
current: | |
name: '${upper_devicename} Current' | |
unit_of_measurement: 'A' | |
accuracy_decimals: 3 | |
icon: mdi:flash-outline | |
voltage: | |
name: '${upper_devicename} Voltage' | |
unit_of_measurement: 'V' | |
accuracy_decimals: 0 | |
icon: mdi:flash-outline | |
power: | |
id: '${device_name}_power' | |
name: '${upper_devicename} Power' | |
unit_of_measurement: 'W' | |
icon: mdi:flash-outline | |
change_mode_every: 4 | |
update_interval: 5s | |
- platform: total_daily_energy | |
name: "${upper_devicename} Total Daily Energy" | |
power_id: '${device_name}_power' | |
filters: | |
# Multiplication factor from W to kW is 0.001 | |
- multiply: 0.001 | |
unit_of_measurement: kWh | |
icon: mdi:clock-alert | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment