Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability to toggle heat range (ready <> rest) and heat mode (high <> low)? #3

Open
Warrior700 opened this issue Dec 22, 2022 · 2 comments

Comments

@Warrior700
Copy link

Hi,

Is it possible to add a change function for heat range (ready <> rest) and heat mode (high <> low)? Or turn on the lights?

I'm a noob in C++ and it's hard to get into. I try to build it up on a M5Atom with rs485 interface.

THX warrior

@Warrior700 Warrior700 changed the title Add ability to toggle between heating range and heating mode? Add ability to toggle heat range (ready <> rest) and heat mode (high <> low)? Dec 22, 2022
@vBrolin
Copy link

vBrolin commented Jun 1, 2023

I have added this in my fork:
https://github.com/vBrolin/ESPHomeSpa/blob/main/spa_reader.h
Gives you a service call for Heat and Range

@Gamerayers
Copy link

Hi @vBrolin, I've tried to improve what you have. With these changes, you can basically create this yaml, you don't need to make the switches. It isn't clean, and basically does it by calling on Home Assistant to do the action, but it means no custom switches. That said, I couldn't figure out the thermostat for it.

`substitutions:
device_name: hottub #change
friendly_name: Hot Tub #change
icon: "mdi:hot-tub"
api_encrypt: "custom"

esphome:
name: ${device_name}
friendly_name: ${friendly_name}
includes:
- spa_reader.h

libraries:
- rlogiacco/CircularBuffer

esp32:
board: esp32dev
framework:
type: arduino

Enable logging

logger:

wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
fast_connect: true
ap:
ssid: ${device_name}
password: !secret esphome_ap_password

Enable Home Assistant API

api:
encryption:
key: ${api_encrypt}

ota:

  • platform: esphome
    password: !secret esphome_ota_password

Enable web server

web_server:
port: 80

captive_portal:

uart:
id: spa_uart_bus
tx_pin: GPIO17
rx_pin: GPIO16
data_bits: 8
parity: NONE
stop_bits: 1
baud_rate: 115200
rx_buffer_size: 128

sensor:

  • platform: custom
    lambda: |-
    auto spareader = new SpaReader(id(spa_uart_bus));
    App.register_component(spareader);
    return {spareader->temp_sensor,spareader->target_temp_sensor,spareader->jet1_sensor,spareader->jet2_sensor,spareader->blower_sensor,spareader->light_sensor,spareader->restmode_sensor,spareader->highrange_sensor,spareader->hour_sensor,spareader->minute_sensor,spareader->heater_sensor,spareader->circ_sensor};

    sensors:

    • name: "Current Temp"
      id: current_temp
      unit_of_measurement: °F
      accuracy_decimals: 2
    • name: "Target Temp"
      id: target_temp
      unit_of_measurement: °F
      accuracy_decimals: 2
    • name: "Jet1"
      id: jet1
      disabled_by_default: true
    • name: "Jet2"
      id: jet2
      disabled_by_default: true
    • name: "Blower"
      id: blower
    • name: "Light"
      id: hot_tub_light
      disabled_by_default: true
    • name: "Rest Mode"
    • name: "High Range"
    • name: "Hour"
    • name: "Minute"

switch:

  • platform: template
    name: "Jet 1"
    id: sw_jet1
    lambda: |-
    if (id(jet1).state == 1) {
    return true;
    } else {
    return false;
    }
    turn_on_action:
    • homeassistant.service:
      service: esphome.hottub_toggle_jet1
    • homeassistant.service:
      service: esphome.hottub_toggle_jet1
      turn_off_action:
    • homeassistant.service:
      service: esphome.hottub_toggle_jet1
  • platform: template
    name: "Jet 2"
    id: sw_jet2
    lambda: |-
    if (id(jet2).state == 1) {
    return true;
    } else {
    return false;
    }
    turn_on_action:
    • homeassistant.service:
      service: esphome.hottub_toggle_jet2
      turn_off_action:
    • homeassistant.service:
      service: esphome.hottub_toggle_jet2
  • platform: template
    name: "Hot Tub Light"
    id: sw_hot_tub_light
    lambda: |-
    if (id(hot_tub_light).state == 1) {
    return true;
    } else {
    return false;
    }
    turn_on_action:
    • homeassistant.service:
      service: esphome.hottub_toggle_light
      turn_off_action:
    • homeassistant.service:
      service: esphome.hottub_toggle_light
      `

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants