Still a few small snags, but feel free to try and let me know.
If you get on ok with it I’ll do some more tidying and get it on Hacs.
Still a few small snags, but feel free to try and let me know.
If you get on ok with it I’ll do some more tidying and get it on Hacs.
Just put the files onto Home Assistant and went to add it on the Integrations and I am just getting “Config flow could not be loaded” when trying to add it
I’ve only tested against the current stable and dev branches of HA. (core-2021.8.8).
Feel free to open an issue on github with the logs (keeps this forum tidier too).
Thanks.
Updated and got it going. Ill post any issues to GitHub
Do have this black for the user part but it might be a theme thing
Ah good stuff !
Hmm. I’ve had some odd issues with strings/translations but never on that step, odd.
Thanks for the heads up, this looks so much easier then messing around getting the DID etc.
@Wh1terat this looks great, i will have a try soon and see if everything is working ok.
It does look like the token does expire, i think in the other thread they said about every 6 months, you still get status updates but changes dont take effect.
@musicman2005 just a heads up buddy on this
Do I just add it as a custom repo in hacs, I am getting an error.
So I go to hacs, click repositories, paste https://github.com/Wh1terat/cleverspa-component
in and then select integration but I get an error.
“Repostitory structure for main is not compliant”
I tried copying the files to the custom_components folder instead but not sure what to do from there, integrations couldn’t find anything and same with hacs.
I am probably doing it wrong.
Any ideas ?
I think he will add it to HACS another time after testing, for now just do below.
Just copy the cleverspa-component folder to custom components so it’s like /custom_components/cleverspa-component/FILESHERE
Then restart and go to integrations and add.
Will have another go, I did drop the folder in and rebooted but didnt show up in integrations.
Maybe I was a bit quick
EDIT
Now working god knows, I got the same blank looking box for the login so I dont think that is theme thing but looks good.
Thanks for the testing, it is appreciated.
The lack of text is really odd. Not something I can see, but 2 people is not a co-incidence so will definitely investigate!
I’ve got a newer version to put up shortly, redone a couple of bits behind the scenes to make it a bit less hacky - and will be adding supporting manifests for hacs, brand logos etc shortly.
In that version I’ve remove the heater button as really you only need to a button that toggles the water_heater entity itself (same result).
Ideally speaking we could do with a dedicated love-lace card to make the best use of this integration.
I super appreciate the work you have done, it is a much better solution then the other way.
Quick question though, I like to leave my filter running all the time because it is a bit temperamental, it looks like when you toggle heater on/off it also toggles the filter, is there an easy way to change that at my end.
Whilst we dont have a decent frontend I have stuck together a picture-element for the time being.
MADE SOME CHANGES
Filter / Heater / Bubbles buttons work and now have lights
Centre is the current temp and the left is the target temp.
Up / down temp I have left alone, you just click on the target temp to set the temp.
type: picture-elements
elements:
- type: state-label
attribute: current_temperature
entity: water_heater.cleverspa_xxxxxxxxxxxxx_water_heater
style:
top: 54%
left: 50%
color: red
font-size: 4em
tap_action:
action: more-info
- type: state-label
attribute: temperature
entity: water_heater.cleverspa_xxxxxxxxxx_water_heater
style:
top: 54%
left: 18.5%
color: red
font-size: 2em
tap_action:
action: more-info
- type: service-button
service: switch.toggle
service_data:
entity_id: switch.cleverspa_xxxxxxxxxx_bubbles
style:
top: 53%
left: 80%
- type: service-button
service: switch.toggle
service_data:
entity_id: switch.cleverspa_xxxxxxxxxx_heater
style:
top: 75%
left: 70%
- type: service-button
service: switch.toggle
service_data:
entity_id: switch.cleverspa_xxxxxxxxxx_filter
style:
top: 30%
left: 70%
- type: image
entity: switch.cleverspa_xxxxxxxxxx_filter
image: local/filter_button.png
style:
top: 32%
left: 69%
width: 20%
state_image:
'on': local/filter_button.png
- type: image
entity: switch.cleverspa_xxxxxxxxxx_bubbles
image: local/bubble_button.png
style:
top: 53.6%
left: 80.94%
width: 20%
state_image:
'on': local/bubble_button.png
- type: image
entity: switch.cleverspa_xxxxxxxxxxx_heater
image: local/heater_button.png
style:
top: 75%
left: 69%
width: 20%
state_image:
'on': local/heater_button.png
image: local/controls1.png
Pic for the controls
@pops106 This looks good, I’ll have to look into an image for mine to do the same. It’s a shame the water_heater doesn’t allow temperature adjustment as an entity so we could use it in the picture element.
@Wh1terat how do you reset the filter age if it gets changed? Also, just added the HACS repo… what was the reason for removing the heater button? It’s nice to have that control as now the hot tub isn’t turning on the heater just using the water_heater part.
You should be able to grab the pics from the link at the bottom stick it together from the picture elements card
Oh and I made some changes, we now have lights
@pops106
Ah yes. This is me trying to implement a kind of cooldown function because seemingly when you turn the heater off it turns the filter off straight away too - and then the temp sky rockets as the the pump hasn’t cooled down.
If you have a look in water_heater.py remove the lines denoted with ** below, this will stop the automatic turning off of the filter.
async def async_turn_off(self):
"""Turn heater off and filter 30 secs later."""
await self.hass.async_add_executor_job(
self.coordinator.client.set_data,
self.coordinator.device_id,
self.info_type[CONF_COMMAND_OFF]
)
** # Not sure if this is 'naughty' or not
** self.hass.loop.call_later(
** COOLDOWN_TIME,
** self.hass.async_add_executor_job,
** self.coordinator.client.set_data,
** self.coordinator.device_id,
** {MAP_KEYS_INV['filter']: 0}
** )
await self.coordinator.async_request_refresh()
@AlexGreenUK
Filter age is readonly attribute, seems to be read from the pump itself - 10240 minutes triggers the replace filter warning.
According to the manual:
Once you have fitted a NEW filter press the GREEN button on the RCD plug to reset the system.
Re the Heater button, it really shouldn’t be needed?
- type: button
tap_action:
action: toggle
entity: water_heater.cleverspa_foobar_water_heater
show_state: true
name: Heater
hold_action:
action: none
icon: mdi:fire
@Wh1terat
Just upgraded HA to 2021.9.1 and added in the cleverspa component through hacs on v1.0.1 and all is good and working.
It would be nice to keep the heater on/off sensor for the front end so we can easily see if it is up and running.
Thank you for pointing out the code for the filter switching on and off with the heater, I will have a look.
My filter is basically bust, if I leave it off for a little while and switch it on the filter propeller is jammed and I have to hit it, kick it, or stick my finger in to get it going again so I just leave it on all the time.
Cheers
@pops106
That’s great to hear
The heater status should still work the same by getting the state of the water_heater entity.
However (who knows why) water_heater doesn’t support STATE_ON so I went with STATE_ELECTRIC as it seemed most appropriate from the list:
I’ll have a look into creating an options flow for the component so things like the cooldown function can be configured from the integrations page
Thanks. Running release HA 2022.8.1 and have CleverSpa model 8118.
Took me a bit to work this out but added https://github.com/Wh1terat/cleverspa-component
to HACS repositories, downloaded it and restarted.
Went to Settings → Devices & Service and clicked Add Integration and there it was! Entered my email address and password and shows up thanks and I can see/set temperature, toggle bubbles and filter.
I don’t see how to toggle the heater on/off though.
The bubbles and filter and simply switch entities, the heater is a water heater entity which has it’s own controls.
If you do want a button just to mimic the original app then you can add templated switch and then a regular button to your relevant card.
- 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 - will give it a go