WOW!! what a great guide! Thanks!
if it supplies 3.3v does this mean you can replace it with a nodemcu and just run esphome or tasmota?
No, I’m afraid not. These modules don’t know how to talk to your resol device by default.
It would require you to implement the entire data communication from scratch.
A portion of work which has already been done by Daniel Wippermann in his great GitHub project: GitHub - danielwippermann/resol-vbus: A JavaScript library for processing RESOL VBus data
However, if you get this Node.js stuff up and running (in real time!) on a NodeMCU there might be a chance.
After an afternoon it works like a charm
Had some problems but I sorted it out.
Thanks for your guide and code to get it work!
Need some sun now
Congratulation, that’s pretty much faster than I did
However, during the while I changed my data transfer.
Rather than getting all data every ten seconds I’d liked to post changed values only.
This leads in less data traffic and less data transfer delay.
So I use a script to post my data to homeassistant, now.
This requires to enable homeassistants RESTful API by adding “api:” to your configuration.yaml.
#!/bin/bash
# Add units for values to transmit. Use space if there is no unit!
declare -A UnitMap
UnitMap[00_0010_4241_10_0100_000_2_0]="°C"
UnitMap[00_0010_4241_10_0100_002_2_0]="°C"
UnitMap[00_0010_4241_10_0100_004_2_0]="°C"
UnitMap[00_0010_4241_10_0100_006_2_0]="l/h"
UnitMap[00_0010_4241_10_0100_008_1_0]="%"
UnitMap[00_0010_4241_10_0100_009_1_0]="%"
UnitMap[00_0010_4241_10_0100_013_1_32]=" "
UnitMap[00_0010_4241_10_0100_013_1_64]=" "
UnitMap[00_0010_4241_10_0100_014_1_1]=" "
UnitMap[00_0010_4241_10_0100_014_1_2]=" "
UnitMap[00_0010_4241_10_0100_019_1_0]="min"
UnitMap[00_0010_4241_10_0100_024_2_0]="Wh"
# url to homeassistant RESTful api
cRestApi=https://your_homeassistant:8123/api/states/sensor
# token generated with homeassistant
cBearer=eyJ0eXAiOiJKV...
# json format required by homeassistant
json_fmt='{
"state": "p1",
"attributes": {
"entity_id": "p2",
"unit_of_measurement": "p3",
"friendly_name": "p4"
}
}'
# Get new data from resol device
read_reglo() {
local -n ValueMap=$1
while IFS=$'\t' read -r id name rawValue; do
if [ "${UnitMap[$id]}" != "" ]
then
if [ "${ValueMap[$id]}" != "$rawValue" ]
then
# replace placeholder p1 to p4 with real data
json_msg=${json_fmt/p1/$rawValue}
json_msg=${json_msg/p2/sensor.$id}
json_msg=${json_msg/p3/${UnitMap[$id]}}
json_msg=${json_msg/p4/$name}
# pipe json message to curl and add with parameter @- to data
echo $json_msg | \
curl -X POST "$cRestApi.$id" \
-H "Authorization: Bearer $cBearer" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
--data @-
# store value for next iteration
ValueMap[$id]=$rawValue
fi
fi
done < <(jq -r '.[]|[.id, .name, .rawValue] | @tsv' < <(curl -s http://localhost:3333/api/v1/live-data))
}
# Loop for ever to permanently check and transmit values
declare -A LastValueMap
while true; do
read_reglo LastValueMap
done
It was because of you. Just followed your road
Cant you just extend the polling time in daniel’s code?
This could possibly be a solution for you too.
Hi Jim, just wondered if you knew anyone that might have one of these boards. I’m hoping to link up with a Raspberry Pi.
Hi Justin, just wondered if you had any of these boards left. I’m hoping to link up with a Raspberry Pi.
I have a few spare blank boards (that convert to RS-485)… You’ll need to source the components and solder them on. Mine has been happily working for years. It does look easier to just use the direct 3.3V solution above though, rather than covert to RS-485 signally and back again - depends how isolated you want to be and how far your wires need to go. I also wrote my own protocol decoder in python that pushes the data into MQTT. Yell if you want a few blanks.
I take it you’ve see the recent integration for RESOL. I have a DL/2 and have set this up. It works very well indeed.
- Justin.
@G8YTZ That looks good - from where did you integrate?
RESOL doesn’t appear under integrations when I search
thanks.
It’s on the Home Assistant Community Store!
These are the panels I posted in the above picture for my DL/2 with BS/4 pump controller
type: entities
entities:
- entity: sensor.hot_water
- entity: sensor.temperature_sensor_3
name: Cylinder Upper
- entity: sensor.temperature_sensor_2
name: Cylinder Lower
- entity: sensor.temperature_sensor_1
name: Solar Collector
icon: mdi:solar-power-variant
- entity: sensor.temperature_sensor_4
name: Solar Return
icon: mdi:solar-power-variant
- entity: sensor.ecodan_flow
- entity: sensor.pump_speed_relay_1
name: Pump Speed
icon: mdi:pump
- entity: sensor.operating_hours_relay_1
name: Pump Hours
icon: mdi:clock-check-outline
- entity: sensor.heat_quantity
name: Heat Quantity
icon: mdi:weather-sunny
title: Solar Hot Water
square: true
type: grid
cards:
- show_name: true
show_icon: true
type: button
tap_action:
action: toggle
entity: switch.hot_water
icon: mdi:light-switch
name: Hot Water
show_state: true
hold_action:
action: toggle
- type: gauge
entity: sensor.hot_water
needle: true
severity:
green: 10
yellow: 40
red: 60
- type: gauge
entity: sensor.ecodan_flow
needle: true
severity:
green: 10
yellow: 35
red: 55
- type: gauge
entity: sensor.pump_speed_relay_1
needle: true
severity:
green: 0
yellow: 50
red: 90
name: Solar Pump Speed
columns: 2
square: true
type: grid
cards:
- type: gauge
entity: sensor.hot_water_upper
needle: true
severity:
green: 10
yellow: 50
red: 90
name: Hot Water Upper
- type: gauge
entity: sensor.pump_speed_relay_1
needle: true
severity:
green: 0
yellow: 50
red: 90
name: Pump Speed
- type: gauge
entity: sensor.hot_water_middle
needle: true
severity:
green: 10
yellow: 50
red: 90
- type: gauge
entity: sensor.temperature_sensor_1
name: Solar Collector
needle: true
severity:
green: 10
yellow: 50
red: 70
- type: gauge
entity: sensor.hot_water_lower
needle: true
severity:
green: 10
yellow: 50
red: 90
- type: gauge
entity: sensor.temperature_sensor_4
needle: true
severity:
green: 10
yellow: 50
red: 80
name: Solar Return
columns: 2
Do you have any of these boards left? I would like to Buy one please.
I can send you one, please one that they are just raw PCBs, you have to source and mount the SMD components yourself. You need to be skilled at electronics, this is not a beginner project! £2 to cover P&P.
Best regards,
Justin.
Hello. I am a new guy in this community.
My Cosmo multi 2 puts nan °C in my esp home. I got the informations from
The output Power from the Vbus is about 9V. Shall I put a 1K resistor to a the + of the Vbus?
Shall I get the right Hex Adress (7831)
Please let me know.
THX
Hello!
I am using ESPHome VBus Component and it works very well.
Since the DeltaSol SL (2251) model is not supported at the moment, I have to use custom sensors via lambda. For example, temperature sensor 1:
sensor:
- platform: vbus
model: custom
dest: 0x10
source: 0x2251
command: 0x100
sensors:
- id: temp1
name: Temp 1
lambda: return ((x[5] << 8) + x[4]) * 0.1f;
Everything is fine as long as the temperature does not go below zero. In case of negative temperature, 6553.6 (or 256x256x0.1) is added to the temperature reading, some bit shift << 8 for negative temperature?
How can I get the correct temperature values using lambda for both positive and negative temperature?
If memory serves, you need to do something along these lines:
# Get raw VBus value
temp = x[5] << 8 | x[4]
# Check if MSB set
if (temp & 0x8000):
# Invert bits and subtract
temp = ~(temp ^ 0xFFFF)
return temp * 0.1f
My initial solution was to add another template sensor:
- platform: template
sensors:
solar_collector_temperature:
unit_of_measurement: °C
value_template: >
{% if states('sensor.temperature_raw') | float > 6500 %}
{{ (states('sensor.temperature_raw') | float - 6553.6) | round (1) }}
{% else %}
{{ states('sensor.temperature_raw') | float }}
{% endif %}
But then I asked Copilot and it offered a simple and elegant solution with which you can get the right temperature directly from the ESPHome v-bus adapter:
lambda: |-
int16_t raw_value = (x[5] << 8) | x[4];
return raw_value * 0.1f;
Explanation:
int16_t raw_value = (x[5] << 8) | x[4];
Combines the two bytes x[5] and x[4] into a single 16-bit integer.
int16_t is a signed 16-bit integer type, which allows for negative values.
return raw_value * 0.1f;
Multiplies the combined value by 0.1 to convert it to the correct temperature value.