Pastebin
API
tools
faq
paste
Login
Sign up
Please fix the following errors:
New Paste
Syntax Highlighting
substitutions: friendly_name: "Solar Batt Heat Controller" esphome: name: "solar-battery-heat-controller" platformio_options: #upload_speed: 115200 # #REQUIRED FOR UART TO WORK board_build.extra_flags: - "-DARDUINO_USB_CDC_ON_BOOT=0" # Override, defaults to '-DARDUINO_USB_CDC_ON_BOOT=1' # external_components: # - source: github://ssieb/esphome@dallas # components: [ dallas ] # refresh: 1min external_components: - source: github://nrandell/dallasng esp32: board: featheresp32-s2 # pid climate log update is noisy, dial it back to warn logger: hardware_uart: uart0 level: DEBUG logs: climate: ERROR dht: WARN uart: - id: debug_uart rx_pin: 3 tx_pin: 1 baud_rate: 115200 debug: update_interval: 10s text_sensor: - platform: debug device: name: "Device Info" reset_reason: name: "Reset Reason" api: ota: # dallas: # - pin: 9 # update_interval: 1s dallasng: - pin: GPIO9 update_interval: 3s output: - platform: ac_dimmer id: dimmer gate_pin: GPIO18 zero_cross_pin: number: GPIO39 mode: INPUT_PULLUP method: leading pulse init_with_half_cycle: true web_server: port: 80 wifi: #use_address: 192.168.1.111 ssid: !secret wifi_ssid password: !secret wifi_password # Enable fallback hotspot (captive portal) in case wifi connection fails ap: ssid: "$friendly_name" password: "wifipassword" captive_portal: button: - platform: restart #allows remote reset of tywe1s chip from home assistant or internally id: restart_esp name: "$friendly_name Restart" - platform: safe_mode # required to upload firmware if were low on memory. put chip in safe mode, reboot, then OTA upload new firmware. name: "$friendly_name SAFE Mode BUTTON"# sensor: - platform: dallasng id: battery_probe name: "Solar-Batt Probe Temp" index: 0 resolution: 12 filters: - filter_out: NAN - platform: uptime internal: false name: ${friendly_name} Uptime id: uptime_s update_interval: 10s - platform: wifi_signal name: "$friendly_name WiFi Signal" update_interval: 10s id: wifi_signal_db - platform: copy # Reports the WiFi signal strength in % source_id: wifi_signal_db name: "$friendly_name WiFi Signal %" filters: - lambda: return min(max(2 * (x + 100.0), 0.0), 100.0); unit_of_measurement: "%" entity_category: "diagnostic" - platform: template #Pick the batt temp thats availble, HA BMS first otherwise the batt probe here in the ESP32 name: $friendly_name Valid Battery Temp id: valid_temp unit_of_measurement: "°C" lambda: |- if (global_api_server->is_connected()) { return id(bms_battery_temperature).state; } else { return id(battery_probe).state; } # GET TEMP FROM INVERTER in home assistant - platform: homeassistant entity_id: sensor.battery_temperature name: "BMS inverter temp " id: bms_battery_temperature # If you don't smooth the output readings # the PID controller over reacts to small changes. filters: #- lambda: return x * (9.0/5.0) + 32.0; # c to f - lambda: return (x - 32.0) * (5.0/9.0); //f to c, its coming in as F (x°F − 32) × 5/9 # - exponential_moving_average: # alpha: 0.1 # send_every: 1 # - platform: dallas # address: 0x0a01204e86cdca28 # name: "Solar-Batt Probe Temp" # id: battery_probe # filters: # - exponential_moving_average: # alpha: 0.1 # send_every: 1 # - filter_out: nan # #get rid of the noise from the sensor # - sliding_window_moving_average: # window_size: 3 # send_every: 1 - platform: template name: $friendly_name p term id: p_term unit_of_measurement: "%" accuracy_decimals: 2 - platform: template name: $friendly_name i term id: i_term unit_of_measurement: "%" accuracy_decimals: 2 - platform: template name: $friendly_name d term id: d_term unit_of_measurement: "%" accuracy_decimals: 2 - platform: template name: $friendly_name output value unit_of_measurement: "%" id: o_term accuracy_decimals: 2 - platform: template name: $friendly_name error value id: e_term accuracy_decimals: 2 - platform: pid name: "$friendly_name Heater level (PWM Voltage)" climate_id: console_thermostat type: HEAT ######################################################## # START THE HEATER CONTROLLER SETUP ######################################################## number: ## RECEIVE kp,ki and kd parameters from input_text.kx helpers in # Home Assistant. See the PID controller below # These helper values will get saved to flash thus permanently over-riding # the initial values set in the PID below. # KP - platform: template name: $friendly_name kp icon: mdi:chart-bell-curve restore_value: true min_value: 0 max_value: 50 step: 0.001 set_action: lambda: |- // ESP_LOGI("main", "!!!!!! kp from boot %d", id("console_fan_kp") ); // id(console_thermostat).set_kp( id("$friendly_name kp") ); id(console_thermostat).set_kp( x ); # KI - platform: template name: $friendly_name ki icon: mdi:chart-bell-curve restore_value: true min_value: 0 max_value: 50 step: 0.0001 set_action: lambda: id(console_thermostat).set_ki( x ); # KD - platform: template name: $friendly_name kd icon: mdi:chart-bell-curve restore_value: true min_value: -50 max_value: 50 step: 0.001 set_action: lambda: id(console_thermostat).set_kd( x ); # Expose a PID-controlled Thermostat # Manual: https://esphome.io/components/climate/pid.html climate: - platform: pid name: "$friendly_name Thermostat" id: console_thermostat #sensor: battery_probe sensor: valid_temp #Pick the one thats availble # LiFePo4 optimal temp default_target_temperature: 18.3C heat_output: dimmer deadband_parameters: threshold_high: 1.0°C threshold_low: -1.5°C visual: min_temperature: 10 °C max_temperature: 40 °C on_state: - sensor.template.publish: id: p_term state: !lambda 'return -id(console_thermostat).get_proportional_term() * 100.0;' - sensor.template.publish: id: i_term state: !lambda 'return -id(console_thermostat).get_integral_term()* 100.0;' - sensor.template.publish: id: d_term state: !lambda 'return -id(console_thermostat).get_derivative_term()* 100.0;' - sensor.template.publish: id: o_term state: !lambda 'return -id(console_thermostat).get_output_value()* 100.0;' - sensor.template.publish: id: e_term state: !lambda 'return -id(console_thermostat).get_error_value();' # See the README for setting up these parameters. # These are over ridden by the number templates above. control_parameters: kp: 0.32 ki: 0.0009 kd: 0.0 max_integral: 0.0
Optional Paste Settings
Category:
None
Cryptocurrency
Cybersecurity
Fixit
Food
Gaming
Haiku
Help
History
Housing
Jokes
Legal
Money
Movies
Music
Pets
Photo
Science
Software
Source Code
Spirit
Sports
Travel
TV
Writing
Tags:
Syntax Highlighting:
None
Bash
C
C#
C++
CSS
HTML
JSON
Java
JavaScript
Lua
Markdown (PRO members only)
Objective C
PHP
Perl
Python
Ruby
Swift
4CS
6502 ACME Cross Assembler
6502 Kick Assembler
6502 TASM/64TASS
ABAP
AIMMS
ALGOL 68
APT Sources
ARM
ASM (NASM)
ASP
ActionScript
ActionScript 3
Ada
Apache Log
AppleScript
Arduino
Asymptote
AutoIt
Autohotkey
Avisynth
Awk
BASCOM AVR
BNF
BOO
Bash
Basic4GL
Batch
BibTeX
Blitz Basic
Blitz3D
BlitzMax
BrainFuck
C
C (WinAPI)
C Intermediate Language
C for Macs
C#
C++
C++ (WinAPI)
C++ (with Qt extensions)
C: Loadrunner
CAD DCL
CAD Lisp
CFDG
CMake
COBOL
CSS
Ceylon
ChaiScript
Chapel
Clojure
Clone C
Clone C++
CoffeeScript
ColdFusion
Cuesheet
D
DCL
DCPU-16
DCS
DIV
DOT
Dart
Delphi
Delphi Prism (Oxygene)
Diff
E
ECMAScript
EPC
Easytrieve
Eiffel
Email
Erlang
Euphoria
F#
FO Language
Falcon
Filemaker
Formula One
Fortran
FreeBasic
FreeSWITCH
GAMBAS
GDB
GDScript
Game Maker
Genero
Genie
GetText
Go
Godot GLSL
Groovy
GwBasic
HQ9 Plus
HTML
HTML 5
Haskell
Haxe
HicEst
IDL
INI file
INTERCAL
IO
ISPF Panel Definition
Icon
Inno Script
J
JCL
JSON
Java
Java 5
JavaScript
Julia
KSP (Kontakt Script)
KiXtart
Kotlin
LDIF
LLVM
LOL Code
LScript
Latex
Liberty BASIC
Linden Scripting
Lisp
Loco Basic
Logtalk
Lotus Formulas
Lotus Script
Lua
M68000 Assembler
MIX Assembler
MK-61/52
MPASM
MXML
MagikSF
Make
MapBasic
Markdown (PRO members only)
MatLab
Mercury
MetaPost
Modula 2
Modula 3
Motorola 68000 HiSoft Dev
MySQL
Nagios
NetRexx
Nginx
Nim
NullSoft Installer
OCaml
OCaml Brief
Oberon 2
Objeck Programming Langua
Objective C
Octave
Open Object Rexx
OpenBSD PACKET FILTER
OpenGL Shading
Openoffice BASIC
Oracle 11
Oracle 8
Oz
PARI/GP
PCRE
PHP
PHP Brief
PL/I
PL/SQL
POV-Ray
ParaSail
Pascal
Pawn
Per
Perl
Perl 6
Phix
Pic 16
Pike
Pixel Bender
PostScript
PostgreSQL
PowerBuilder
PowerShell
ProFTPd
Progress
Prolog
Properties
ProvideX
Puppet
PureBasic
PyCon
Python
Python for S60
QBasic
QML
R
RBScript
REBOL
REG
RPM Spec
Racket
Rails
Rexx
Robots
Roff Manpage
Ruby
Ruby Gnuplot
Rust
SAS
SCL
SPARK
SPARQL
SQF
SQL
SSH Config
Scala
Scheme
Scilab
SdlBasic
Smalltalk
Smarty
StandardML
StoneScript
SuperCollider
Swift
SystemVerilog
T-SQL
TCL
TeXgraph
Tera Term
TypeScript
TypoScript
UPC
Unicon
UnrealScript
Urbi
VB.NET
VBScript
VHDL
VIM
Vala
Vedit
VeriLog
Visual Pro Log
VisualBasic
VisualFoxPro
WHOIS
WhiteSpace
Winbatch
XBasic
XML
XPP
Xojo
Xorg Config
YAML
YARA
Z80 Assembler
ZXBasic
autoconf
jQuery
mIRC
newLISP
q/kdb+
thinBasic
Paste Expiration:
Never
Burn after read
10 Minutes
1 Hour
1 Day
1 Week
2 Weeks
1 Month
6 Months
1 Year
Paste Exposure:
Public
Unlisted
Private
Folder:
(members only)
Password
NEW
Enabled
Disabled
Burn after read
NEW
Paste Name / Title:
Create New Paste
Hello
Guest
Sign Up
or
Login
Sign in with Facebook
Sign in with Twitter
Sign in with Google
You are currently not logged in, this means you can not edit or delete anything you paste.
Sign Up
or
Login
Public Pastes
OoT rando seed 6/13
2 hours ago | 202.05 KB
w
19 hours ago | 0.09 KB
[email protected]
- idiot sending fr...
21 hours ago | 1.35 KB
Untitled
1 day ago | 0.03 KB
Checking in availability
1 day ago | 0.66 KB
TRMP TOKEN
1 day ago | 1.56 KB
Untitled
1 day ago | 0.16 KB
my-push Script
1 day ago | 0.19 KB
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the
Cookies Policy
.
OK, I Understand
Not a member of Pastebin yet?
Sign Up
, it unlocks many cool features!