-
Notifications
You must be signed in to change notification settings - Fork 2
Can see spa information and status but can't control it #5
Comments
Not sure why your reply didn't get appended here (but I did get the email). I'm guessing it's a different product and someone at Cleverspa isn't being consistent as it still works perfectly for me with the lowercase. I'd suggest setting up mitmproxy and see whats sent when you use the official app for your model of spa. |
Sorry, I deleted the reply as I realised what I'd put was actually incorrect. Although I can get it to work manually, the methodology of what I was doing was the same as your code. From what I can tell, since you're just using MAP_KEYS table to rename the keys for the code side of things, you're still sending back "Heater". Much like "Temperature_setup" is just re-pointed to "target_temperature" and then when it gets sent back to the API it uses the original name. Is there any way I can debug what the integration is doing? Get more verbose returns from the functions or something? |
Sorry, meant heater with a capital H. map_keys just converts the key names to something more natural english sounding (superheating/undercooling aren't 100% obvious) HA did add some functionality for user debugging a few releases ago but this is such a seldom used integration I really don't intend on extending it's functionality at all. It's a pretty trivial API; best bet is still to look and see what the official client is doing first. |
Just to rule anything else out, I've put my local branch into dev: Don't recall actually fixing anything other than the 6monthly reauth flow; but who knows. Worth a try |
Thanks, I'll give it a go tomorrow and let you know how I get on. |
The water heater entity was a forked subset of climate originally but seems like the unloved, poorer cousin at this point. This is the only one I ever bothered making and purely because one didn't exist before! Personally I find HA as a framework to be a complete maze of incomplete (or more commonly, outdated) and conflicting documentation with very little in the way of guidance of the best way to do certain things. The only guidance being existing well maintained integrations. (and even then you'll often see a multitude of differing approaches to the same task). But if you're proficient in Python, why not give it a go! |
Thought I'd check in to see how you're doing. I'd forgotten to mention you'd be better of breaking the water heater out into a separate sensor and switch, you can just use a standard button then and will have the correct on/off state colour. sensor:
- platform: template
sensors:
cleverspa_current_temperature:
friendly_name: "CleverSpa Current Temperature"
unique_id: "cleverspa_qhadrjyhd2r2yh9td22upj_temp"
unit_of_measurement: "°C"
value_template: "{{ state_attr('water_heater.cleverspa_qhadrjyhd2r2yh9td22upj_water_heater', 'current_temperature') }} "
device_class: temperature
switch:
- platform: template
switches:
cleverspa_heater:
friendly_name: "CleverSpa Heater"
unique_id: "cleverspa_qhadrjyhd2r2yh9td22upj_heater"
value_template: "{{ is_state('water_heater.cleverspa_qhadrjyhd2r2yh9td22upj_water_heater', 'electric') }}"
turn_on:
service: water_heater.turn_on
target:
entity_id: water_heater.cleverspa_qhadrjyhd2r2yh9td22upj_water_heater
turn_off:
service: water_heater.turn_off
target:
entity_id: water_heater.cleverspa_qhadrjyhd2r2yh9td22upj_water_heater |
Thanks for checking in, I actually opted to combine both your code and another piece of code to create a climate version instead of the water heater version and it's been working fine for what I needed. I have some errors in my code but it does definitely work as intended for now. I can now manage the temperature like a true thermostat/climate control system and I can turn the heater on/off as required. |
Ah glad to hear you've got something working as you wanted 👍 Thank you for the credit, always nice to inspire others to build on and improve! 🚀 The water heater entity does actually work like a true thermostat, you simply set a target temperature (water_heater.set_temperature) - as well as supporting standard on/off features by calling water_heater.turn_on / water_heater.turn_off. Climate works the same way as water heater is just a subset; but admittedly somewhat unloved by comparison - the lack of any decent lovelace card out of the box somewhat doomed it in my opinion 😞 |
I've recently installed this to control my new hot tub but unfortunately can't get any actions to work.
It shows me all the relevant information, temperatures, heater/bubble status etc but if I try to turn off the heater for instance, it just toggles the option back to the way it was and doesn't command the hot tub to do anything.
Any help would be appreciated
The text was updated successfully, but these errors were encountered: