Skip to content

Tools for communicating with the Chiltrix CX34 heat pump using a Raspberry Pi

License

Notifications You must be signed in to change notification settings

gonzojive/heatpump

Repository files navigation

Chiltrix CX34 dashboard software

This project is used to communicate with a hydronic heating system that uses the Chiltrix CX34 air-to-water heat pump. The components of the system are as follows:

  1. A Raspberry Pi.

  2. The Chiltrix CX34 heat pump chiller. The Pi communicates with the chiller using using serial communication, which is used natively by the CX34 to talk with its controller per the wiring diagram and ProtoAir FPA-W44 manual.

  3. A USB-to-RS484 dongle that connects the Raspberry Pi to the Chiltrix. This device should show up as /dev/ttyUSB0.

  4. Optional DS18B20 temperature sensors, which can now be bought for about $2 each. Several temperature sensors can be connected to single GPIO port on the Pi. I followed this guide to get up and running and then wrote the github.com/gonzojive/heatpump/tempsensor Go package to read the sensor values.

screenshot of dashboard as of 2020/12/24

There is also work in progress Google Home integration, which allows setting the temperature of the fan coil units from the Google Home app. You can also say commands like:

  • "Set the temperature to 72 degrees"
  • "Set the fan speed to low"

screenshot of dashboard as of 2020/12/24

Implementation notes

This project is written in Go.

Setup

Software installation

Install go on the Raspberry Pi according to the official instructions.

Install the collector binary as of the latest version:

go install github.com/gonzojive/heatpump/cmd/cx34collector@latest github.com/gonzojive/heatpump/cmd/cx34install@latest

Install the systemd service so the service runs at boot.

sudo `which cx34install`

Inspect the logs with

journalctl -u cx34collector.service

CX34 control

General development tips

Wiring

The Chiltrix uses RS485 to communicate with its controller. I have a USB-to-RS484 with a ch340T chip and pins labelbed "A / D+" and "B / D-".

TODO: more info

ssh access with password login disabled

My ~/.ssh/config has a section like

Host waterpi
    HostName 192.168.86.22
    User pi

and the Pi's ~/.ssh/authorized_hosts and /etc/ssh/sshd_config has a section with

# To disable tunneled clear text passwords, change to no here!
PasswordAuthentication no

sshfs

Mounting the Raspberry Pi's OS can be helpful for developing on a workstation. I followed this guide and ran these commands:

sudo mkdir /mnt/waterpi
sudo chown <YOUR_USERNAME> /mnt/waterpi
sudo sshfs -o "allow_other,default_permissions,IdentityFile=/home/<YOUR_USERNAME>/.ssh/id_rsa" pi@192.168.86.22:/ /mnt/waterpi

Fan coil unit control and scheduling

There is a gRPC server that can be started for getting and setting fan coil state. Run this command on the fan coil unit:

go run fancoil/cmd/fancoil_status/fancoil_status.go --alsologtostderr --start-server --grpc-port 8083

You can then run the scheduler on the device:

go run fancoil/cmd/fancoil_schedule/fancoil_schedule.go --alsologtostderr --fancoil-service localhost:8083

Cloud services

For the Google Home app integration to work, some cloud-hosted services are needed. These can be deployed as follows:

1) Build and push docker images

(optional): Build the docker images used to run all of the services. This is also done automatically by a Cloud Build hook that is triggered by pushes to main, but it can be useful for pushing local images.

./cloud/deployment/cloudbuild/image-pusher/push-all-images.sh

2) Update the images referenced by the Terraform config

Terraform is used to deploy the Cloud Run images based on the contents of cloud/deployment/terraform/environments/infra-dev/image-versions.json, which is pulled into the main terraform config cloud/deployment/terraform/environments/infra-dev/main.tf.

To update the pinned version of the images, run the following:

bazel run --run_under="cd $PWD &&" //cmd/cloud/update-image-versions -- --alsologtostderr --input "cloud/deployment/terraform/environments/infra-dev/image-versions.json" --output "cloud/deployment/terraform/environments/infra-dev/image-versions.json"

3) Configure the Actions Console settings

The following linkes might need to be updated if the Cloud Run deployment changes significantly:

https://console.actions.google.com/u/0/project/hydronics-9f50d/actions/smarthome/ https://console.actions.google.com/u/0/project/hydronics-9f50d/smarthomeaccountlinking/

About

Tools for communicating with the Chiltrix CX34 heat pump using a Raspberry Pi

Resources

License

Stars

Watchers

Forks

Packages

No packages published