-
Notifications
You must be signed in to change notification settings - Fork 4
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
[REQUEST] ControlMySpa integration for Home Assistant based on this libary #28
Comments
Hello @Hedda, thanks for reaching out! Unfortunately, I don't have the bandwidth to create a HA integration at this time. Feel free to start one and I might be able to help at a later time. Best, Aarno |
Have you seen this project @Hedda? I have some interest in an MQTT client for it in Python instead of JS. HA would be a great add-on; however, I believe MQTT is the way to go to allow other compatibility beyond HA. |
I've got this working in Home Assistant but it's somewhat clunky. First install this integration: https://github.com/custom-components/pyscript/ Then in your config folder create a "pyscript" folder, and in there place the file controlmyspa.py from this repository: https://raw.githubusercontent.com/arska/controlmyspa/main/controlmyspa.py Then in the same "pyscript" folder create a file called cmsConfig.py as follows:
Then in the same "pyscript" folder create a file called cmsGetCurrentTemp.py as follows:
The above requires a "helper" number device created with id input_number.hot_tub_temperature Call HA service "Pyscript Python scripting: cms_update_spa_temperature" to run the script, which will update the helper number with the temperature of the spa. You can have more scripts to do other things, for example I have one called cmsSpaOn.py as follows:
(my jets go off/low/high so I need to call set_jet twice to go to high) |
@garysargentpersonal I have been trying to get the cmsGetCurrentTemp working but running into this error. Any ideas? |
You need to create a helper device of type number with ID hot_tub_temperature Helpers are created in settings in HA near devices. They have their own screen. |
Thanks. I had the helper set to "input_number.hot_tub_temperature" and change it to "hot_tub_temperature" my inexperience with custom HA intragrations shows. Thanks for the help. Ever see this before? Sorry to bother. |
Not sure on that sorry, but since my original post I also had to add a root certificate into HA to support the new certificate they started using. Can't recall the exact details though. |
Got it to work. If the pump does not run, the current_temp does not show in the json data. Thanks again for the help! |
Can this script also update the temperature setting? Would be lovely to adjust the temperature according to electricity price. |
I don't know about the HA script, this library can set the temperature, which is how I'm currently adjusting the temperature according to electricity price: https://github.com/arska/controlmyspa-porssari |
Hello, Has anyone found a way to integrate controlmyspa into Home Assistant? I tried looking at your different code but I can't figure it out. I don't have enough knowledge. Thank you very much for your work |
I have not heard of any native Home Assistant integration for ControlMySpa cloud API nor Local API hacks, see discussion here: https://community.home-assistant.io/t/controlmyspa-integration-to-home-assistant/693076 Closest thing is still running ControlMySpa Home Assistant Addon by @mikakoivisto via MQTT which is not user-friendly to setup: Personally I gave up and ordered the old bwa™ Wi-Fi module (50350) to run the native Balboa Spa Client integration compoent for Home Assistant instead, so that way is all running locally: Hoping for others that someone will make a true native Home Assistant integration component for ControlMySpa in the future. Alternativly that someone will start selling an pre-made ESP32 based device or similar that can do all these same things locally. |
I did the same but the wifi module is awful and won't stay connected for more than ten minutes. Constantly up and down. |
FYI, the old bwa Wi-Fi module (50350) is infamously known for having issues with dropping/loosing WiFi connection, but really both my ControlMySpa Gateway Ultra (59303) and my bwa Wi-Fi module (50350) originally had similar WiFi connection issues until I finally created a dedicated SSID WPA2 WiFi network with 2.4GHz-only and 20 MHz Channel Width for just IoT devices, as well as reserved IP-address in DHCP-scope to each device. I also disabled all advanced features like Fast Roaming, BSS Transition, PMF (Protected Management Frames), etc. of that specific WiFi network. So this could be because using a shared SSID for 2.4GHz and 5GHz as well as using 40 MHz Channel Width are known to cause issues with older WiFi devices. Same with not reserving IP-address for the decvice in DHCP-scope. Since then those and some other older IoT WiFi devices I was having issues with seems to work almost all of the time, (including Withings products I were having similar problems with). For reference, I am using several Unifi WiFi Access Point series products from Ubiquiti so coverage it very good too. Otherwise the only other tip I have seen is having a continious ping to the WiFi module in order to force it to keep the connection alive. |
I've tried all those things, I've tried four different access points (including a really old one), I've had the access point a metre away from the module. In all cases the same happens - connects for 10 to 15 mins, disconnects for a long period, repeat. I'm going to try to get it swapped out as I can only think it must be faulty. |
@Hedda look at these times! Each time it reconnects, it is dead on the hour mark! That is no coincidence. |
@gary-sargent ok but if that is the old bwa module the. please post that to Home Assistent community forum instead of here in this issue as this is request is only about ControlMySpa cloud API and the new gateway, not the old module. |
@arska Would you consider writing a native "ControlMySpa" integration component for Home Assistant based on this library?
https://community.home-assistant.io/t/integration-for-a-spa-question-about-available-entities/156760/
Or alternatively, maybe extend the existing "Balboa Spa Client" to also add support for ControlMySpa cloud API as an option?
https://www.home-assistant.io/integrations/balboa/
There is also this other custom component Spa Client that is compatible with Balboa BP System + bwa WiFi module as well:
https://github.com/plmilord/Hass.io-custom-component-SpaClient
See Home Assistant Developer documentation on Starting with Development and building a new integration component for it:
https://developers.home-assistant.io/
https://developers.home-assistant.io/docs/development_index/
https://developers.home-assistant.io/docs/creating_component_index
https://developers.home-assistant.io/docs/integration_fetching_data/
The text was updated successfully, but these errors were encountered: