Great - work, I’ll implement today on mine and let you know how it goes
I did also ping Huum, and ask about a local integration. The response was just “no, it requires wifi” so I’m not sure how technical the person was. Not sure how to make a formal request vs. just emailing their support, I can’t imagine they are that big of a company.
This may be to do with the different double-quotes you are using. I see that happen with mac computers trying to change them sometimes, trying to be clever, but it actually just messes it up.
You have: sauna_off: ‘curl -X POST “https://mail:[email protected]/action/home/stop”’
But it should be: sauna_off: 'curl -X POST "https://mail:[email protected]/action/home/stop"'
This worked great for me - updated code below (with unique_ids for area assignment) and as @Razor109 mentions you can dump the scripts.yaml and automations.yaml code. Only thing needed is adding the below to configuration.yaml
I am thinking it might be feasible to get rid of the shell commands and go straight rest but haven’t started to play around with that. I’d love to reduce the number of places my email and password is all over the yaml…
If I get some time this weekend I will dig into trying to get the target temp slider in degrees F vs. C
shell_command:
sauna_light_toggle: 'curl "https://<EMAIL>%40gmail.com:<PASSWORD>@api.huum.eu/action/home/light"'
sauna_off: curl -X POST https://<EMAIL>%40gmail.com:<PASSWORD>@api.huum.eu/action/home/stop
rest_command:
sauna_on:
url: https://api.huum.eu/action/home/start
username: <EMAIL>
password: <PASSWORD>
payload: '{"targetTemperature":{{ states("input_number.temperaturesauna")|int }} }'
verify_ssl: true
content_type: application/json
method: post
sensor:
- platform: rest
resource: https://api.huum.eu/action/home/status
username: <EMAIL>
password: <PASSWORD>
authentication: basic
unique_id: sauna_rest_status_2272022
scan_interval: 60
name: sauna_status
value_template: "OK"
json_attributes:
- door
- temperature
- targetTemperature
- statusCode
- light
- platform: template
sensors:
sauna_temperature:
unique_id: sauna_temperature_2272023
value_template: "{{ state_attr('sensor.sauna_status', 'temperature') }}"
device_class: temperature
unit_of_measurement: °C
sauna_target_temperature:
unique_id: sauna_target_temperature_2272023
value_template: "{{ state_attr('sensor.sauna_status', 'targetTemperature') }}"
device_class: temperature
unit_of_measurement: °C
sauna_door:
unique_id: sauna_door_2272023
value_template: >-
{% set state = state_attr('sensor.sauna_status', 'door') %}
{% if state == true %}Closed
{% elif state == false %}Open
{% else %}Unknown{% endif %}
sauna_light:
unique_id: sauna_light_2272023
value_template: >-
{% set state = state_attr('sensor.sauna_status', 'light') %}
{% if state == 0 %}off
{% elif state == 1 %}on
{% else %}Unknown{% endif %}
sauna_statuscode:
unique_id: sauna_statuscode_2272023
value_template: >-
{% set state = state_attr('sensor.sauna_status', 'statusCode') %}
{% if state == 230 %}Offline
{% elif state == 231 %}on
{% elif state == 232 %}off
{% elif state == 233 %}Blocked
{% elif state == 240 %}Emergency
{% else %}Unknown{% endif %}
light:
- platform: template
lights:
saunalight:
unique_id: sauna_light_2272023
friendly_name: "Sauna Light"
value_template: >-
{% set state = state_attr('sensor.sauna_status', 'light') %}
{% if state == 0 %}Off
{% elif state == 1 %}On
{% else %}Unknown{% endif %}
turn_on:
- service: shell_command.sauna_light_toggle
- delay: 00:00:01
- service: homeassistant.update_entity
target:
entity_id: sensor.sauna_status
turn_off:
- service: shell_command.sauna_light_toggle
- delay: 00:00:01
- service: homeassistant.update_entity
target:
entity_id: sensor.sauna_status
switch:
- platform: template
switches:
sauna:
unique_id: sauna_heater_2272023
friendly_name: "Sauna Heater"
value_template: >-
{% set state = state_attr('sensor.sauna_status', 'statusCode') %}
{% if state == 230 %}Offline
{% elif state == 231 %}On
{% elif state == 232 %}Off
{% elif state == 233 %}Blocked
{% elif state == 240 %}Emergency
{% else %}Unknown{% endif %}
turn_on:
- service: rest_command.sauna_on
- delay: 00:00:01
- service: homeassistant.update_entity
target:
entity_id: sensor.sauna_status
turn_off:
- service: shell_command.sauna_off
- delay: 00:00:01
- service: homeassistant.update_entity
target:
entity_id: sensor.sauna_status
input_number:
temperaturesauna:
name: Sauna Set Temperature
initial: 75
min: 41
max: 108
step: 1
I’m working on trying to sort out how to let the input slider be in F instead of C knowing that the HUUM API expects C… I’m not in a position to test this at the moment and fully admit my YAML is horrific but would something along these lines work? The first line is what works now getting an input already in C but if I switched the input to be in F, could it not simply be converted at submission? Again, potentially completely wrong here (wouldn’t surprise me if syntax is way off as well) and welcome input from smarter folks than I.
tested it this works for me, although sensor.sauna_temperature and sensor.sauna_target_temperature will still be in C. You can use the same template in the sensor.template to make them in F as well.
liking the new comments… planning on applying the same code updates to mine this week and testing it out. I’m all for streamlining the huum integration.
Thanks - this works - I don’t use the !secret bit - what is that function? Does it let me obfuscate my email and password a bit more from some of these files? I’m very much in favor of it if so.
# Use this file to store secrets like usernames and passwords.
# Learn more at https://www.home-assistant.io/docs/configuration/secrets/
huumemail: ********@gmail.com
huumpass: ********
unsure what version of HA you are running… but value_template is deprecated it must use state now.
should be seeing this in your logs:
> [value_template] is an invalid option for [template]
ignore that last comment… I may have had a typo in my config somewhere (sorted that out).
@Razor109
by disabling the light, switch, and input_boolean, I noticed you have the the light and sauna switch grayed out now, which is what I see on my side now also.
So how are you controlling the sauna on/off and light?
I had to re-enable my door and light sensor… which btw are both binary sensors (true/false), not sure how you guys are making these load/work as non-binary sensors ?
I run a split config (yaml)… so lots of files for me.
some of which I have thought about pushing into the UI Helper section once they offer full functionality
If you see something in there that could be deleted… let me know
/config/entities/
lights/huum_light.yaml (Sauna lights on/off via shell command)
switches/huum_switch.yaml (Switch to turn on/off sauna via rest command)
input_numbers/huum_input_number.yaml (Slider to set sauna temp)
sensors/huum_rest.yaml (Main sauna sensor to get status codes/light/door/temp via REST)
rest_command/huum_rest_command.yaml (Login creds to start sauna)
templates/huum/
huum_target_temperature.yaml (Fahrenheit sensor from sensor.sauna_status - target)
huum_temperature.yaml (Fahrenheit sensor from sensor.sauna_status - current)
sauna_door.yaml (Door status from sensor.sauna_status)
sauna_statuscode.yaml (Status codes from sensor.sauna_status)
so noticed today my HUUM isn’t showing anything in HA.
The HUUM app works fine, but the API connections to HA do not seem to be updating the sensors in HA anymore.
EDIT: I take that back… because this works
api.huum.eu/action/home/status
…so reviewing my configuration more.
Found my issue… I added a customize.yaml to my split configuration, which is somehow taking out all of my huum entities. Very strange.