sgregori / nspanel_thermostat Goto Github PK
View Code? Open in Web Editor NEWThis project forked from sballano/nspanel_thermostat
ESPHome and TFT configuration files to create a thermostat with a NSPanel device
License: MIT License
This project forked from sballano/nspanel_thermostat
ESPHome and TFT configuration files to create a thermostat with a NSPanel device
License: MIT License
external_components:
substitutions:
node_name: nspanel
device_name: NSPanel
target_temp_normal: 21.0 °C
target_temp_away: 21.0 °C
esphome:
name: $node_name
comment: $device_name
esp32:
board: esp32dev
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
manual_ip:
static_ip: 192.168.1.74
gateway: 192.168.1.1
subnet: 255.255.255.0
ap:
ssid: "Panel Fallback Hotspot"
password: "MsRx7nEeio2B"
logger:
baud_rate: 0
level: VERBOSE
logs:
rtttl: none
#homeassistant: DEBUG
binary_sensor: none
nextion: none
ledc.output: none
resistance: none
ntc: none
sensor: none
sensor.filter: none
nextion_sensor: none
api.service: none
esp32.preferentes: none
#climate: DEBUG
#homeassistant.service: DEBUG
scheduler: none
json: none
api: none
ota:
password: !secret ota_pwd
api:
encryption:
key: "Y/HgkY8GkhF5U3W2sFwXd0302o72Jz/aaHS+flR0dIY="
services:
# Service to play a song
- service: play_rtttl
variables:
song_str: string
then:
- rtttl.play:
rtttl: !lambda 'return song_str;'
- service: upload_tft
then:
- lambda: 'id(disp1)->upload_tft();'
web_server:
port: 80
time:
button:
binary_sensor:
- script.execute: tft_wake_up
platform: gpio
name: $device_name Right Button
pin:
number: 27
inverted: true
on_press:
then:
- climate.control:
id: caldera
mode: !lambda |-
if (id(caldera).mode==CLIMATE_MODE_HEAT)
{
id(disp1).set_component_text_printf("page0.btn1", "ACTIVO : FRIO");
return CLIMATE_MODE_COOL;
}
else
{
id(disp1).set_component_text_printf("page0.btn1", "ACTIVO : CALOR");
return CLIMATE_MODE_HEAT;
}
- lambda: !lambda |-
if (id(caldera).mode==CLIMATE_MODE_HEAT)
{
id(disp1).set_component_text_printf("page0.btn1", "ACTIVO : FRIO");
}
else
{
id(disp1).set_component_text_printf("page0.btn1", "ACTIVO : CALOR");
}
- script.execute: tft_wake_up
platform: nextion
name: $device_name Down Button
page_id: 0
component_id: 7
on_press:
then:
- climate.control:
id: caldera
target_temperature_low: !lambda |-
if ( id(caldera).mode == CLIMATE_MODE_COOL )
{
return id(caldera).target_temperature_low - 0.5;
id(disp1).set_component_text_printf("page0.setTemp", "%.1f""\xb0", id(caldera).target_temperature_low);
}
else
{
return id(caldera).target_temperature_low;
id(disp1).set_component_text_printf("page0.setTemp", "%.1f""\xb0", id(caldera).target_temperature_low);
}
target_temperature_high: !lambda |-
if ( id(caldera).mode == CLIMATE_MODE_HEAT )
{
return id(caldera).target_temperature_high - 0.5;
id(disp1).set_component_text_printf("page0.setTemp", "%.1f""\xb0", id(caldera).target_temperature_high);
}
else
{
return id(caldera).target_temperature_high;
id(disp1).set_component_text_printf("page0.setTemp", "%.1f""\xb0", id(caldera).target_temperature_high);
}
- lambda: !lambda |-
if ( id(caldera).mode == CLIMATE_MODE_COOL )
{
id(disp1).set_component_text_printf("page0.setTemp", "%.1f""\xb0", id(caldera).target_temperature_low);
}
else
{
id(disp1).set_component_text_printf("page0.setTemp", "%.1f""\xb0", id(caldera).target_temperature_high);
}
sensor:
platform: wifi_signal
name: $device_name WiFi Signal
update_interval: 60s
platform: adc
id: ntc_source
pin: 38
update_interval: 10s
attenuation: 11db
platform: resistance
id: resistance_sensor
sensor: ntc_source
configuration: DOWNSTREAM
resistor: 11.2kOhm
platform: ntc
id: temperature
sensor: resistance_sensor
accuracy_decimals: 2
filters:
platform: homeassistant
id: ext_temperature
entity_id: sensor.exterior_temperature
attribute: temperature
on_value:
then:
- lambda: 'id(disp1).set_component_text_printf("page0.extTemp", "%.1f""\xb0", x);'
platform: homeassistant
id: wind_speed
entity_id: weather.aemet_daily
attribute: wind_speed
unit_of_measurement: "km/h"
on_value:
then:
- lambda: 'id(disp1).set_component_text_printf("page0.wind", "%i km/h""\xb0", (int)id(wind_speed).state);'
platform: nextion
id: current_page
name: "current_page"
internal: true
accuracy_decimals: 0
variable_name: dp
update_interval: 1s
text_sensor:
script:
id: tft_weather_update
then:
id: tft_date_update
then:
id: tft_time_update
then:
id: tft_wake_up
then:
id: abrir_frio
then:
id: abrir_calor
then:
id: cerrar
then:
switch:
platform: gpio
id: screen_power
entity_category: config
pin:
number: 4
inverted: true
restore_mode: ALWAYS_ON
platform: template
name: $device_name auto sleep
id: auto_sleep
entity_category: config
restore_state: true
optimistic: true
on_turn_on:
number:
output:
rtttl:
id: buzzer
output: buzzer_out
uart:
id: tf_uart
tx_pin: 16
rx_pin: 17
baud_rate: 115200
display:
climate:
platform: thermostat
id: caldera
name: $device_name Thermostat
sensor: temperature
default_target_temperature_low: 18
default_target_temperature_high: 28
heat_deadband: 0.2
heat_overrun: 0.2
cool_deadband: 0.2
cool_overrun: 0.2
min_heating_off_time: 1s
min_heating_run_time: 1s
min_cooling_off_time: 1s
min_cooling_run_time: 1s
min_idle_time: 1s
cool_action:
heat_action:
- script.execute: abrir_calor
idle_action:
- logger.log: IDLE - cerramos rejilla
- script.execute: cerrar
on_state:
- logger.log: "estoy encendido"
- lambda: !lambda |-
if ( id(caldera).mode == CLIMATE_MODE_COOL )
{
id(disp1).set_component_text_printf("page0.setTemp", "%.1f""\xb0", id(caldera).target_temperature_low);
}
else
{
id(disp1).set_component_text_printf("page0.setTemp", "%.1f""\xb0", id(caldera).target_temperature_high);
}
visual:
min_temperature: 18
max_temperature: 28
temperature_step: 0.1
away_config:
default_target_temperature_low: 19
default_target_temperature_high: 27
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.