article

Evgeniy Labunskiy avatar image
Evgeniy Labunskiy posted

Viessmann Heat Pump Smart Grid Control with Cerbo GX

Today I connected Viessmann Heat Pump (HP) with Smart Grid functionality under Cerbo GX control and would like to share with you all the details, as well as get feedback or implement proposed changes.

Smart grid (SM) provides functionality to control HP behavior in the given situations:
- Grid available or not
- Surplus of solar power
- Low grid cost

With SM you can say to HP that you have a lot of sun production so that it will heat your DWH higher, heat heating buffer with higher temperature. In case of grid failure or low/unavailable sun production turn off HP.

Disclaimer
This setup requires some polishing and tuning, some updates to the article may happen later or after community feedback. It's not recommended to open HP and connected anything written in this article if you are not Viessmann certified specialist, all you do is on your own risk :)

System
I have the following devices to have:
1. Viessmann HP Vitocal S-100 operates under Vitotronic 200 control
2. Shelly 2.5 smart relay
3. Cerbo GX Large with MQTT and Node Red enabled

Shelly will be connected to HP and control contactors on board. Shelly will post and read the state from MQTT running so that we can control it from Node-Red

Relay Wiring
Open up HP cover and observe the main board. To make it happen you have to unscrew two bolts at the bottom of HP (number 3 in picture)

You should see something like this


Connection block on the left can be used to connect Neutral to your relay device and the top ones provide Line (220v). On picture right bottom corner you can see my Shelly connected to neutral and phase directly to the board, so it will power up with HP unit. So screw your relay same way, it is a lot of free connectors there.


Then you have to find block 216 that controls Smart Grid feature.

1719923439257.png

In my picture, the required block is highlighted in red. img-2450.jpgTurn off HPand turn off circuit breaker before making any connections.

Connect 01 relay output from Shelly to Block 216 port 4
Connect 02 relay output from Shelly to Block 216 port 1

Make everything screwed tight. Turn on your HP, you should see Shelly blink.

Setup Shelly
Make the initial shelly setup using the Shelly App, connect the device to proper Wifi, and open it in the browser. Update firmware is there is any new.

In your Cerbo device enable MQTT. It will not work without it.

Go to Settings -> Internet and Security -> Advanced Developers Settings and enable MQTT with setting the following settings:

The server here is your Cerbo IP address as it hosts MQTT broker
You can also change the mqtt prefix to something more user friendly.

Save and reboot.

Go to every channel setting in your Shelly and set the proper power default mode - it should be "restore last mode".

Why? In a situation when you have to turn off HP and then turn it on again it will restore the previously set mode of Smart Grid

Open up any available MQTT Explorer and connect to Cerbo. You should observe your device appear in the list under "shellies" topic

If you see Shelly's data you made everything setup correctly

Configure Node Red and Scenarios
In Node Red we will use the default MQTT pallet. Access your Node Red from VRM portal or locally, and create the new flow.

I have the following Flow:

Here is the on/off combinations of relay state to achieve different HP behavior

Grid state is read from this MQTT path:


N/<system_id>/system/0/Ac/In/0/Connected

So I'm catching whether AC is connected or not. Based on this I'm making a decision:

1. No grid - turn off HP, and set Mode 1. In future, I will make it behave based on the battery charge state and available solar

2. Grid available:
a. is the grid price low? If yes then operate in Mode 3
b. is grid price standard? If yes then operate in mode 2

Mode 4 I'm not using yet, it will start after solar pannels arrive.

Here is the backup of this flow to you to play with

[
    {
        "id": "8aeb978cc4845a83",
        "type": "tab",
        "label": "Smart Grid",
        "disabled": false,
        "info": "",
        "env": []
    },
    {
        "id": "cd5139ab95b5a193",
        "type": "mqtt in",
        "z": "8aeb978cc4845a83",
        "name": "Grid State",
        "topic": "N/<system-id>/system/0/Ac/In/0/Connected",
        "qos": "0",
        "datatype": "json",
        "broker": "eaee3f6b59afecab",
        "nl": false,
        "rap": true,
        "rh": 0,
        "inputs": 0,
        "x": 80,
        "y": 380,
        "wires": [
            [
                "694f3f7c791799dd"
            ]
        ]
    },
    {
        "id": "30545a07c6bd9abf",
        "type": "change",
        "z": "8aeb978cc4845a83",
        "name": "On A",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "on",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 410,
        "y": 500,
        "wires": [
            [
                "63c73573d89fdb71",
                "15d727dd.33e808"
            ]
        ]
    },
    {
        "id": "d8e1a7f4111a1425",
        "type": "change",
        "z": "8aeb978cc4845a83",
        "name": "Off B",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "off",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 410,
        "y": 540,
        "wires": [
            [
                "c73e195e6eb8dd47"
            ]
        ]
    },
    {
        "id": "694f3f7c791799dd",
        "type": "switch",
        "z": "8aeb978cc4845a83",
        "name": "",
        "property": "payload.value",
        "propertyType": "msg",
        "rules": [
            {
                "t": "eq",
                "v": "1",
                "vt": "num"
            },
            {
                "t": "eq",
                "v": "0",
                "vt": "num"
            }
        ],
        "checkall": "true",
        "repair": false,
        "outputs": 2,
        "x": 210,
        "y": 380,
        "wires": [
            [
                "2283262422378478"
            ],
            [
                "30545a07c6bd9abf",
                "d8e1a7f4111a1425"
            ]
        ]
    },
    {
        "id": "2812d74f94afd6dc",
        "type": "change",
        "z": "8aeb978cc4845a83",
        "name": "Off A",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "off",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 410,
        "y": 280,
        "wires": [
            [
                "396df21692d210f9",
                "15d727dd.33e808"
            ]
        ]
    },
    {
        "id": "ec6d88caf611a1d4",
        "type": "change",
        "z": "8aeb978cc4845a83",
        "name": "Off B",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "off",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 410,
        "y": 320,
        "wires": [
            [
                "8ab2371505930abf"
            ]
        ]
    },
    {
        "id": "396df21692d210f9",
        "type": "mqtt out",
        "z": "8aeb978cc4845a83",
        "name": "Normal Mode",
        "topic": "shellies/smart-grid/relay/0/command",
        "qos": "0",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "eaee3f6b59afecab",
        "x": 820,
        "y": 280,
        "wires": []
    },
    {
        "id": "8ab2371505930abf",
        "type": "mqtt out",
        "z": "8aeb978cc4845a83",
        "name": "Normal Mode",
        "topic": "shellies/smart-grid/relay/1/command",
        "qos": "0",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "eaee3f6b59afecab",
        "x": 820,
        "y": 320,
        "wires": []
    },
    {
        "id": "63c73573d89fdb71",
        "type": "mqtt out",
        "z": "8aeb978cc4845a83",
        "name": "Power Off Mode",
        "topic": "shellies/smart-grid/relay/0/command",
        "qos": "0",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "eaee3f6b59afecab",
        "x": 820,
        "y": 500,
        "wires": []
    },
    {
        "id": "c73e195e6eb8dd47",
        "type": "mqtt out",
        "z": "8aeb978cc4845a83",
        "name": "Power Off Mode",
        "topic": "shellies/smart-grid/relay/1/command",
        "qos": "0",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "eaee3f6b59afecab",
        "x": 820,
        "y": 540,
        "wires": []
    },
    {
        "id": "15d727dd.33e808",
        "type": "debug",
        "z": "8aeb978cc4845a83",
        "name": "",
        "active": true,
        "console": "false",
        "complete": "false",
        "x": 850,
        "y": 420,
        "wires": []
    },
    {
        "id": "235d4abc12172506",
        "type": "comment",
        "z": "8aeb978cc4845a83",
        "name": "Grid NOT Available",
        "info": "",
        "x": 210,
        "y": 520,
        "wires": []
    },
    {
        "id": "96e33c0ef8e5c005",
        "type": "comment",
        "z": "8aeb978cc4845a83",
        "name": "Grid Available",
        "info": "",
        "x": 190,
        "y": 240,
        "wires": []
    },
    {
        "id": "2283262422378478",
        "type": "time-range-switch",
        "z": "8aeb978cc4845a83",
        "name": "Is low energy price?",
        "lat": "50.24662",
        "lon": "30.36161",
        "startTime": "23:00",
        "endTime": "07:00",
        "startOffset": 0,
        "endOffset": 0,
        "x": 440,
        "y": 200,
        "wires": [
            [
                "343c0d0394daaa90",
                "98b05e2553cf15f3"
            ],
            [
                "2812d74f94afd6dc",
                "ec6d88caf611a1d4"
            ]
        ]
    },
    {
        "id": "343c0d0394daaa90",
        "type": "change",
        "z": "8aeb978cc4845a83",
        "name": "Off A",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "off",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 650,
        "y": 180,
        "wires": [
            [
                "3fdb403433189eb3"
            ]
        ]
    },
    {
        "id": "98b05e2553cf15f3",
        "type": "change",
        "z": "8aeb978cc4845a83",
        "name": "On B",
        "rules": [
            {
                "t": "set",
                "p": "payload",
                "pt": "msg",
                "to": "on",
                "tot": "str"
            }
        ],
        "action": "",
        "property": "",
        "from": "",
        "to": "",
        "reg": false,
        "x": 650,
        "y": 220,
        "wires": [
            [
                "67bae9c098d3f5dd"
            ]
        ]
    },
    {
        "id": "3fdb403433189eb3",
        "type": "mqtt out",
        "z": "8aeb978cc4845a83",
        "name": "Low Surplus (Low Cost)",
        "topic": "shellies/smart-grid/relay/0/command",
        "qos": "0",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "eaee3f6b59afecab",
        "x": 850,
        "y": 180,
        "wires": []
    },
    {
        "id": "67bae9c098d3f5dd",
        "type": "mqtt out",
        "z": "8aeb978cc4845a83",
        "name": "Low Surplus (Low Cost)",
        "topic": "shellies/smart-grid/relay/1/command",
        "qos": "0",
        "retain": "true",
        "respTopic": "",
        "contentType": "",
        "userProps": "",
        "correl": "",
        "expiry": "",
        "broker": "eaee3f6b59afecab",
        "x": 850,
        "y": 220,
        "wires": []
    },
    {
        "id": "0f26682664592e67",
        "type": "inject",
        "z": "8aeb978cc4845a83",
        "name": "",
        "props": [
            {
                "p": "payload"
            },
            {
                "p": "topic",
                "vt": "str"
            }
        ],
        "repeat": "",
        "crontab": "",
        "once": false,
        "onceDelay": 0.1,
        "topic": "",
        "payload": "",
        "payloadType": "date",
        "x": 200,
        "y": 640,
        "wires": [
            [
                "30545a07c6bd9abf",
                "d8e1a7f4111a1425"
            ]
        ]
    },
    {
        "id": "eaee3f6b59afecab",
        "type": "mqtt-broker",
        "name": "Victron MQTT",
        "broker": "10.10.20.133",
        "port": "1883",
        "clientid": "",
        "autoConnect": true,
        "usetls": false,
        "protocolVersion": "4",
        "keepalive": "60",
        "cleansession": true,
        "autoUnsubscribe": true,
        "birthTopic": "",
        "birthQos": "0",
        "birthRetain": "false",
        "birthPayload": "",
        "birthMsg": {},
        "closeTopic": "",
        "closeQos": "0",
        "closeRetain": "false",
        "closePayload": "",
        "closeMsg": {},
        "willTopic": "",
        "willQos": "0",
        "willRetain": "false",
        "willPayload": "",
        "willMsg": {},
        "userProps": "",
        "sessionExpiry": ""
    }
]

Looking for your valuable feedback! Open to any suggestions and changes

Node-REDMQTTMulti RS
1719923439257.png (298.2 KiB)
img-2450.jpg (1.2 MiB)
2 comments
2 |3000

Up to 8 attachments (including images) can be used with a maximum of 190.8 MiB each and 286.6 MiB total.

andrii-podanenko avatar image andrii-podanenko commented ยท

Most likely you can avoid using Shelly by leveraging relays(or digital io) on cerbo itself

0 Likes 0 ยท
Evgeniy Labunskiy avatar image Evgeniy Labunskiy andrii-podanenko commented ยท

No, as viessmann requires 220v on contact, cerbo cannot provide it

0 Likes 0 ยท

Article

Contributors

Evgeniy Labunskiy contributed to this article