mikakoivisto / controlmyspa-ha-mqtt

GNU General Public License v3.0
13 stars 5 forks source link

Setup help needed #2

Closed cristimi closed 1 year ago

cristimi commented 2 years ago

I am really interested of your project. I own a spa with Controlmyspa module and I have homeassistant setup working. I feel like I am not experienced enough to setup the docker container that uses the js code by myself. Would it be possible for you to give a few more details on how to get it up and working ?

mikakoivisto commented 2 years ago

I run the docker version of Home assistant so I have everything setup in one docker-compose.yml

This is the part I have for this add on. It could also be totally standalone as long as it can communicate with the mqtt server connected to home assistant.

controlmyspa-ha-mqtt: container_name: controlmyspa-ha-mqtt image: controlmyspa-ha-mqtt build: context: controlmyspa-ha-mqtt dockerfile: Dockerfile links:

Since this quite work in progress still you need to build the docker image yourself but that is quite simple. Just run docker-compose up -d --build controlmyspa-ha-mqtt in the directory where you have the docker-compose.yml file. I use environment variables to configure my controlmyspa credentials.

Here's what I have in my docker.env CONTROLMYSPA_USER=USERNAMEHERE CONTROLMYSPA_PASS=PASSWORDHERE CONTROLMYSPA_POLL_INTERVAL=600

mikakoivisto commented 2 years ago

Looks like this messes up the indentation but there's a sample docker-compose.yml in the project root directory that has pretty much the same info.

cristimi commented 2 years ago

Thanks! I run HASSIO on a NUC and I had already MQTT broker installed. I have filled in credentials for MQTT in docker env file, and deleted the MQTT container from docker-compose.yml file. Homeassistant auto-discovered the MQTT package and now I have a climate entity working in HA.

For the sake of others that will want to use it so does the config files look like for me:

docker-compose.yaml

version: '3.3'
services:
  controlmyspa:
    container_name: controlmyspa-mqtt
    image: controlmyspa-mqtt
    build:
      context: ./controlmyspa-mqtt   #path to files from the location of docker-compose.yaml file
    env_file:
      - controlmyspa-mqtt/docker.env

docker.env

CONTROLMYSPA_USER="cmsuser"
CONTROLMYSPA_PASS="cmspass"
CONTROLMYSPA_POLL_INTERVAL=600
MQTTHOST="mqtt server ip adress"
MQTTPORT="1883"
MQTTHASSTOPIC="homeassistant"
MQTTUSER="mqttuser(if any)"
MQTTPASSWORD="mqttpass (if any)"

Command to run the container: docker-compose up -d --build controlmyspa

Harri-V commented 2 years ago

I was able to follow theses instructions and create a docker container. Now I can listen mqtt messages with Mosquitto in topic homeassistant/climate/#

I get: { "mode": "heat", "target_temp": "36.0", "current_temp": "36.0" }

Should I be able to get something else? I suppose this does not "make" any device into Homeassistant? Is it possible to send something back to Controlmyspa to change some settings?

mikakoivisto commented 2 years ago

The integration uses homeassitant auto discovery through mqtt and creates entities automatically in home assistant. It's still a bit buggy i.e. doesn't handle very well the fact that controlmyspa does not always report the values but rather returns NaN.

mikakoivisto commented 1 year ago

I finally had time to do a complete rewrite and now the whole thing should be much more stable. It's also published to docker hub so no need to build it locally to run it.