BSB-Lan integration

Ok, this is the REST sensor part from my configuration.yaml:

sensor:
  - platform: rest
    name: BSB-LAN Status
    resource: "http://192.168.0.95/JQ=700,1600,8000,8003,6705,710,712,720,721,1610,1612,5400"
    method: POST
    username: !secret bsb_lan_user
    password: !secret bsb_lan_pass
    scan_interval: 5
    value_template: "{{ value_json['6705'].value }}"
    json_attributes:
      - "700"
      - "1600"
      - "6705"
      - "8000"
      - "8003"
      - "710"
      - "712"
      - "720"
      - "721"
      - "1610"
      - "1612"
      - "5400"
    headers:
      Content-Type: application/json
  - platform: template
    sensors:
      bsb_lan_betriebsart:
        friendly_name: BSB-LAN Betriebsart
        value_template: "{% if states('sensor.bsb_lan_status') is defined and states('sensor.bsb_lan_status') != 'unavailable' %}{{ state_attr('sensor.bsb_lan_status', '700')['value'] }}{% else %}{{ states('sensor.bsb_lan_betriebsart') }}{% endif %}"
        attribute_templates:
          desc: "{% if states('sensor.bsb_lan_status') is defined and states('sensor.bsb_lan_status') != 'unavailable' %}{{ state_attr('sensor.bsb_lan_status', '8000')['desc'] }}{% else %}{{ state_attr('sensor.bsb_lan_betriebsart', 'desc') }}{% endif %}"
      bsb_lan_trinkwasserbetrieb:
        friendly_name: BSB-LAN Trinkwasserbetrieb
        value_template: "{% if states('sensor.bsb_lan_status') is defined and states('sensor.bsb_lan_status') != 'unavailable' %}{{ state_attr('sensor.bsb_lan_status', '1600')['value'] }}{% else %}{{ states('sensor.bsb_lan_trinkwasserbetrieb') }}{% endif %}"
        attribute_templates:
          desc: "{% if states('sensor.bsb_lan_status') is defined and states('sensor.bsb_lan_status') != 'unavailable' %}{{ state_attr('sensor.bsb_lan_status', '8003')['desc'] }}{% else %}{{ state_attr('sensor.bsb_lan_trinkwasserbetrieb', 'desc') }}{% endif %}"
      bsb_lan_komfortsollwert:
        friendly_name: BSB-LAN Komfortsollwert
        value_template: "{% if states('sensor.bsb_lan_status') is defined and states('sensor.bsb_lan_status') != 'unavailable' %}{{ state_attr('sensor.bsb_lan_status', '710')['value'] }}{% else %}{{ states('sensor.bsb_lan_komfortsollwert') }}{% endif %}"
        unit_of_measurement: °C
        device_class: temperature
      bsb_lan_reduziertsollwert:
        friendly_name: BSB-LAN Reduziertsollwert
        value_template: "{% if states('sensor.bsb_lan_status') is defined and states('sensor.bsb_lan_status') != 'unavailable' %}{{ state_attr('sensor.bsb_lan_status', '712')['value'] }}{% else %}{{ states('sensor.bsb_lan_reduziertsollwert') }}{% endif %}"
        unit_of_measurement: °C
        device_class: temperature
      bsb_lan_kennlinie_steilheit:
        friendly_name: BSB-LAN Kennlinie Steilheit
        value_template: "{% if states('sensor.bsb_lan_status') is defined and states('sensor.bsb_lan_status') != 'unavailable' %}{{ state_attr('sensor.bsb_lan_status', '720')['value'] }}{% else %}{{ states('sensor.bsb_lan_kennlinie_steilheit') }}{% endif %}"
      bsb_lan_kennlinie_verschiebung:
        friendly_name: BSB-LAN Kennlinie Verschiebung
        value_template: "{% if states('sensor.bsb_lan_status') is defined and states('sensor.bsb_lan_status') != 'unavailable' %}{{ state_attr('sensor.bsb_lan_status', '721')['value'] }}{% else %}{{ states('sensor.bsb_lan_kennlinie_verschiebung') }}{% endif %}"
        unit_of_measurement: °C
        device_class: temperature
      bsb_lan_tww_nennsollwert:
        friendly_name: BSB-LAN TWW Nennsollwert
        value_template: "{% if states('sensor.bsb_lan_status') is defined and states('sensor.bsb_lan_status') != 'unavailable' %}{{ state_attr('sensor.bsb_lan_status', '1610')['value'] }}{% else %}{{ states('sensor.bsb_lan_tww_nennsollwert') }}{% endif %}"
        unit_of_measurement: °C
        device_class: temperature
      bsb_lan_tww_reduziertsollwert:
        friendly_name: BSB-LAN TWW Reduziertsollwert
        value_template: "{% if states('sensor.bsb_lan_status') is defined and states('sensor.bsb_lan_status') != 'unavailable' %}{{ state_attr('sensor.bsb_lan_status', '1612')['value'] }}{% else %}{{ states('sensor.bsb_lan_tww_reduziertsollwert') }}{% endif %}"
        unit_of_measurement: °C
        device_class: temperature
      bsb_lan_tww_dle_komfortsollwert:
        friendly_name: BSB-LAN TWW DLE Komfortsollwert
        value_template: "{% if states('sensor.bsb_lan_status') is defined and states('sensor.bsb_lan_status') != 'unavailable' %}{{ state_attr('sensor.bsb_lan_status', '5400')['value'] }}{% else %}{{ states('sensor.bsb_lan_tww_dle_komfortsollwert') }}{% endif %}"
        unit_of_measurement: °C
        device_class: temperature
      bsb_lan_temperaturspreizung:
        friendly_name: BSB-LAN Temperaturspreizung
        value_template: "{{ (states('sensor.bsb_lan_vorlauftemperatur') | float - states('sensor.bsb_lan_rucklauftemperatur') | float) | round(1) }}"
        unit_of_measurement: °C
        device_class: temperature

As the HTTP query is quite slow on the Arduino (the more values you read out, the slower it gets), I use MQTT to acquire all constantly changing values (mainly temperatures). You need to have a MQTT broker of course and the Arduino configured to use it:

sensor:
  - platform: mqtt
    state_topic: "bsb-lan/10004"
    name: BSB-LAN Außentemperatur
    unit_of_measurement: °C
    device_class: temperature
  - platform: mqtt
    state_topic: "bsb-lan/8703"
    name: BSB-LAN Außentemperatur gedĂ€mpft
    unit_of_measurement: °C
    device_class: temperature
  - platform: mqtt
    state_topic: "bsb-lan/8704"
    name: BSB-LAN Außentemperatur gemischt
    unit_of_measurement: °C
    device_class: temperature
  - platform: mqtt
    state_topic: "bsb-lan/8310"
    name: BSB-LAN Vorlauftemperatur
    unit_of_measurement: °C
    device_class: temperature
  - platform: mqtt
    state_topic: "bsb-lan/8314"
    name: BSB-LAN RĂŒcklauftemperatur
    unit_of_measurement: °C
    device_class: temperature
  - platform: mqtt
    state_topic: "bsb-lan/8830"
    name: BSB-LAN Trinkwassertemperatur 1
    unit_of_measurement: °C
    device_class: temperature
  - platform: mqtt
    state_topic: "bsb-lan/8832"
    name: BSB-LAN Trinkwassertemperatur 2
    unit_of_measurement: °C
    device_class: temperature
  - platform: mqtt
    state_topic: "bsb-lan/8326"
    name: BSB-LAN Brennermodulation
    unit_of_measurement: "%"
    icon: "mdi:fire"

For setting parameters I use a parameterizable REST ccommand. Just let me know if you want to have the code for that too.

1 Like

Hi

Have you got a climate card with your rest commands ? what is your code ?

I want to use 2 heating circuits (floor and etage) and heating water circuit so if I understand correctly, it’s not possible with the actual integration ?

Thanks

I do not use a climate card, but individual input fields instead. This is what it looks like:

This is the corresponding lovelace config:

cards:
  - entities:
      - entity: sensor.bsb_lan_betriebsart
        filter:
          include:
            - key: sensor.bsb_lan_betriebsart.desc
              name: Status
        heading_name: ' '
        heading_state: ' '
        type: 'custom:entity-attributes-card'
      - entity: input_number.bsb_lan_komfortsollwert
        name: Komfortsollwert
      - entity: input_number.bsb_lan_reduziertsollwert
        name: Reduziertsollwert
      - entity: input_number.bsb_lan_kennlinie_steilheit
        name: Kennlinie Steilheit
      - entity: input_number.bsb_lan_kennlinie_verschiebung
        name: Kennlinie Verschiebung
      - type: divider
      - entity: sensor.bsb_lan_vorlauftemperatur
        name: Vorlauftemperatur
      - entity: sensor.bsb_lan_rucklauftemperatur
        name: RĂŒcklauftemperatur
    show_header_toggle: false
    type: entities
  - entities:
      - entity: sensor.bsb_lan_vorlauftemperatur
        name: Vorlauftemperatur 6h
      - entity: sensor.bsb_lan_rucklauftemperatur
        name: RĂŒcklauftemperatur 6h
      - entity: sensor.bsb_lan_temperaturspreizung
        name: Temperaturspreizung 6h
    hours_to_show: 6
    refresh_interval: 30
    type: history-graph
  - entities:
      - entity: sensor.bsb_lan_vorlauftemperatur
        name: Vorlauftemperatur 24h
      - entity: sensor.bsb_lan_rucklauftemperatur
        name: RĂŒcklauftemperatur 24h
      - entity: sensor.bsb_lan_temperaturspreizung
        name: Temperaturspreizung 24h
    hours_to_show: 24
    refresh_interval: 30
    type: history-graph
title: Heizkreis
type: vertical-stack

cards:
  - entities:
      - entity: sensor.bsb_lan_trinkwasserbetrieb
        filter:
          include:
            - key: sensor.bsb_lan_trinkwasserbetrieb.desc
              name: Status
        heading_name: ' '
        heading_state: ' '
        type: 'custom:entity-attributes-card'
      - entity: input_number.bsb_lan_tww_nennsollwert
        name: Nennsollwert
      - entity: input_number.bsb_lan_tww_reduziertsollwert
        name: Reduziertsollwert
      - entity: input_number.bsb_lan_tww_dle_komfortsollwert
        name: Durchl'erhitzer Komfortsollwert
      - type: divider
      - entity: sensor.bsb_lan_trinkwassertemperatur_1
        name: Trinkwassertemperatur 1
      - entity: sensor.bsb_lan_trinkwassertemperatur_2
        name: Trinkwassertemperatur 2
    show_header_toggle: false
    type: entities
  - entities:
      - entity: sensor.bsb_lan_trinkwassertemperatur_1
        name: Trinkwassertemperatur 1 6h
      - entity: sensor.bsb_lan_trinkwassertemperatur_2
        name: Trinkwassertemperatur 2 6h
      - entity: switch.gosund_zirkulationspumpe
        name: TWW Zirkulationspumpe 6h
    hours_to_show: 6
    refresh_interval: 30
    type: history-graph
  - entities:
      - entity: sensor.bsb_lan_trinkwassertemperatur_1
        name: Trinkwassertemperatur 1 24h
      - entity: sensor.bsb_lan_trinkwassertemperatur_2
        name: Trinkwassertemperatur 2 24h
      - entity: switch.gosund_zirkulationspumpe
        name: TWW Zirkulationspumpe 24h
    hours_to_show: 24
    refresh_interval: 30
    type: history-graph
title: Trinkwasser
type: vertical-stack

This is the automations.yaml part (the input fields have to be defined before for this to work, of course):

- id: bsb_lan_set_komfortsollwert
  alias: BSB-LAN Komfortsollwert setzen
  description: ''
  trigger:
    - platform: state
      entity_id: input_number.bsb_lan_komfortsollwert
  condition: []
  action:
    - data_template:
        parameter: 710
        value: "{{ states('input_number.bsb_lan_komfortsollwert') }}"
      service: rest_command.bsb_lan_set_parameter
- id: bsb_lan_get_komfortsollwert
  alias: BSB-LAN Komfortsollwert auslesen
  description: ''
  trigger:
    - platform: state
      entity_id: sensor.bsb_lan_komfortsollwert
  condition: []
  action:
    - data_template:
        entity_id: input_number.bsb_lan_komfortsollwert
        value: "{{ states('sensor.bsb_lan_komfortsollwert') | float }}"
      service: input_number.set_value

- id: bsb_lan_set_reduziertsollwert
  alias: BSB-LAN Reduziertsollwert setzen
  description: ''
  trigger:
    - platform: state
      entity_id: input_number.bsb_lan_reduziertsollwert
  condition: []
  action:
    - data_template:
        parameter: 712
        value: "{{ states('input_number.bsb_lan_reduziertsollwert') }}"
      service: rest_command.bsb_lan_set_parameter
- id: bsb_lan_get_reduziertsollwert
  alias: BSB-LAN Reduziertsollwert auslesen
  description: ''
  trigger:
    - platform: state
      entity_id: sensor.bsb_lan_reduziertsollwert
  condition: []
  action:
    - data_template:
        entity_id: input_number.bsb_lan_reduziertsollwert
        value: "{{ states('sensor.bsb_lan_reduziertsollwert') | float }}"
      service: input_number.set_value

- id: bsb_lan_set_kennlinie_steilheit
  alias: BSB-LAN Kennlinie Steilheit setzen
  description: ''
  trigger:
    - platform: state
      entity_id: input_number.bsb_lan_kennlinie_steilheit
  condition: []
  action:
    - data_template:
        parameter: 720
        value: "{{ states('input_number.bsb_lan_kennlinie_steilheit') }}"
      service: rest_command.bsb_lan_set_parameter
- id: bsb_lan_get_kennlinie_steilheit
  alias: BSB-LAN Kennlinie Steilheit auslesen
  description: ''
  trigger:
    - platform: state
      entity_id: sensor.bsb_lan_kennlinie_steilheit
  condition: []
  action:
    - data_template:
        entity_id: input_number.bsb_lan_kennlinie_steilheit
        value: "{{ states('sensor.bsb_lan_kennlinie_steilheit') | float }}"
      service: input_number.set_value

- id: bsb_lan_set_kennlinie_verschiebung
  alias: BSB-LAN Kennlinie Verschiebung setzen
  description: ''
  trigger:
    - platform: state
      entity_id: input_number.bsb_lan_kennlinie_verschiebung
  condition: []
  action:
    - data_template:
        parameter: 721
        value: "{{ states('input_number.bsb_lan_kennlinie_verschiebung') }}"
      service: rest_command.bsb_lan_set_parameter
- id: bsb_lan_get_kennlinie_verschiebung
  alias: BSB-LAN Kennlinie Verschiebung auslesen
  description: ''
  trigger:
    - platform: state
      entity_id: sensor.bsb_lan_kennlinie_verschiebung
  condition: []
  action:
    - data_template:
        entity_id: input_number.bsb_lan_kennlinie_verschiebung
        value: "{{ states('sensor.bsb_lan_kennlinie_verschiebung') | float }}"
      service: input_number.set_value

- id: bsb_lan_set_tww_nennsollwert
  alias: BSB-LAN TWW Nennsollwert setzen
  description: ''
  trigger:
    - platform: state
      entity_id: input_number.bsb_lan_tww_nennsollwert
  condition: []
  action:
    - data_template:
        parameter: 1610
        value: "{{ states('input_number.bsb_lan_tww_nennsollwert') }}"
      service: rest_command.bsb_lan_set_parameter
- id: bsb_lan_get_tww_nennsollwert
  alias: BSB-LAN TWW Nennsollwert auslesen
  description: ''
  trigger:
    - platform: state
      entity_id: sensor.bsb_lan_tww_nennsollwert
  condition: []
  action:
    - data_template:
        entity_id: input_number.bsb_lan_tww_nennsollwert
        value: "{{ states('sensor.bsb_lan_tww_nennsollwert') | float }}"
      service: input_number.set_value

- id: bsb_lan_set_tww_reduziertsollwert
  alias: BSB-LAN TWW Reduziertsollwert setzen
  description: ''
  trigger:
    - platform: state
      entity_id: input_number.bsb_lan_tww_reduziertsollwert
  condition: []
  action:
    - data_template:
        parameter: 1612
        value: "{{ states('input_number.bsb_lan_tww_reduziertsollwert') }}"
      service: rest_command.bsb_lan_set_parameter
- id: bsb_lan_get_tww_reduziertsollwert
  alias: BSB-LAN TWW Reduziertsollwert auslesen
  description: ''
  trigger:
    - platform: state
      entity_id: sensor.bsb_lan_tww_reduziertsollwert
  condition: []
  action:
    - data_template:
        entity_id: input_number.bsb_lan_tww_reduziertsollwert
        value: "{{ states('sensor.bsb_lan_tww_reduziertsollwert') | float }}"
      service: input_number.set_value

- id: bsb_lan_set_tww_dle_komfortsollwert
  alias: BSB-LAN TWW DLE Komfortsollwert setzen
  description: ''
  trigger:
    - platform: state
      entity_id: input_number.bsb_lan_tww_dle_komfortsollwert
  condition: []
  action:
    - data_template:
        parameter: 5400
        value: "{{ states('input_number.bsb_lan_tww_dle_komfortsollwert') }}"
      service: rest_command.bsb_lan_set_parameter
- id: bsb_lan_get_tww_dle_komfortsollwert
  alias: BSB-LAN TWW DLE Komfortsollwert auslesen
  description: ''
  trigger:
    - platform: state
      entity_id: sensor.bsb_lan_tww_dle_komfortsollwert
  condition: []
  action:
    - data_template:
        entity_id: input_number.bsb_lan_tww_dle_komfortsollwert
        value: "{{ states('sensor.bsb_lan_tww_dle_komfortsollwert') | float }}"
      service: input_number.set_value

My rest command has already been posted here:
https://community.home-assistant.io/t/bsb-lan-integration/113501/38?u=tiger42

I tiger42 thank you so much for the code.
it’s possible to share the code for setting parameters whit REST COMMAND?
Thanks
Marco

The code has already been posted
 Look at the action: parts in my automations.yml.

Hi,

the rest command work now thanks you !

can we create a HomeKit thermostat with rest command in HA ?

Hi

can we explain me how integrate my second heating system via BSB LAN integration ?

Thanks

Hi
Iam very new at BSB Lan. I use a ESP32 with the BSB-Lan adapter and first off all: It works!
Now I triy to integrate it in my HomeAssistant. I needed to flash the newest Version of BSB Lan, because for the ESP32 I need the wifi integration. SO the HA BSB integration does not work. I tried, buit it doesn’t :wink:

Now I want to use mqtt like tiger42 did.
What do I have to configure in the BSB-LAN adapter to gett mqtt working
MQTT verwenden: Plain text, JSON, Rich Json ???
MQTT IP Adress, Passwort, Username, GerĂ€teID, Topic Prefix – got it!
SOmething else? In the logging section?

Hi Marc,

BSBLan has changed a lot the last few months. So I have to pick up where it is and what is best for HA integration. For now you could follow @tiger42 instructions to get the most out of it.

When I have some time available I am planning te rewrite the integration.
This will be more mqqt based because it will work like local push.
The plan is to have support for the platforms climate , hot water, and maybe some customs stuff.

If someone has interest to get things started let me know. I will enjoy to watch it from the sideline.

2 Likes

I’ve updated the BSB-Lan in Arduino and HA to the latest version, and now I am getting the negative amounts for this component
 I’ve tried to sniff the network, and it seems the BSB-Lan itself return the correct values. Where can be the issue? Thanks!

Bsblan firmware has changed a lot so I cannot tell what’s broken.
For example they shuffled the parameters around.
That’s why it’s documented the version number of the firmware you have to install to be able to use this integration. You can still download the firmware version on GitHub that works with the integration.

Version 1.0 is the latest tested

I am spending time once in a while to overhaul the integration. But progress is slow.

2 Likes

Im using also the latest github surce to get it working with esp32.
It would be great if you could update the integration :smiley:

Super, nice! Dont you have documents for the board layout(PCB layout) for BSB-LAN adapter? I saw only schematic, but I dont know ho to design it :frowning:

My BSB-lan adapter is on it’s way and I’ll be using an ESP32, so I’m not sure version 1.0 will work for me. Can I help in getting the integration updated so it’ll work with the current version of the firmware?

I hope to start soon. I think I am going to start a custom component and will make it available on hacs first. This makes development and iterations a bit faster than doing pull request on the core. A lot need to be changed.

1 Like

@konicekdavid, go to the BSB-LAN Github page or the documentation and you can find there the developer’s,
Frederik, email.
Send an email to him with your boiler’s model number to confirm that it will work and ask him for the BSB-LAN adapter.

You can order the board from him, assembled or non-assembled. He will tell you which board you need depending on you ESP board.

1 Like

Bonjour; je suis Francais et utilise BSBLan de Frederik Holst.
Je possede une pompe a chaleur Atlantic avec un RVS21.831F/127.
Je cherche a trouver les parametres qui gerent les differentiels autour des points de consignes de mon circuit de chauffe 1 (qui gere ma vanne 3 voies) et de mon circuit de chauffage 2 (qui gere la variation de vitesse de mon compresseur).
J’ai deja bien travaillĂ© sur Le Tn et Xp de mon circuit 1, mais ne trouve pas le numero du parametre du differentiel (aujourd’hui, Ă  0.5k apparement sur le circuit 1 et 1k pour le circuit 2).
Pourriez vous m’aider ?
Merci par avance

If you ask this question in English, then someone might can answer it.

But looking at your question, it is better to ask it on the BSB-LAN Github repo under the Discussions. Probably you will get an answer there easier as this is really a heater specific question.

Has someone managed to send commands via MQTT?
I can successfully read the values into created sensors, but changing parameters does not work.
The help of BSB-LAN (Manual for the BSB-LAN Hard- & Software | Manual for the BSB-LAN Hard- & Software) says:

The command set mqtt2Server publish BSB-LAN /S700=1 sends from the MQTT broker named “mqtt2Server” the command “/S700=1” with the topic “BSB-LAN” and causes a mode switch to automatic mode.

So I am trying the following in a script:

service: mqtt.publish
data:
  topic: BSB-LAN
  payload: /S700=1

But that simply does not do anything, although it looks to me like the bulb on the BSB-LAN board very shortly flashing, like the command would at least reach it.

The board will flash always as it queries things from the heater.

This how my Domestic Hot Water setup works:

#BSB-LAN
# Example configuration.yaml entry
  - platform: mqtt
    unique_id: bsb_lan_dhw
    state_topic: "BSB-LAN/1600"
    name: BSB-LAN Domestic How Water Switch
    command_topic: "BSB-LAN"
    payload_on: "S1600=1"
    payload_off: "S1600=0"
    state_on: "1 - On"
    state_off: "0 - Off"
    optimistic: false
    qos: 0
    retain: true

This gives you and MQTT Switch entity to control the Domestic Hot Water on the heater.

1 Like