A REST API server which provides control over IVT heatpumps, which uses a Rego6xx controller. It runs on the AVR-NET-IO board from Pollin.
- Rego6xx Server
- Motivation
- Electronic
- Software
- REST API
- Get temperature sensor value (GET /api/sensors/<sensor>)
- Set temperature value (POST /api/sensors)
- Send raw command (POST /api/debug)
- Get last error information (GET /api/lastError)
- Get frontpanel LED state (GET /api/frontPanel/<led>)
- Get display content (GET /api/display/<row>)
- Manipulate frontpanel keyboard and wheel (POST /api/frontPanel/<hmiDevice>)
- Issues, Ideas And Bugs
- License
- Contribution
I have a photovoltaic system (PV) on the roof of the house. If the PV provides enough energy, the idea is to store it in form of hot water with the heatpump. Unfortunately my Junkers heatpump (original build by IVT) has no interface to do that. Therefore the service interface of the build-in reg6xx controller shall be used to change the target temperature of hot water.
The installed SolarEdge inverter provides a modbus tcp interface, which is used to retrieve how much energy is harvested. Additional there are s0 counter to retrieve the power consumption of the house.
The protocol for the Rego6xx controller was derived from http://rago600.sourceforge.net/.
Note, the AVR-NET-IO has original a ATmega32-16PU, which was replaced with a ATmega644p.
Warning
2024-01-01: The Pollin AVR-NET-IO development is obsolete and not available anymore.
There is no known successor development board.
The PlatformIO IDE is used for the development. Its build on top of Microsoft Visual Studio Code.
- Install VSCode.
- Install PlatformIO IDE according to this HowTo.
- Close and start VSCode again.
- Recommended is to take a look to the quick-start guide.
Note, for the following steps I used the AtmelStudio v7.0 with my AVR-ISP programmer, because I didn't manage to get this setup work with VSCode + Platformio or the Arduino IDE.
- Set fuse bits: lfuse = 0xf7, hfuse = 0xd6, efuse = 0xfd
- The MightyCore provides in the platformio installation directy bootloaders. Choose
.platformio/packages/framework-arduino-avr-mightycore/bootloaders/optiboot_flash/bootloaders/atmega644p/16000000L/optiboot_flash_atmega644p_UART0_115200_16000000L_B0_BIGBOOT.hex
- If the bootloader is active, two pulses are shown on pin B0 (= Arduino pin 0), which can be checked with a oscilloscope.
After the bootloader is installed and running, the typical Arduino upload can be used over the serial interface.
Every AVR-NET-IO board comes with a unique MAC address of the network interface controller. Before you build the software it is necessary to set it in the sourcecode. Therefore open ./src/main.cpp
in the editor, search for the variable DEVICE_MAC_ADDR
and change it accordingly.
- Load workspace in VSCode.
- Change to PlatformIO toolbar.
- Project Tasks -> Build All or via hotkey ctrl-alt-b
- Connect the AVR-NET-IO board to your PC via serial interface.
- Build and upload the software via Project Tasks -> Upload All.
- Note, if the AVR-NET-IO board is not modified, you need to keep it off until in the console
Uploading .pio\build\MightyCore\firmware.hex
is shown. Just in this moment power the board and the upload starts.
- MightyCore - Arduino core for ATmega644.
- EthernetENC - Ethernet library for ENC28J60 with Arduino compatible interface.
- ArduinoHttpServer - Server side minimalistic object oriented HTTP protocol implementation.
- ArduinoJSON - JSON library.
Get a temperature sensor value in °C from the heatpump.
<sensor>
:
- gt1 - Radiator return temperature in °C
- gt2 - Outdoor temperature in °C
- gt3 - Hot water temperature in °C
- gt4 - Forward temperature in °C
- gt5 - Room temperature in °C
- gt8 - Heat fluid out temperature in °C
- gt9 - Heat fluid in temperature in °C
- gt10 - Cold fluid in temperature in °C
- gt11 - Cold fluid out temperature in °C
- gt3x - External hot water temperature in °C
- gt3TargetValue - Hot water target temperature in °C
- gt3On - Hot water on temperature in °C
- gt3Off - Hot water off temperature in °C
Response:
{
"data": {
"name": "gt1",
"value": 30
},
"status":0
}
Status 0 means successful. If the request fails, it the status will be non-zero and data is empty.
Set the temperature target value in °C.
JSON parameter:
- name: Temperature name as string.
- gt3Target
- gt3On
- gt3Off
- value: Temperature value in °C as float.
Example:
$ curl -X POST -H "Content-Type: application/json" --data '{"name": "gt3Target", "value": 20.4}' http://192.168.1.3/api/sensors
Response:
{ "status": 0 }
Status 0 means successful. If the request fails, it the status will be non-zero and data is empty.
Send a raw command to the heatpump controller for reverse engineering or debug purposes. Note, the response message comes back as string with hex numbers.
JSON parameter:
- cmdId: Rego6xx command id as integer.
- addr: Rego6xx register address.
- value: Rego6xx Register value.
Example:
$ curl -X POST -H "Content-Type: application/json" --data '{"cmdId": 2, "addr": 521, "value": 0 }' http://192.168.1.3/api/debug
Response:
{
"data": {
"response": "8100022C2E"
},
"status": 0
}
Get last error information from the heatpump.
Response:
{
"data": {
"errorId": 22,
"log": "021009 18:21:03",
"description": "Varmetr. delta high"
},
"status": 0
}
Get state of frontpanel LED from the heatpump.
<led>
:
- power - Power LED
- pump - Pump LED
- heating - Heating LED
- boiler - Boiler LED
- alarm - Alarm LED
Response:
{
"data": {
"name": "power",
"state": true
},
"status": 0
}
Status 0 means successful. If the request fails, it the status will be non-zero and data is empty.
Get display row content.
<row>
:
- Row id from 1 to 4.
Response:
{
"data": {
"row": 1,
"display": "..."
},
"status": 0
}
Status 0 means successful. If the request fails, it the status will be non-zero and data is empty.
Manipulate keyboard and wheel of the frontpanel like the user is in front of the heatpump.
<hmiDevice>
:
- buttonL - Left button
- buttonM - Middle button
- buttonR - Right button
- wheelTL - Turn wheel left
- wheelTR - Turn wheel right
Example:
$ curl -X POST http://192.168.1.3/api/frontPanel/wheelTR
Response:
{
"data": {
"name": "wheelTR"
},
"status": 0
}
If you have further ideas or you found some bugs, great! Create a issue or if you are able and willing to fix it by yourself, clone the repository and create a pull request.
The whole source code is published under the MIT license. Consider the different licenses of the used third party libraries too!
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.