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

How to set temprature #5

Open
martijnbuts opened this issue Jun 1, 2023 · 20 comments
Open

How to set temprature #5

martijnbuts opened this issue Jun 1, 2023 · 20 comments

Comments

@martijnbuts
Copy link

How can you set the temperature?
I can read the sensors you created but how can i set the temperature or enable/disable the light?

@vBrolin
Copy link

vBrolin commented Jun 1, 2023

I use a number input helper and two automations to control the temp:

alias: Spa Temp Change
description: ""
trigger:

  • platform: state
    entity_id:
    • input_number.temp_spa
      condition: []
      action:
  • service: esphome.spa_set_target_temp
    data:
    temp: "{{ (states("input_number.temp_spa") ) }}"
    mode: single

This sets the spa to whatever you set the slider to.

alias: Spa Temp fix
description: ""
trigger:

  • platform: state
    entity_id:
    • sensor.target_temp
      condition: []
      action:
  • service: input_number.set_value
    data:
    value: "{{ states.sensor.target_temp.state }}"
    target:
    entity_id: input_number.temp_spa
    mode: single

This sets the number input slider to the correct value if it changes on the spa itself.

For the light and jetpump, I use template buttons:
switch:

  • platform: template
    switches:
    spajet:
    value_template: "{{ is_state('sensor.jet1', '1') }}"
    friendly_name: "Jet Spa"
    turn_on:
    - service: esphome.spa_toggle_jet1
    data: {}
    turn_off:
    - service: esphome.spa_toggle_jet1
    data: {}
    spalight:
    value_template: "{{ is_state('sensor.light', '1') }}"
    friendly_name: "Light Spa"
    turn_on:
    - service: esphome.spa_toggle_light
    data: {}
    turn_off:
    - service: esphome.spa_toggle_light
    data: {}

@martijnbuts
Copy link
Author

Thanks for the help! I like your work, with the description I got the spa connected in a day :)

@martijnbuts
Copy link
Author

Would it be possible to share the automation file on github? i am struggling with the ha configuration. ( i am more handy with the electronics)

@vBrolin
Copy link

vBrolin commented Jun 1, 2023

Check this file:
https://github.com/vBrolin/ESPHomeSpa/blob/main/Automation

Also added buttons for Heating Range and Heating mode that was asked for in another issue

@vBrolin
Copy link

vBrolin commented Jun 1, 2023

Mixed it up at first, but here's the automations with instructions:
https://github.com/vBrolin/ESPHomeSpa/blob/main/Automation

And here's the switches that goes in to the configuration file:
https://github.com/vBrolin/ESPHomeSpa/blob/main/Configuration

@martijnbuts
Copy link
Author

Could you also add the state of the heater to the spa.yaml, i dont know how to do it myself.
This is the status code
[19:24:37][D][Spa/heatingmode/state:258]: ON
[19:24:37][D][Spa/heatstate/state:275]: OFF

and the circulation pomp
[19:25:01][D][Spa/circ/state:312]: ON
[21:02:01][D][Spa/circ/state:303]: OFF

@vBrolin
Copy link

vBrolin commented Jun 1, 2023

Found some code in there that wasn't finished.
Added it in my fork, should give you status of both circ pump and heater

@martijnbuts
Copy link
Author

The status of the circ pomp and heater work now, Thanks,
the only thing is that the current temp does not work anymore.

I am really happy with your support!

@vBrolin
Copy link

vBrolin commented Jun 1, 2023

Did it break with this last change? It still works for me

@martijnbuts
Copy link
Author

Sorry, looks like it just take some time. The other values where available

@martijnbuts
Copy link
Author

Would it be possible to also share your dashboard? I create a switch in the HA dashboard but i get a error when i, for example, try to enable the light.

What i dont understand is how it should work.
i see that there is a switch in HA that points to esphome but in the spa.yaml there are no switches, only sensors. (sorry for all the
questions)

  spalight:
    value_template: "{{ is_state('sensor.light', '1') }}"
    friendly_name: "Spa Light"
    turn_on:
      -  service: esphome.spa_toggle_light
         data: {}

@vBrolin
Copy link

vBrolin commented Jun 2, 2023 via email

@martijnbuts
Copy link
Author

martijnbuts commented Jun 2, 2023

In the developer tools, services i can switch the light and set the temp. i will try to add it as a card in my dashboard. Thanks for the help again!

Update i can now set the temp with toggles with a fixt value like 37 or 35 but i will look into how to create a slider like your dashboard.

@martijnbuts
Copy link
Author

martijnbuts commented Jun 2, 2023

Found some code in there that wasn't finished. Added it in my fork, should give you status of both circ pump and heater

The strange thing is that i [Spa/circ/state:311 on but the value of Circulation Pump is off.

Edit i see that the first circ have a state number 312 so there are 2 different status codes

@vBrolin
Copy link

vBrolin commented Jun 2, 2023

Yeah it seems that it's not working properly, I'll try look into it this weekend, but my knowledge might be to limited to resolve this.

@reicharb
Copy link

reicharb commented Feb 8, 2024

can't all of this be put into the esphome yaml?

@martijnbuts
Copy link
Author

martijnbuts commented Feb 8, 2024

I think it would be possible to create all functions in esphome but this is now not the case. I use the code from june 2023 and it works good. The function i miss is the option see if the circulation pomp is on and if possible activate the circulation pomp. I want this so i can add a heat exchanger to the spa for my heat pomp.

This is my spa interface in home assistant
image

And this is in the web server of ESPHOME
image

@martijnbuts
Copy link
Author

Hi vBrolin, i see that some people are working on the option to set the time via esphome. (link esphome/esphome#6191) If added to the release, can you maybe add this option to the code? Now it logs all the time changes to the log and i think the option to set the time via the web interface is also handy
image

@reicharb
Copy link

I think it would be possible to create all functions in esphome but this is now not the case. I use the code from june 2023 and it works good. The function i miss is the option see if the circulation pomp is on and if possible activate the circulation pomp. I want this so i can add a heat exchanger to the spa for my heat pomp.

This is my spa interface in home assistant image

And this is in the web server of ESPHOME image

Is your Circulation Pump just jet1 on low speed? I created an addtional Jet output to my code to add Jet1Low speed. Not sure if thats the same thing you are talking about.

@martijnbuts
Copy link
Author

martijnbuts commented Feb 21, 2024

I think the circulation pomp is just the jet pomp on low speed. When the heater is turn on the pomp slowly pump some water but i am puzzeling what the best option is when i want to use a heat exchanger, add a relay between the heater and put the temp settings higher (extra hardware to be added to the spa) of put the jet1 pomp on with the slow via the RS485 interface .

How did you change the code to add the option to set the jet1 pomp on slow? (i dont have a lot of coding skils )

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