Configured my ESPHome with MCP2515 CAN-Bus for Stiebel Eltron heating pump

Hi all and thanks for sharing Stiebel tips and information. I’m trying to connect my Stiebel Eltron WPF 10 heat pump can bus with Wemos D1 mini pro and MCP2515 can board. Basically configuration is based on the instructions given here: CAN bus — ESPHome

With the below pasted .yaml I do get some data, like heating and boiler temperatures and after a while also one of the COPs is shown. But most of the measurements stays in N/A state. Any ideas what could be wrong in my configuration?

I also noted that when my ESP is connected to the can bus of the pump, the pump’s menus comes quite slow. Sometimes it even shown an empty submenu / no measurements at all. But going one step back in the menu and retrying usually helps and the measurements are again correctly shown. It looks like my ESP is somehow messing out the can bus…?

PS. like you see, my code is almost like copy-paste from this site posts :slight_smile:

esphome:
  name: heatpump
  platform: ESP8266
  board: d1_mini_pro

# Enable logging
logger:

# Enable Home Assistant API
api:
#  password: "<password>"

  services:
    - service: pull_canmsg
      variables:
        idx: int
        addr: int
        val: int
      then:
        - lambda: |-
            int getA = static_cast<int>(addr); //Adresse in Byte 0 u. 1 schreiben
            id(sh_state)[0]=getA>>8;
            id(sh_state)[1]=getA-((getA>>8)<<8);

            getA = static_cast<int>(idx); //Elster-Index übernehmen // Ota käyttöön Elster-indeksi
            //Wenn Elster-Index <= 0xff => an Byte-Stelle 2 schreiben //Jos Elster-indeksi <= 0xff => kirjoita tavupaikkaan 2
            if( (getA>>8) == 0x00) {
              id(sh_state)[2]=getA-((getA>>8)<<8);

              getA = static_cast<int>(val); //Datenwert übernehmen und an Stelle 3 u. 4 schreiben, 5 u. 6 ist 0x00 // Ota tietoarvo ja kirjoita paikkoihin 3 ja 4, 5 ja 6 on 0x00
              id(sh_state)[3]=getA>>8;
              id(sh_state)[4]=getA-((getA>>8)<<8);
              id(sh_state)[5]=0x00;
              id(sh_state)[6]=0x00;
            }
            else {
              //Wenn Elster-Index > 0xff kommt 0xfa an Stelle 2, der Index steht dann an Stelle 3 u. 4 //Jos Elster-indeksi > 0xff, 0xfa tulee paikalleen 2, indeksi on silloin paikoissa 3 ja 4
              id(sh_state)[2]=0xfa;
              id(sh_state)[3]=getA>>8;
              id(sh_state)[4]=getA-((getA>>8)<<8);

              getA = static_cast<int>(val); //der Datenwert steht dann an Stelle 5 u. 6 //tietoarvo on silloin paikoissa 5 ja 6
              id(sh_state)[5]=getA>>8;
              id(sh_state)[6]=getA-((getA>>8)<<8);
            }



#Temporaly removed when debuging wifi problem..
# ota:
  # password: !secret ota_password
  # safe_mode: true
  # reboot_timeout: 10min
  # num_attempts: 5

wifi:
  fast_connect: true
  ssid: !secret wifi_ssid
  password: !secret wifi_password

#Temporaly removed when debuging wifi problem..
  # Enable fallback hotspot (captive portal) in case wifi connection fails
#  ap:
#    ssid: heatpump

#Temporaly removed when debuging wifi problem..
#captive_portal:


web_server:
  port: 80
  auth:
    username: !secret web_uname
    password: !secret web_pw

#Joku bugi, ilman debugia wifiin yhditäminen failaa
#Bug? WiFi connection fails without debug..
debug:

globals:


#Array zum Senden von Can-Bus Befehl aus Home-Assistant
#Matriisi Can-Bus-komennon lähettämiseen Home Assistantista
  - id: sh_state
    type: int[7]
    initial_value: '{0x00,0x00,0x00,0x00,0x00,0x00,0x00}'
    restore_value: no
#Array zum Senden von Can-Bus Befehl aus Programmcode
#Matriisi Can-Bus-komennon lähettämiseen ohjelmakoodista
  - id: send_state
    type: int[7]
    initial_value: '{0x00,0x00,0x00,0x00,0x00,0x00,0x00}'
    restore_value: no






  - id: el_aufnahmeleistung_ww_tag_wh_float
    type: float
    restore_value: no
  - id: el_aufnahmeleistung_ww_tag_wh_flag
    type: bool
    restore_value: no
  - id: el_aufnahmeleistung_ww_tag_kwh
    type: float
    restore_value: no
  - id: el_aufnahmeleistung_ww_tag_kwh_flag
    type: bool
    restore_value: no
  - id: el_aufnahmeleistung_heiz_tag_wh_float
    type: float
    restore_value: no
  - id: el_aufnahmeleistung_heiz_tag_wh_flag
    type: bool
    restore_value: no
  - id: el_aufnahmeleistung_heiz_tag_kwh
    type: float
    restore_value: no
  - id: el_aufnahmeleistung_heiz_tag_kwh_flag
    type: bool
    restore_value: no 
  - id: el_aufnahmeleistung_ww_total_kWh_float
    type: float
    restore_value: no
  - id: el_aufnahmeleistung_ww_total_kWh_flag
    type: bool
    restore_value: no
  - id: el_aufnahmeleistung_ww_total_mWh
    type: float
    restore_value: no
  - id: el_aufnahmeleistung_ww_total_mWh_flag
    type: bool
    restore_value: no
  - id: el_aufnahmeleistung_heiz_total_kWh_float
    type: float
    restore_value: no
  - id: el_aufnahmeleistung_heiz_total_kWh_flag
    type: bool
    restore_value: no
  - id: el_aufnahmeleistung_heiz_total_mWh
    type: float
    restore_value: no

    
  - id: volumenstrom_float
    type: float
    restore_value: no

  - id: el_aufnahmeleistung_heiz_total_mWh_flag
    type: bool
    restore_value: no

  - id: VD_starts_h
    type: int
    initial_value: '0'
    restore_value: no

  - id: VD_starts_t
    initial_value: '0'
    type: float
    restore_value: no

  - id: waermemertrag_ww_tag_wh_float
    type: float
    restore_value: no
  - id: waermemertrag_ww_tag_wh_flag
    type: bool
    restore_value: no
  - id: waermemertrag_ww_tag_kwh
    type: float
    restore_value: no
  - id: waermemertrag_ww_tag_kwh_flag
    type: bool
    
  - id: waermemertrag_electr_ww_tag_wh_float
    type: float
    restore_value: no
  - id: waermemertrag_electr_ww_tag_wh_flag
    type: bool
    restore_value: no
  - id: waermemertrag_electr_ww_tag_kwh
    type: float
    restore_value: no
  - id: waermemertrag_electr_ww_tag_kwh_flag
    type: bool    
    restore_value: no

  - id: waermemertrag_heiz_tag_wh_float
    type: float
    restore_value: no
  - id: waermemertrag_heiz_tag_wh_flag
    type: bool
    restore_value: no
  - id: waermemertrag_heiz_tag_kwh
    type: float
    restore_value: no
  - id: waermemertrag_heiz_tag_kwh_flag
    type: bool
    restore_value: no 

  - id: waermemertrag_electr_heiz_tag_wh_float
    type: float
    restore_value: no
  - id: waermemertrag_electr_heiz_tag_wh_flag
    type: bool
    restore_value: no
  - id: waermemertrag_electr_heiz_tag_kwh
    type: float
    restore_value: no
  - id: waermemertrag_electr_heiz_tag_kwh_flag
    type: bool
    restore_value: no 

  - id: waermemertrag_ww_total_kWh_float
    type: float
    restore_value: no
  - id: waermemertrag_ww_total_kWh_flag
    type: bool
    restore_value: no
  - id: waermemertrag_ww_total_mWh
    type: float
    restore_value: no
  - id: waermemertrag_ww_total_mWh_flag
    type: bool
    restore_value: no

  - id: waermemertrag_heiz_total_kWh_float
    type: float
    restore_value: no
  - id: waermemertrag_heiz_total_kWh_flag
    type: bool
    restore_value: no
  - id: waermemertrag_heiz_total_mWh
    type: float
    restore_value: no
  - id: waermemertrag_heiz_total_mWh_flag
    type: bool
    restore_value: no

  - id: waermemertrag_electr_heiz_total_kWh_float
    type: float
    restore_value: no
  - id: waermemertrag_electr_heiz_total_kWh_flag
    type: bool
    restore_value: no
  - id: waermemertrag_electr_heiz_total_mWh
    type: float
    restore_value: no
  - id: waermemertrag_electr_heiz_total_mWh_flag
    type: bool
    restore_value: no

  - id: waermemertrag_electr_ww_total_kWh_float
    type: float
    restore_value: no
  - id: waermemertrag_electr_ww_total_kWh_flag
    type: bool
    restore_value: no
  - id: waermemertrag_electr_ww_total_mWh
    type: float
    restore_value: no
  - id: waermemertrag_electr_ww_total_mWh_flag
    type: bool
    restore_value: no




#Abfrage des Sensorstatus durch Ausführen des Lambda-Befehls. send_state wird auf das request-Paket gesetzt. Anschließend wird Update_sensor aktiviert, der den Befehl via CAN absetzt und wieder deaktiviert
#Anturin tilan kyseleminen suorittamalla Lambda-komento. send_state on asetettu pyyntöpakettiin. Sitten Update_sensor aktivoituu, joka lähettää komennon CAN:n kautta ja deaktivoi sen uudelleen
sensor:
  - platform: template
    #name: "Außentemperatur"
    name: "Ulkolämpötila"
    id: temperature_outside
    unit_of_measurement: "°C"
    icon: "mdi:thermometer-lines"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 1
    lambda: |-
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x00;id(send_state)[4]=0x0c;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      return {};
    update_interval: 10min


  - platform: template
    #name: "Quellentemperatur"
    name: "Lähteen lämpötila"
    id: temperature_source
    unit_of_measurement: "°C"
    icon: "mdi:thermometer-lines"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 1
    lambda: |-
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x01;id(send_state)[4]=0xd4;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      return {};
    update_interval: 10min
    


  - platform: template
    #name: "Warmwassertemperatur"
    name: "Lämpimän veden lämpötila"
    id: temperature_water
    unit_of_measurement: "°C"
    icon: "mdi:thermometer-lines"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 1
    lambda: |-
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0x0e;id(send_state)[3]=0x01;id(send_state)[4]=0x00;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      return {};
    update_interval: 10min

#In Planung
#  - platform: template
#    name: "WW_Programmstart"
#    id: ww_start
#    icon: "mdi:timer-play"
#    state_class: "measurement"
#    accuracy_decimals: 0

#In Planung
#  - platform: template
#    name: "WW_Programmende"
#    id: ww_ende
#    icon: "mdi:timer-stop"
#    state_class: "measurement"
#    accuracy_decimals: 0




#Berechnung COP erfolgt über Sensoren für Stromverbrauch und Wärmeproduktion - kein aktiver Update-Befehl
##COP:n laskenta tapahtuu sähkönkulutuksen ja lämmöntuotannon antureiden kautta - ei aktiivista päivityskomentoa
  - platform: template
    #name: "Verdichterstarts"
    name: "Kompressori käynnistyy"
    id: VD_starts
    unit_of_measurement: "a.u."
    icon: "mdi:chart-bell-curve-cumulative"
    device_class: "power_factor"
    state_class: "measurement"
    lambda: |-
      
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x07;id(send_state)[4]=0x1c;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
    
    
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x07;id(send_state)[4]=0x1d;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);

      if (id(VD_starts_t>0) and id(VD_starts_h>0)){
        float VD_starts_float = id(VD_starts_h)+id(VD_starts_t);
        return VD_starts_float;
      }
      else {return {};}
    update_interval: 5h
    accuracy_decimals: 0





  - platform: template
    #name: "COP-Wert Heizung"
    name: "COP-arvo lämmitys"
    id: cop_heater
    unit_of_measurement: "a.u."
    icon: "mdi:chart-bell-curve-cumulative"
    device_class: "power_factor"
    state_class: "measurement"
    accuracy_decimals: 2
    lambda: |-
      id(total_electric_energy_heating).update();
      id(total_heating_energy).update();
      id(total_electric_heating_energy).update();
      float heat_cop_float = (id(waermemertrag_heiz_total_mWh)+id(waermemertrag_electr_heiz_total_mWh))/id(el_aufnahmeleistung_heiz_total_mWh);
      return heat_cop_float;
    force_update: true


  - platform: template
    #name: "COP-Wert Warmwasser"
    name: "COP-arvo lämmin vesi"
    id: cop_water
    unit_of_measurement: "a.u."
    icon: "mdi:chart-bell-curve-cumulative"
    device_class: "power_factor"
    state_class: "measurement"
    accuracy_decimals: 2
    lambda: |-
      id(total_heating_energy_water).update();
      id(total_electric_energy_water).update();
      id(total_heating_energy_water).update();
      float ww_cop_float = (id(waermemertrag_ww_total_mWh)+id(waermemertrag_electr_ww_total_mWh))/id(el_aufnahmeleistung_ww_total_mWh);
      return ww_cop_float;
    force_update: true
    
  - platform: template
    #name: "COP-Wert Gesamt"
    name: "COP-arvo yhteensä"
    id: cop_total
    unit_of_measurement: "a.u."
    icon: "mdi:chart-bell-curve-cumulative"
    device_class: "power_factor"
    state_class: "measurement"
    accuracy_decimals: 2
    lambda: |-
      id(cop_water).update();
      id(cop_heater).update();
      float total_cop_float = ((id(waermemertrag_heiz_total_mWh)+id(waermemertrag_electr_heiz_total_mWh))+(id(waermemertrag_ww_total_mWh)+id(waermemertrag_electr_ww_total_mWh)))/(id(el_aufnahmeleistung_heiz_total_mWh)+id(el_aufnahmeleistung_ww_total_mWh));
      return total_cop_float;
    force_update: true
    update_interval: 6h




  - platform: template
    #name: "Rücklauftemperatur Heizung"
    name: "Lämmityksen paluulämpötila"
    id: temperature_return
    unit_of_measurement: "°C"
    icon: "mdi:waves-arrow-left"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 1
    lambda: |-
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x00;id(send_state)[4]=0x16;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      return {};
    update_interval: 5min



  - platform: template
    #name: "T Heizkreis IST"
    name: "T lämmityspiiri TODELLINEN"
    id: t_heizkreis_ist
    unit_of_measurement: "°C"
    icon: "mdi:waves-arrow-right"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 1
    lambda: |-
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x02;id(send_state)[4]=0xca;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      return {};
    update_interval: 5min


    
  - platform: template
    #name: "T Heizkreis Soll"
    name: "T lämmityspiiri TAVOITE"
    id: t_heizkreis_soll
    unit_of_measurement: "°C"
    icon: "mdi:waves-arrow-left"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 1
    lambda: |-
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x01;id(send_state)[4]=0xd7;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      return {};
    update_interval: 15min


  - platform: template
    #name: "Speicher Soll Temperatur"
    name: "T varaajan TAVOITE"
    id: t_ww_soll
    unit_of_measurement: "°C"
    icon: "mdi:thermometer-water"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 1
    lambda: |-
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0x03;id(send_state)[3]=0x00;id(send_state)[4]=0x00;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      return {};
    update_interval: 15min






  - platform: template
    #name: "Speicher IST Temperatur"
    name: "T varaaja TODELLINEN"
    id: t_ww_ist
    unit_of_measurement: "°C"
    icon: "mdi:thermometer-lines"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 1




  - platform: template
    #name: "Eco Speicher Soll Temperatur"
    name: "T Eco varaajan TAVOITE"
    id: ww_temp_eco_log
    unit_of_measurement: "°C"
    icon: "mdi:thermometer-low"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 1
    lambda: |-
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x0a;id(send_state)[4]=0x06;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      return {};
    update_interval: 10min




  - platform: template
    #name: "Komfort Speicher Soll Temperatur"
    name: "T Mukavuus varaaja TAVOITE"
    id: ww_temp_komfort_log
    unit_of_measurement: "°C"
    icon: "mdi:thermometer-high"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 1
    lambda: |-
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0x13;id(send_state)[3]=0x00;id(send_state)[4]=0x00;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      return {};
    update_interval: 10min




  - platform: template
    #name: "Volumenstrom"
    name: "Virtausnopeus"
    id: volumenstrom_log
    unit_of_measurement: "l/min"
    icon: "mdi:waves-arrow-right"
    state_class: "measurement"
    accuracy_decimals: 2
    lambda: |-
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x06;id(send_state)[4]=0x73;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      return {};
    update_interval: 1min



  - platform: template
    #name: "Heizungsdruck"
    name: "Lämmityspaine"
    id: heizungsdruck_log
    unit_of_measurement: "bar"
    icon: "mdi:gauge"
    device_class: "pressure"
    state_class: "measurement"
    accuracy_decimals: 2
    lambda: |-
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x06;id(send_state)[4]=0x74;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      return {};
    update_interval: 7min



  - platform: template
    #name: "Puffertemperatur"
    name: "Puskurivaraajan lämpötila"
    id: puffertemperatur_log
    unit_of_measurement: "°C"
    icon: "mdi:thermometer-high"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 1


#Automatische Updates durch FEK
  - platform: template
    #name: "Luftfeuchtigkeit Wohnraum"
    name: "Asunnon kosteus"
    id: humidity_inside
    unit_of_measurement: "%rH"
    icon: "mdi:water-percent"
    device_class: "humidity"
    state_class: "measurement"
    accuracy_decimals: 1


  - platform: template
    #name: "Temperatur Wohnraum"
    name: "Asunnon lämpötila"
    id: temperature_inside
    unit_of_measurement: "°C"
    icon: "mdi:thermometer-lines"
    device_class: "temperature"
    state_class: "measurement"
    accuracy_decimals: 1
    



  - platform: template
    #name: "Stromverbrauch Warmwasser heute"
    name: "Sähkönkulutus lämminvesi tänään"
    id: daily_electric_energy_water
    unit_of_measurement: "kWh"
    device_class: "energy"
    state_class: "measurement"
    accuracy_decimals: 3
    icon: "mdi:transmission-tower"
    lambda: |-
      //el. Leistungsaufnahme WW Tag Wh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x1a;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      
      //el. Leistungsaufnahme WW Tag kWh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x1b;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      if (id(el_aufnahmeleistung_ww_tag_kwh_flag) and id(el_aufnahmeleistung_ww_tag_wh_flag)){
        id(el_aufnahmeleistung_ww_tag_kwh) += id(el_aufnahmeleistung_ww_tag_wh_float);
        float daily_electric_energy_water=id(el_aufnahmeleistung_ww_tag_kwh);
        id(el_aufnahmeleistung_ww_tag_kwh_flag)=false;
        id(el_aufnahmeleistung_ww_tag_wh_flag)=false;
        return daily_electric_energy_water;
        }
      else{return {};}
    update_interval: 15min

  - platform: template
    #name: "WM Heizung heute"
    name: "Lämmityksen WM?? tänään"
    id: daily_heating_energy
    unit_of_measurement: "kWh"
    device_class: "energy"
    icon: "mdi:water-boiler"
    state_class: "measurement"
    accuracy_decimals: 3
    lambda: |-
      //WM Heizen Tag wh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x2e;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      
      //WM Heizen Tag kwh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x2f;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      if (id(waermemertrag_heiz_tag_kwh_flag) and id(waermemertrag_heiz_tag_wh_flag)){
        id(waermemertrag_heiz_tag_kwh) += id(waermemertrag_heiz_tag_wh_float);
        float daily_heating_energy=id(waermemertrag_heiz_tag_kwh);
        id(waermemertrag_heiz_tag_kwh_flag)=false;
        id(waermemertrag_heiz_tag_wh_flag)=false;
        return daily_heating_energy;
        }
        else {
          return {};
        }
    update_interval: 15min


  - platform: template
    #name: "Stromverbrauch Heizung heute"
    name: "Sähkönkulutus lämmitys tänään"
    id: daily_electric_energy_heating
    unit_of_measurement: "kWh"
    device_class: "energy"
    state_class: "measurement"
    icon: "mdi:transmission-tower"
    accuracy_decimals: 3   
    lambda: |-
      //el. Leistungsaufnahme Heizen Tag Wh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x1e;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      
      //el. Leistungsaufnahme Heizen Tag kWh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x1f;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      if (id(el_aufnahmeleistung_heiz_tag_kwh_flag) and id(el_aufnahmeleistung_heiz_tag_wh_flag)){
        id(el_aufnahmeleistung_heiz_tag_kwh) += id(el_aufnahmeleistung_heiz_tag_wh_float);
        float daily_electric_energy_heating=id(el_aufnahmeleistung_heiz_tag_kwh);
        id(el_aufnahmeleistung_heiz_tag_kwh_flag)=false;
        id(el_aufnahmeleistung_heiz_tag_wh_flag)=false;
        return daily_electric_energy_heating;
      }
      else{return {};}
    update_interval: 6h


  - platform: template
    #name: "WM Warmwasser heute"
    name: "Lämpimän veden WM?? tänään"
    id: daily_heating_energy_water
    unit_of_measurement: "kWh"
    device_class: "energy"
    icon: "mdi:water-boiler"
    state_class: "measurement"
    accuracy_decimals: 3
    lambda: |-
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x2a;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x2b;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      if (id(waermemertrag_ww_tag_kwh_flag) and id(waermemertrag_ww_tag_wh_flag)){
      id(waermemertrag_ww_tag_kwh) += id(waermemertrag_ww_tag_wh_float);
      float daily_heating_energy_water=id(waermemertrag_ww_tag_kwh);
      id(waermemertrag_ww_tag_kwh_flag)=false;
      id(waermemertrag_ww_tag_wh_flag)=false;
      return daily_heating_energy_water;
      }
      else{ return {};
      }
    update_interval: 15min

2 Likes

Part 2/3 of the .yaml

  - platform: template
    #name: "Stromverbrauch Warmwasser total"
    name: "Lämpimän veden kokonaiskulutus"
    id: total_electric_energy_water
    unit_of_measurement: "MWh"
    device_class: "energy"
    state_class: "total_increasing"
    icon: "mdi:transmission-tower"
    accuracy_decimals: 3
    lambda: |-
      //el. Leistungsaufnahme WW Summe kwh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x1c;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      
      //el. Leistungsaufnahme WW Summe Mwh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x1d;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      if (id(el_aufnahmeleistung_ww_total_mWh_flag) and id(el_aufnahmeleistung_ww_total_kWh_flag)){
        id(el_aufnahmeleistung_ww_total_mWh) += id(el_aufnahmeleistung_ww_total_kWh_float);
        float total_electric_energy_water=id(el_aufnahmeleistung_ww_total_mWh);
        id(el_aufnahmeleistung_ww_total_mWh_flag)=false;
        id(el_aufnahmeleistung_ww_total_kWh_flag)=false;
        return total_electric_energy_water;
        }
      else {  return {};}



  - platform: template
    #name: "Stromverbrauch Heizung total"
    name: "Lämmityksen kokonaiskulutus"
    id: total_electric_energy_heating
    unit_of_measurement: "MWh"
    device_class: "energy"
    icon: "mdi:transmission-tower"
    state_class: "total_increasing"
    accuracy_decimals: 3
    lambda: |-
      //el. Leistungsaufnahme Heizen Summe kwh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x20;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      
      //el. Leistungsaufnahme Heizen Summe Mwh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x21;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      if (id(el_aufnahmeleistung_heiz_total_mWh_flag) and id(el_aufnahmeleistung_heiz_total_kWh_flag)){
        id(el_aufnahmeleistung_heiz_total_mWh) += id(el_aufnahmeleistung_heiz_total_kWh_float);
        float total_electric_energy_heating=id(el_aufnahmeleistung_heiz_total_mWh);
        id(el_aufnahmeleistung_heiz_total_mWh_flag)=false;
        id(el_aufnahmeleistung_heiz_total_mWh_flag)=false;
        return total_electric_energy_heating;
        }
      else {return {};
        
      }



  - platform: template
    #name: "WM Heizen total"
    name: "Lämmityksen kokonais WM??"
    id: total_heating_energy
    unit_of_measurement: "MWh"
    device_class: "energy"
    icon: "mdi:water-boiler"
    state_class: "total_increasing"
    accuracy_decimals: 3
    lambda: |-
      //WM Heizen Summe kwh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x30;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      
      //WM Heizen Summe Mwh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x31;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);

      //Überprüfung ob beide Leistungswerte empfangen wurden
      if (id(waermemertrag_heiz_total_kWh_flag) and id(waermemertrag_heiz_total_mWh_flag)){
        id(waermemertrag_heiz_total_mWh) += id(waermemertrag_heiz_total_kWh_float);
        float total_heating_energy=id(waermemertrag_heiz_total_mWh);
        id(waermemertrag_heiz_total_kWh_flag)=false;
        id(waermemertrag_heiz_total_mWh_flag)=false;
        return total_heating_energy;
        }
      else {
        return {};
      }
      
      
  - platform: template
    #name: "WM Warmwasser total"
    name: "Lämpimän veden kokonais WM??"
    id: total_heating_energy_water
    unit_of_measurement: "MWh"
    device_class: "energy"
    icon: "mdi:water-boiler"
    state_class: "total_increasing"
    accuracy_decimals: 3
    lambda: |-
      //WM WW Summe kwh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x2c;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      
      //WM WW Summe Mwh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x2d;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      //Überprüfung ob beide Leistungswerte empfangen wurden
      if (id(waermemertrag_ww_total_mWh_flag) and id(waermemertrag_ww_total_kWh_flag)){
        id(waermemertrag_ww_total_mWh) += id(waermemertrag_ww_total_kWh_float);
        float total_heating_energy_water=id(waermemertrag_ww_total_mWh);
        id(waermemertrag_ww_total_mWh_flag)=false;
        id(waermemertrag_ww_total_kWh_flag)=false;
        return total_heating_energy_water;
        }
      else {
        return {};
        
      }


  - platform: template
    #name: "WM elektr. Warmwasser total"
    name: "Lämpimän veden kokonais WM elektr. ??"
    id: total_electric_heating_energy_water
    unit_of_measurement: "kWh"
    device_class: "energy"
    icon: "mdi:water-boiler"
    state_class: "total_increasing"
    accuracy_decimals: 3
    lambda: |-
      //WM NE WW Summe kwh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x24;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      
      //WM NE WW Summe MWh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x25;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      
      //Überprüfung ob beide Leistungswerte empfangen wurden
      if (id(waermemertrag_electr_ww_total_mWh_flag) and id(waermemertrag_electr_ww_total_kWh_flag)){
        id(waermemertrag_electr_ww_total_mWh) += id(waermemertrag_electr_ww_total_kWh_float);
        float total_electric_heating_energy_water=id(waermemertrag_electr_ww_total_mWh);
        id(waermemertrag_electr_ww_total_mWh_flag)=false;
        id(waermemertrag_electr_ww_total_kWh_flag)=false;
        return total_electric_heating_energy_water;
      }
      else {
        return {};
        
      }



  - platform: template
    #name: "WM elektr. heizen total"
    name: "Lämmityksen kokonais WM elektr. ??"
    id: total_electric_heating_energy
    unit_of_measurement: "kWh"
    device_class: "energy"
    icon: "mdi:water-boiler"
    state_class: "total_increasing"
    accuracy_decimals: 3
    lambda: |-
      //WM NE Heizen Summe kWh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x28;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      
      //WM NE Heizen Summe MWh
      id(send_state)[0]=0x31;id(send_state)[1]=0x00;id(send_state)[2]=0xfa;id(send_state)[3]=0x09;id(send_state)[4]=0x29;id(send_state)[5]=0x00;id(send_state)[6]=0x00;
      id(update_sensor).publish_state(true);
      id(update_sensor).publish_state(false);
      
      //Überprüfung ob beide Leistungswerte empfangen wurden
      if (id(waermemertrag_electr_heiz_total_kWh_flag) and id(waermemertrag_electr_heiz_total_mWh_flag)){
        id(waermemertrag_electr_heiz_total_mWh) += id(waermemertrag_electr_heiz_total_kWh_float);
        float total_electric_heating_energy=id(waermemertrag_electr_heiz_total_mWh);
        id(waermemertrag_electr_heiz_total_kWh_flag)=false;
        id(waermemertrag_electr_heiz_total_mWh_flag)=false;
        return total_electric_heating_energy;
      }

      else {
        return {};
        
      }


text_sensor:
#Sensor zum verändern der Warmwasser-Komfort-Temperatur für Automatisierung mit PV-Anlage
  - platform: homeassistant
    name: "ww_komfort_temp"
    entity_id: input_text.ww_komfort_temp
    id: HASSeingabe_wwkomforttemp
    filters:
     - lambda: |-
          int eingabe=atoi(x.c_str());
          if (eingabe < 250 or eingabe > 600) {
            //Einfache Abfrage der Temperatur durchführen, falls keine gültige Eingabe erfolgt ist   
            id(send_state)[0]=0x31;
            id(send_state)[1]=0x00;
            id(send_state)[2]=0x13;
            id(send_state)[3]=0x00;
            id(send_state)[4]=0x00;
            id(send_state)[5]=0x00;
            id(send_state)[6]=0x00;
            return x;


          } else {
            //Wenn User-Eingabe gültig war, Daten für Übertragung an Heizung bereit machen
            id(send_state)[0]=0x30;
            id(send_state)[1]=0x00;
            id(send_state)[2]=0x13;
            id(send_state)[3]=eingabe>>8;
            id(send_state)[4]=eingabe-((eingabe>>8)<<8);
            id(send_state)[5]=0x00;
            id(send_state)[6]=0x00;
            return x;
            
          }
    on_value:
          then:
            - lambda: |-
                //Daten senden
                id(update_sensor).publish_state(true);
                id(update_sensor).publish_state(false);


#Sensor zum verändern der Warmwasser-Eco-Temperatur für Automatisierung mit PV-Anlage
#Anturi kuuman veden ekolämpötilan muuttamiseen PV-järjestelmän automatisoimiseksi
  - platform: homeassistant
    name: "ww_eco_temp"
    entity_id: input_text.ww_eco_temp
    id: HASSeingabe_wwecotemp
    filters:
     - lambda: |-
          int eingabe=atoi(x.c_str());
          if (eingabe < 250 or eingabe > 600) {

            id(send_state)[0]=0x31;
            id(send_state)[1]=0x00;
            id(send_state)[2]=0xfa;
            id(send_state)[3]=0x0a;
            id(send_state)[4]=0x06;
            id(send_state)[5]=0x00;
            id(send_state)[6]=0x00;
            return x;


          } else {

            id(send_state)[0]=0x30;
            id(send_state)[1]=0x00;
            id(send_state)[2]=0xfa;
            id(send_state)[3]=0x0a;
            id(send_state)[4]=0x06;
            id(send_state)[5]=eingabe>>8;
            id(send_state)[6]=eingabe-((eingabe>>8)<<8);
            return x;
            
          }
    on_value:
          then:
            - lambda: |-
                id(update_sensor).publish_state(true);
                id(update_sensor).publish_state(false);



binary_sensor:
# Heizraum Lichtschalter
  # - platform: gpio
    # pin:
      # number: GPIO16
      # mode: INPUT_PULLUP
    # id: licht_heizraum_bn
    # on_press:
      # then:
        # - homeassistant.service:
            # service: light.turn_on
            # data:
              # entity_id: light.eg_heizraum_waschraum


#Sensor zum Senden von CAN-Befehlen aus Lambda-Routinen
#Anturi CAN-komentojen lähettämiseen Lambda-rutiineista
  - platform: template
    id: update_sensor
    on_press:
      then:
        - canbus.send: 
            data: !lambda
              return {(uint8_t) id(send_state)[0],(uint8_t) id(send_state)[1],(uint8_t) id(send_state)[2],(uint8_t) id(send_state)[3], (uint8_t) id(send_state)[4],(uint8_t) id(send_state)[5],(uint8_t) id(send_state)[6]};
            can_id: 0x680
2 Likes

And final part.

button:

#Button für CAN-Befehl im Log anzeigen - CAN-Befehl aus Home-Assistant-Dienst - es wird dabei kein Signal an den CAN-Bus gesendet; Führt auch erstmaliges refresh einzelner Sensoren aus
#Näytä lokissa CAN-komennon painike - CAN-komento Home Assistant -palvelusta - signaalia ei lähetetä CAN-väylään; Suorittaa myös yksittäisten antureiden alkupäivityksen
  - platform: template
    #name: "Befehl anzeigen / Sensorupdate"
    name: "Näytä komento / anturin päivitys"
    id: can_befehl_anzeigen
    on_press:
      then:      
        lambda: |-
         id(VD_starts).update();
         id(cop_total).update();
         ESP_LOGI("main", "Value of my hex_sensor: %x, %x, %x, %x, %x, %x, %x", id(sh_state)[0],id(sh_state)[1],id(sh_state)[2],id(sh_state)[3],id(sh_state)[4],id(sh_state)[5],id(sh_state)[6]);

#Button für CAN-Befehl absetzen - CAN-Befehl aus Home-Assistant-Dienst wird an CAN-Bus übermittelt
#CAN-komennon lähetyspainike - Home Assistant -palvelun CAN-komento välitetään CAN-väylään
  - platform: template
    #name: CAN-Befehl absetzen
    name: "Lähetä CAN-komento"
    id: can_send
    # Optional variables:
    icon: "mdi:emoticon-outline"
    on_press:
      then:
        - canbus.send: 
            data: !lambda
              return {(uint8_t) id(sh_state)[0],(uint8_t) id(sh_state)[1],(uint8_t) id(sh_state)[2],(uint8_t) id(sh_state)[3], (uint8_t) id(sh_state)[4],(uint8_t) id(sh_state)[5],(uint8_t) id(sh_state)[6]};
            can_id: 0x680


#Button zum automatisierten reset des ESP-Device
#Painike ESP-laitteen automaattiseen nollaukseen
  - platform: restart
    #name: "Heizraum ESP restart"
    name: "Lämpöpumpun ESP uudelleenkäynnistys"
    id: esp_heizraum_restart_bt
    on_press:
      - logger.log: "Button pressed"



#WW_Programm

#          - canbus.send:
#              data: [ 0x31, 0x00, 0xfa,0x17,0xa0,0x00,0x00 ]
#              can_id: 0x680
#          - delay: 500ms

#  { "HEISSGAS_TEMP"                                    , 0x0265, et_dec_val}, ok
#          - canbus.send:
#              data: [ 0x31, 0x00, 0xfa,0x02,0x65,0x00,0x00 ]
#              can_id: 0x680
#          - delay: 500ms

#Warmwasser Betriebsmodus Abfrage: - ok 1/10
#          - canbus.send:
#              data: [ 0x31, 0x00, 0xfa,0x01,0x12,0x00,0x00 ]
#              can_id: 0x680
#          - delay: 500ms


spi:
  id: McpSpi
  #clk_pin: D5
  clk_pin: D0
  #mosi_pin: D7
  mosi_pin: D1
  #miso_pin: D6
  miso_pin: D2
canbus:
  - platform: mcp2515
    id: my_mcp2515
    spi_id: McpSpi
    cs_pin: D5
    can_id: 680
    use_extended_id: false
    bit_rate: 20kbps
    on_frame:


#Verdichter Starts 1 000er
#Kompressori käynnistyy 1000s
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[2]==0xfa and x[3]==0x07 and x[4]==0x1c) {
                float VD_x =float((int16_t((x[6])+( (x[5])<<8))))*1000;
                id(VD_starts_t)=VD_x;
                ESP_LOGD("main", "Verdichter Starts 1000 empfangen over can is %f", VD_x);
              }

#Verdichter Starts 100er         
#Kompressori käynnistyy 100s     
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[2]==0xfa and x[3]==0x07 and x[4]==0x1d) {
                int VD_x =((int16_t((x[6])+( (x[5])<<8))));
                id(VD_starts_h)=VD_x;
                ESP_LOGD("main", "Verdichter Starts 100 empfangen over can is %i", VD_x);
              }

#T Heizkreis WW Komfort Soll Wert
#T lämmityspiirin WW mukavuustavoite
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[2]==0x13) {
              float temperature =(float((int16_t((x[4])+( (x[3])<<8))))/10);
              id(ww_temp_komfort_log).publish_state(temperature);
              ESP_LOGD("main", "T Komfort Soll empfangen over can is %f", temperature);
            }
#Volumenstrom (l/min)
#Tilavuusvirtaus (l/min)
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[2]==0xfa and x[3]==0x06 and x[4]==0x73) {
              float current =(float((int16_t((x[6])+( (x[5])<<8))))/100);
              id(volumenstrom_log).publish_state(current);
              id(volumenstrom_float)=current;
              ESP_LOGD("main", "l/min Volumenstrom empfangen over can is %f", current);
            }

#Heizungsdruck (bar)
#Lämmityspaine (bar)
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[2]==0xfa and x[3]==0x06 and x[4]==0x74) {
              float pressure =(float((int16_t((x[6])+( (x[5])<<8))))/100);
              id(heizungsdruck_log).publish_state(pressure);
              ESP_LOGD("main", "bar Heizungsdruck empfangen over can is %f", pressure);
            }
#T Puffertemperatur
#T puskurin lämpötila
        - lambda: |-
            if(x[0]==0x22 and x[1]==0x00 and x[2]==0x0e) {
              float temperature =(float((int16_t((x[4])+( (x[3])<<8))))/10);
              id(puffertemperatur_log).publish_state(temperature);
              ESP_LOGD("main", "T Puffertemperatur empfangen over can is %f", temperature);
            }


#T Heizkreis WW Eco Soll Abfrage
#T Lämmityspiiri WW Eco tavoitekysely
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[3]==0x0a and x[4]==0x06) {
              float temperature =(float((int16_t((x[6])+( (x[5])<<8))))/10);
              id(ww_temp_eco_log).publish_state(temperature);
              ESP_LOGD("main", "T Eco Soll empfangen over can is %f", temperature);
            }


#T Heizkreis IST Abfrage
#T Lämmityspiiri TODELLINEN kysely
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[3]==0x02 and x[4] == 0xca) {
              float temperature =(float((int16_t((x[6])+( (x[5])<<8))))/10);
              id(t_heizkreis_ist).publish_state(temperature);
              ESP_LOGD("main", "T Heizkreis IST empfangen over can is %f", temperature);
            }
#T Heizkreis Soll Abfrage
#T Lämmityspiirien tavoitekysely
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[3]==0x01 and x[4] == 0xd7) {
              float temperature =(float((int16_t((x[6])+( (x[5])<<8))))/10);
              id(t_heizkreis_soll).publish_state(temperature);
              ESP_LOGD("main", "T Heizkreis Soll empfangen over can is %f", temperature);
            }
#T WW Soll Abfrage
#T WW tavoitekysely
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[2]==0x03) {
              float temperature =(float((int16_t((x[4])+( (x[3])<<8))))/10);
              id(t_ww_soll).publish_state(temperature);
              ESP_LOGD("main", "T Warmwasser Soll empfangen over can is %f", temperature);
            }


#Warmwasser-Temperaturabfrage + Gerätespezifischer Offset 3.9 °C
#Lämpimän veden lämpötilakysely + laitekohtainen offset 3,9 °C
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[3]==0x00 and x[4] == 0x0e) {
              float temperature =(float((int16_t((x[6])+( (x[5])<<8))))/10)+3.9;
              id(temperature_water).publish_state(temperature);
              ESP_LOGD("main", "Warmwasser-Temperature empfangen over can is %f", temperature);
            }
            
#Quellen-Temperatur
#Lähdelämpötila
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[3]==0x01 and x[4] == 0xd4) {
              float temperature =float((int16_t((x[6])+( (x[5])<<8))))/10;
              id(temperature_source).publish_state(temperature);
              ESP_LOGD("main", "Quellen-Temperature received over can is %f", temperature);
            }

#Speicher IST-temperatur
#Muisti TODELLINEN lämpötila
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[2]==0x0e) {
              float temperature =float((int16_t((x[4])+( (x[3])<<8))))/10;
              id(t_ww_ist).publish_state(temperature);
              ESP_LOGD("main", "Speicher-Temperature received over can is %f", temperature);
            }

#Rücklauftemperatur
#Paluulämpötila
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[3]==0x00 and x[4] == 0x16) {
              float temperature =float((int16_t((x[6])+( (x[5])<<8))))/10;
              id(temperature_return).publish_state(temperature);
              ESP_LOGD("main", "Rücklauf-Temperature received over can is %f", temperature);
            }


#Außentemperatur
#float temperature =float(float((int((x[6])+( (x[5])<<8))))/10);
#Ulkolämpötila
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[3]==0x00 and x[4] == 0x0c) {
              float temperature =float((int16_t((x[6])+( (x[5])<<8))))/10;
              id(temperature_outside).publish_state(temperature);
              ESP_LOGD("main", "Aussen-Temperature received over can is %f", temperature);
            }





#Luftfeuchtigkeit FEK mitlesen
#Lue kosteus FEK?? (erillinen huoneanturi jota ei ole?)
    - can_id: 0x301
      then:
        - lambda: |-
            if(x[0]==0xc0 and x[1]==0x01 and x[2]==0x75) {
              float humidity =float(float((int16_t((x[4])+( (x[3])<<8))))/10);
              id(humidity_inside).publish_state(humidity);
              ESP_LOGD("main", "Humidity received over can is %f", humidity);
            }
#Raumtemperatur FEK mitlesen
#Lue huonelämpötila FEK?? (erillinen huoneanturi jota ei ole?)
    - can_id: 0x301
      then:
        - lambda: |-
            if(x[0]==0xc0 and x[1]==0x01 and x[2]==0x11) {
              float temperature =float((int16_t((x[4])+( (x[3])<<8))))/10;
              id(temperature_inside).publish_state(temperature);
              ESP_LOGD("main", "Raum-Temperature received over can is %f", temperature);
            }



#Elektrische Leistungsaufnahme Wh /kWh
#Sähkönkulutus Wh/kWh
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[2]==0xfa and x[3]==0x09) {
              if (x[4]==0x1a){
                id(el_aufnahmeleistung_ww_tag_wh_float) = (float((int((x[6])+( (x[5])<<8))))/1000);
                id(el_aufnahmeleistung_ww_tag_wh_flag)=true;
                ESP_LOGD("main", "el_aufnahmeleistung_ww_tag_kwh received over can is %f", id(el_aufnahmeleistung_ww_tag_wh_float));}
              else if (x[4]==0x1e){
                id(el_aufnahmeleistung_heiz_tag_wh_float) = (float((int((x[6])+( (x[5])<<8))))/1000);
                id(el_aufnahmeleistung_heiz_tag_wh_flag) = true;
                ESP_LOGD("main", "el_aufnahmeleistung_heiz_tag_wh received over can is %f", id(el_aufnahmeleistung_heiz_tag_wh_float));}
              else if (x[4]==0x1c){
                id(el_aufnahmeleistung_ww_total_kWh_float) = (float((int((x[6])+( (x[5])<<8))))/1000);
                id(el_aufnahmeleistung_ww_total_kWh_flag)=true;
                ESP_LOGD("main", "el_aufnahmeleistung_ww_total_kWh received over can is %f", id(el_aufnahmeleistung_ww_total_kWh_float));}
              else if (x[4]==0x20){
                id(el_aufnahmeleistung_heiz_total_kWh_float) = (float((int((x[6])+( (x[5])<<8))))/1000);
                id(el_aufnahmeleistung_heiz_total_kWh_flag) = true;
                ESP_LOGD("main", "el_aufnahmeleistung_heiz_total_kWh received over can is %f", id(el_aufnahmeleistung_heiz_total_kWh_float));}
              }

#Elektrische Leistungsaufnahme kWh / MWH
#Sähkönkulutus kWh / MWH
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[2]==0xfa and x[3]==0x09) {
              if(x[4]==0x1b){
              id(el_aufnahmeleistung_ww_tag_kwh) =float(int((x[6])+( (x[5])<<8)));
              id(el_aufnahmeleistung_ww_tag_kwh_flag)=true;
              ESP_LOGD("main", "el_aufnahmeleistung_ww_tag_kwh received over can is %f", id(el_aufnahmeleistung_ww_tag_kwh));}
              else if(x[4]==0x1f){
                id(el_aufnahmeleistung_heiz_tag_kwh) =float(int((x[6])+( (x[5])<<8)));
                id(el_aufnahmeleistung_heiz_tag_kwh_flag)=true;
                ESP_LOGD("main", "el_aufnahmeleistung_heiz_tag_kwh received over can is %f", id(el_aufnahmeleistung_heiz_tag_kwh));}
              else if(x[4]==0x1d){
              id(el_aufnahmeleistung_ww_total_mWh) =float(int((x[6])+( (x[5])<<8)));
              id(el_aufnahmeleistung_ww_total_mWh_flag)=true;
              ESP_LOGD("main", "el_aufnahmeleistung_ww_total_mWh received over can is %f", id(el_aufnahmeleistung_ww_total_mWh));}
              else if(x[4]==0x21){
                id(el_aufnahmeleistung_heiz_total_mWh) =float(int((x[6])+( (x[5])<<8)));
                id(el_aufnahmeleistung_heiz_total_mWh_flag)=true;
                ESP_LOGD("main", "el_aufnahmeleistung_heiz_total_mWh received over can is %f", id(el_aufnahmeleistung_heiz_total_mWh));}
            }


#Wärmeertrag WW/Heizung MWh / kWH
#Lämmöntuotto WW/lämmitys MWh/kWh
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[2]==0xfa and x[3]==0x09) {
              if(x[4]==0x25){
                id(waermemertrag_electr_ww_total_mWh) =float(int((x[6])+( (x[5])<<8)));
                id(waermemertrag_electr_ww_total_mWh_flag)=true;
                ESP_LOGD("main", "waermemertrag_electr_ww_tag_kwh received over can is %f", id(waermemertrag_electr_ww_total_mWh));}
              else if(x[4]==0x29){
                id(waermemertrag_electr_heiz_total_mWh) =float(int((x[6])+( (x[5])<<8)));
                id(waermemertrag_electr_heiz_total_mWh_flag)=true;
                ESP_LOGD("main", "waermemertrag_electr_heiz_tag_kwh received over can is %f", id(waermemertrag_electr_heiz_total_mWh));}
              else if(x[4]==0x2b){
              id(waermemertrag_ww_tag_kwh) =float(int((x[6])+( (x[5])<<8)));
              id(waermemertrag_ww_tag_kwh_flag)=true;
              ESP_LOGD("main", "waermemertrag_ww_tag_kwh received over can is %f", id(waermemertrag_ww_tag_kwh));}
              else if(x[4]==0x2d){
              id(waermemertrag_ww_total_mWh) =float(int((x[6])+( (x[5])<<8)));
              id(waermemertrag_ww_total_mWh_flag)=true;
              ESP_LOGD("main", "waermemertrag_ww_total_mWh received over can is %f", id(waermemertrag_ww_total_mWh));}
              else if(x[4]==0x2f){
                id(waermemertrag_heiz_tag_kwh) =float(int((x[6])+( (x[5])<<8)));
                id(waermemertrag_heiz_tag_kwh_flag)=true;
                ESP_LOGD("main", "waermemertrag_heiz_tag_kwh received over can is %f", id(waermemertrag_heiz_tag_kwh));}
              else if(x[4]==0x31){
                id(waermemertrag_heiz_total_mWh) =float(int((x[6])+( (x[5])<<8)));
                id(waermemertrag_heiz_total_mWh_flag)=true;
                ESP_LOGD("main", "waermemertrag_heiz_total_kWh_float received over can is %f", id(waermemertrag_heiz_total_mWh));}
            }


#Wärmeertrag WW/Heizung Wh / kWH
#Lämmöntuotto WW/lämmitys Wh/kWh
    - can_id: 0x180
      then:
        - lambda: |-
            if(x[0]==0xd2 and x[1]==0x00 and x[2]==0xfa and x[3]==0x09) {
              if(x[4]==0x24){
                id(waermemertrag_electr_ww_total_kWh_float) =float(int((x[6])+( (x[5])<<8)))/1000;
                id(waermemertrag_electr_ww_total_kWh_flag)=true;
                ESP_LOGD("main", "waermemertrag_electr_ww_tag_wh_float received over can is %f", id(waermemertrag_electr_ww_total_kWh_float));}
              else if(x[4]==0x28){
                id(waermemertrag_electr_heiz_total_kWh_float) =float(int((x[6])+( (x[5])<<8)))/1000;
                id(waermemertrag_electr_heiz_total_kWh_flag)=true;
                ESP_LOGD("main", "waermemertrag_electr_heiz_tag_wh_float received over can is %f", id(waermemertrag_electr_heiz_total_kWh_float));}
              else if(x[4]==0x2a){
              id(waermemertrag_ww_tag_wh_float) =float(int((x[6])+( (x[5])<<8)))/1000;
              id(waermemertrag_ww_tag_wh_flag)=true;
              ESP_LOGD("main", "waermemertrag_ww_tag_wh_float received over can is %f", id(waermemertrag_ww_tag_wh_float));}
              else if(x[4]==0x2c){
              id(waermemertrag_ww_total_kWh_float) =float(int((x[6])+( (x[5])<<8)))/1000;
              id(waermemertrag_ww_total_kWh_flag)=true;
              ESP_LOGD("main", "waermemertrag_ww_total_kWh_float received over can is %f", id(waermemertrag_ww_total_kWh_float));}
              else if(x[4]==0x2e){
                id(waermemertrag_heiz_tag_wh_float) =float(int((x[6])+( (x[5])<<8)))/1000;
                id(waermemertrag_heiz_tag_wh_flag)=true;
                ESP_LOGD("main", "waermemertrag_heiz_tag_wh_float received over can is %f", id(waermemertrag_heiz_tag_wh_float));}
              else if(x[4]==0x30){
                id(waermemertrag_heiz_total_kWh_float) =float(int((x[6])+( (x[5])<<8)))/1000;
                id(waermemertrag_heiz_total_kWh_flag)=true;
                ESP_LOGD("main", "waermemertrag_heiz_total_kWh_float received over can is %f", id(waermemertrag_heiz_total_kWh_float));}
            }



    - can_id: 0x180
      then:
        - lambda: |-
              int wert0 = int(x[0]);
              int wert1 =int(x[1]);
              int wert2 =int(x[2]);
              int wert3 =int(x[3]);
              int wert4 =int(x[4]);
              int wert5 =int(x[5]);
              int wert6 =int(x[6]);
              float wert7 = float(int((x[6])+( (x[5])<<8)));
              float wert8 = float(int((x[4])+( (x[3])<<8)));
              ESP_LOGI("main", "Antwort von 180 Hex: %x %x %x %x %x %x %x", wert0, wert1, wert2, wert3, wert4, wert5, wert6);
              ESP_LOGI("main", "Antwort von 180 Float: %f", wert7);
              ESP_LOGI("main", "Antwort von 180 Dez.: %i %i", wert5, wert6);
              ESP_LOGI("main", "Antwort klein von 180 Float: %f", wert8);
              ESP_LOGI("main", "Antwort klein von 180 Dez.: %i %i", wert3, wert4);
              
    - can_id: 0x700
      then:
        - lambda: |-
              int wert0 = int(x[0]);
              int wert1 =int(x[1]);
              int wert2 =int(x[2]);
              int wert3 =int(x[3]);
              int wert4 =int(x[4]);
              int wert5 =int(x[5]);
              int wert6 =int(x[6]);
              float wert7 = float(int((x[6])+( (x[5])<<8)));
              float wert8 = float(int((x[4])+( (x[3])<<8)));
              ESP_LOGI("main", "Antwort von 700 Hex: %x %x %x %x %x %x %x", wert0, wert1, wert2, wert3, wert4, wert5, wert6);
              ESP_LOGI("main", "Antwort von 700 Float: %f", wert7);
              ESP_LOGI("main", "Antwort von 700 Dez.: %i %i", wert5, wert6);
              ESP_LOGI("main", "Antwort klein von 700 Float: %f", wert8);
              ESP_LOGI("main", "Antwort klein von 700 Dez.: %i %i", wert3, wert4);

    - can_id: 0x480
      then:
        - lambda: |-
              int wert0 = int(x[0]);
              int wert1 =int(x[1]);
              int wert2 =int(x[2]);
              int wert3 =int(x[3]);
              int wert4 =int(x[4]);
              int wert5 =int(x[5]);
              int wert6 =int(x[6]);
              float wert7 = float(int((x[6])+( (x[5])<<8)));
              float wert8 = float(int((x[4])+( (x[3])<<8)));
              ESP_LOGI("main", "Antwort von 480 Hex: %x %x %x %x %x %x %x", wert0, wert1, wert2, wert3, wert4, wert5, wert6);
              ESP_LOGI("main", "Antwort von 480 Float: %f", wert7);
              ESP_LOGI("main", "Antwort von 480 Dez.: %i %i", wert5, wert6);
              ESP_LOGI("main", "Antwort klein von 480 Float: %f", wert8);
              ESP_LOGI("main", "Antwort klein von 480 Dez.: %i %i", wert3, wert4);

    - can_id: 0x100
      then:
        - lambda: |-
              int wert0 = int(x[0]);
              int wert1 =int(x[1]);
              int wert2 =int(x[2]);
              int wert3 =int(x[3]);
              int wert4 =int(x[4]);
              int wert5 =int(x[5]);
              int wert6 =int(x[6]);
              float wert7 = float(int((x[6])+( (x[5])<<8)));
              float wert8 = float(int((x[4])+( (x[3])<<8)));
              ESP_LOGI("main", "Antwort von 100 Hex: %x %x %x %x %x %x %x", wert0, wert1, wert2, wert3, wert4, wert5, wert6);
              ESP_LOGI("main", "Antwort von 100 Float: %f", wert7);
              ESP_LOGI("main", "Antwort von 100 Dez.: %i %i", wert5, wert6);
              ESP_LOGI("main", "Antwort klein von 100 Float: %f", wert8);
              ESP_LOGI("main", "Antwort klein von 100 Dez.: %i %i", wert3, wert4);

    - can_id: 0x301
      then:
        - lambda: |-
              int wert0 = int(x[0]);
              int wert1 =int(x[1]);
              int wert2 =int(x[2]);
              int wert3 =int(x[3]);
              int wert4 =int(x[4]);
              int wert5 =int(x[5]);
              int wert6 =int(x[6]);
              float wert7 = float(int((x[6])+( (x[5])<<8)));
              float wert8 = float(int((x[4])+( (x[3])<<8)));
              ESP_LOGI("main", "Antwort von 301 Hex: %x %x %x %x %x %x %x", wert0, wert1, wert2, wert3, wert4, wert5, wert6);
              ESP_LOGI("main", "Antwort von 301 Float: %f", wert7);
              ESP_LOGI("main", "Antwort von 301 Dez.: %i %i", wert5, wert6);
              ESP_LOGI("main", "Antwort klein von 301 Float: %f", wert8);
              ESP_LOGI("main", "Antwort klein von 301 Dez.: %i %i", wert3, wert4);
2 Likes

From what you describe and from what I have observed, you seem to be blocking the bus.

It is the case that most of the messages on the bus are sent by the participants at regular intervals and participants such as the display only show the most current value. If the ESP now specifically asks for a parameter, this process is disturbed. At least that’s how it looks to me in the code, but I’m not really familiar with ESPHome.

It would be better if the ESP only listens on the bus, stores the values and transfers the most up-to-date status when a request is made. Then you don’t intervene in the operating cycle.

This would definitely make sense. I’ll try to adapt my code based on this. On the other hand it’s little weird if somebody is able to run originally pasted code without problems.

I also find a thread where someone told that removing the resistor from MISO wire did solve similar problems - I tried also this but with no luck.

Well actually you dont know if its the code or your hardware setup.
I would reduce to a minimum. Textlog only for example to see what happens.
If it stops lagging is the code. If not it can be ESPHome somehow or the hardware setup…
I had some problems with the resisitor it was working in ESPHome but not with any other arduino code.
I now run like here https://esphome.io/_images/canbus_mcp2515_txs0108e.png but with an ESP32. No Problems at all. Even if I poll like hell I just dont get an answer every time but its not lagging…

Hello
this is my first post.
I have such a problem. It only shows in the logs.

[15:43:41][D][canbus:067]: received can message (#1) extended can_id=0x1545f83f size=6
[15:43:42][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:43:43][D][canbus:067]: received can message (#1) extended can_id=0x1545f83f size=6
[15:43:57][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:43:57][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:43:58][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:43:58][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:43:58][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:43:58][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:43:59][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:43:59][D][canbus:067]: received can message (#1) extended can_id=0x1545f83f size=6
[15:43:59][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:43:59][D][canbus:067]: received can message (#1) extended can_id=0x1545f83f size=6
[15:43:59][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:43:59][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:00][D][canbus:067]: received can message (#1) extended can_id=0x1545f83f size=6
[15:44:00][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:00][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:00][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:00][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:00][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:01][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:01][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:01][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:01][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:01][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:01][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:02][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:02][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:02][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:02][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:02][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:02][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:02][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:02][D][canbus:067]: received can message (#1) extended can_id=0x1545f83f size=6
[15:44:06][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:08][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:11][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:11][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:11][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:11][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:11][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:11][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:11][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:11][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:12][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:12][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:12][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:12][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:12][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:12][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:12][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:12][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:12][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:12][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:12][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:12][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:13][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:13][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:13][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:13][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:13][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:13][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:13][D][canbus:070]: received can message (#2) std can_id=0x7bf size=1
[15:44:13][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:13][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:13][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:13][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:13][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:13][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:14][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:14][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:14][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[15:44:14][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:14][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:14][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:14][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:14][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:14][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:15][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:15][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:15][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:15][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:15][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:15][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:15][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:15][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:15][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:15][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:15][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:15][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:16][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:17][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:17][D][canbus:070]: received can message (#1) std can_id=0x7bf size=1
[15:44:17][D][canbus:067]: received can message (#1) extended can_id=0x1545f83f size=6

configuration:

spi:
  id: McpSpi
  clk_pin: GPIO18
  mosi_pin: GPIO23
  miso_pin: GPIO19

canbus:
  - platform: mcp2515
    id: my_mcp2515
    spi_id: McpSpi
    cs_pin: GPIO5
    can_id: 680
    use_extended_id: false
    bit_rate: 20kbps
    on_frame:

ESP32 Wroom

@ Homeadar
I quess you have checked your board layout, cabling and so on double and triple as I did when setting this up.
I ended up in the need of setting bit_rate to 50kpbs because my Stiebel Eltron HSBC 200 had two CAN but interfaces. One directly connected to the heat pump and the other connected to the FET and my ESP32.
With the 20kbps I also didn’t got any responses in the logfile as you do.

welcome back
After changing bitrate to 50 kbps and GPIO15 I have results



[20:04:00][D][main:848]: Antwort von 180 Float: 0.000000
[20:04:00][D][main:849]: Antwort von 180 Dez.: 0 0
[20:04:00][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:00][D][canbus:070]: received can message (#1) std can_id=0x201 size=7
[20:04:01][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:01][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:04:01][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:04:01][D][main:848]: Antwort von 180 Float: 85.000000
[20:04:01][D][main:849]: Antwort von 180 Dez.: 0 85
[20:04:04][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:04][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:04:04][D][main:847]: Antwort von 180 Hex: 22 0 c 0 ae 0 0
[20:04:04][D][main:848]: Antwort von 180 Float: 0.000000
[20:04:04][D][main:849]: Antwort von 180 Dez.: 0 0
[20:04:05][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:05][D][canbus:070]: received can message (#2) std can_id=0x201 size=7
[20:04:06][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:06][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:04:06][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:04:06][D][main:848]: Antwort von 180 Float: 85.000000
[20:04:06][D][main:849]: Antwort von 180 Dez.: 0 85
[20:04:08][D][canbus:070]: received can message (#1) std can_id=0x500 size=7
[20:04:08][D][canbus:070]: received can message (#2) std can_id=0x700 size=7
[20:04:09][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:09][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:04:10][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:10][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:04:14][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:14][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:04:15][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:15][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:04:17][D][canbus:070]: received can message (#1) std can_id=0x500 size=7
[20:04:17][D][canbus:070]: received can message (#2) std can_id=0x700 size=7
[20:04:19][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:19][D][canbus:070]: received can message (#1) std can_id=0x601 size=7
[20:04:19][D][canbus:070]: received can message (#1) std can_id=0x480 size=7
[20:04:20][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:20][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:04:21][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:21][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:04:21][D][main:847]: Antwort von 180 Hex: 22 0 c 0 af 0 0
[20:04:21][D][main:848]: Antwort von 180 Float: 0.000000
[20:04:21][D][main:849]: Antwort von 180 Dez.: 0 0
[20:04:22][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:22][D][canbus:070]: received can message (#2) std can_id=0x201 size=7
[20:04:22][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:22][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:04:22][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:04:23][D][main:848]: Antwort von 180 Float: 85.000000
[20:04:23][D][main:849]: Antwort von 180 Dez.: 0 85
[20:04:24][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:24][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:04:24][D][main:847]: Antwort von 180 Hex: 22 0 c 0 af 0 0
[20:04:24][D][main:848]: Antwort von 180 Float: 0.000000
[20:04:24][D][main:849]: Antwort von 180 Dez.: 0 0
[20:04:25][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:25][D][canbus:070]: received can message (#2) std can_id=0x201 size=7
[20:04:26][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:26][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:04:26][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:04:26][D][main:848]: Antwort von 180 Float: 85.000000
[20:04:26][D][main:849]: Antwort von 180 Dez.: 0 85
[20:04:27][D][canbus:070]: received can message (#1) std can_id=0x500 size=7
[20:04:27][D][canbus:070]: received can message (#2) std can_id=0x700 size=7
[20:04:29][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:29][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:04:30][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:30][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:04:33][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:33][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:04:34][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:34][D][canbus:070]: received can message (#1) std can_id=0x602 size=7
[20:04:36][D][canbus:070]: received can message (#1) std can_id=0x480 size=7
[20:04:36][D][canbus:070]: received can message (#1) std can_id=0x480 size=7
[20:04:36][D][canbus:070]: received can message (#2) std can_id=0x480 size=7
[20:04:36][D][canbus:070]: received can message (#3) std can_id=0x480 size=7
[20:04:36][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:38][D][canbus:070]: received can message (#1) std can_id=0x500 size=7
[20:04:38][D][canbus:070]: received can message (#2) std can_id=0x700 size=7
[20:04:39][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:39][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:04:40][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:40][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:04:41][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:41][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:04:41][D][main:847]: Antwort von 180 Hex: 22 0 c 0 af 0 0
[20:04:41][D][main:848]: Antwort von 180 Float: 0.000000
[20:04:41][D][main:849]: Antwort von 180 Dez.: 0 0
[20:04:42][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:42][D][canbus:070]: received can message (#2) std can_id=0x201 size=7
[20:04:43][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:43][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:04:43][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:04:43][D][main:848]: Antwort von 180 Float: 85.000000
[20:04:43][D][main:849]: Antwort von 180 Dez.: 0 85
[20:04:44][D][canbus:070]: received can message (#1) std can_id=0x480 size=7
[20:04:45][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:45][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:04:45][D][main:847]: Antwort von 180 Hex: 22 0 c 0 af 0 0
[20:04:45][D][main:848]: Antwort von 180 Float: 0.000000
[20:04:45][D][main:849]: Antwort von 180 Dez.: 0 0
[20:04:45][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:45][D][canbus:070]: received can message (#2) std can_id=0x201 size=7
[20:04:46][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:46][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:04:46][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:04:46][D][main:848]: Antwort von 180 Float: 85.000000
[20:04:46][D][main:849]: Antwort von 180 Dez.: 0 85
[20:04:49][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:49][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:04:50][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:50][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:04:50][D][canbus:070]: received can message (#1) std can_id=0x500 size=7
[20:04:50][D][canbus:070]: received can message (#2) std can_id=0x700 size=7
[20:04:54][I][ota:113]: Boot seems successful, resetting boot loop counter.
[20:04:54][D][esp32.preferences:114]: Saving 1 preferences to flash...
[20:04:54][D][esp32.preferences:143]: Saving 1 preferences to flash: 0 cached, 1 written, 0 failed
[20:04:55][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:55][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:04:56][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:56][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:04:59][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:04:59][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:04:59][D][main:847]: Antwort von 180 Hex: 22 0 c 0 af 0 0
[20:04:59][D][main:848]: Antwort von 180 Float: 0.000000
[20:04:59][D][main:849]: Antwort von 180 Dez.: 0 0
[20:05:00][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:00][D][canbus:070]: received can message (#2) std can_id=0x201 size=7
[20:05:00][D][canbus:070]: received can message (#1) std can_id=0x500 size=7
[20:05:00][D][canbus:070]: received can message (#2) std can_id=0x700 size=7
[20:05:01][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:01][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:05:01][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:05:01][D][main:848]: Antwort von 180 Float: 85.000000
[20:05:01][D][main:849]: Antwort von 180 Dez.: 0 85
[20:05:04][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:04][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:05:04][D][main:847]: Antwort von 180 Hex: 22 0 c 0 af 0 0
[20:05:04][D][main:848]: Antwort von 180 Float: 0.000000
[20:05:04][D][main:849]: Antwort von 180 Dez.: 0 0
[20:05:05][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:05][D][canbus:070]: received can message (#2) std can_id=0x201 size=7
[20:05:06][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:06][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:05:06][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:05:06][D][main:848]: Antwort von 180 Float: 85.000000
[20:05:06][D][main:849]: Antwort von 180 Dez.: 0 85
[20:05:09][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:09][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:05:09][D][main:847]: Antwort von 180 Hex: 22 0 c 0 af 0 0
[20:05:09][D][main:848]: Antwort von 180 Float: 0.000000
[20:05:09][D][main:849]: Antwort von 180 Dez.: 0 0
[20:05:09][D][canbus:070]: received can message (#1) std can_id=0x480 size=7
[20:05:09][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:09][D][canbus:070]: received can message (#2) std can_id=0x201 size=7
[20:05:10][D][canbus:070]: received can message (#1) std can_id=0x500 size=7
[20:05:10][D][canbus:070]: received can message (#2) std can_id=0x700 size=7
[20:05:10][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:10][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:05:10][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:05:10][D][main:848]: Antwort von 180 Float: 85.000000
[20:05:10][D][main:849]: Antwort von 180 Dez.: 0 85
[20:05:11][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:11][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:05:12][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:12][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:05:14][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:14][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:05:15][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:15][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:05:19][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:19][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:05:19][D][main:847]: Antwort von 180 Hex: 22 0 c 0 af 0 0
[20:05:19][D][main:848]: Antwort von 180 Float: 0.000000
[20:05:19][D][main:849]: Antwort von 180 Dez.: 0 0
[20:05:20][D][canbus:070]: received can message (#1) std can_id=0x500 size=7
[20:05:20][D][canbus:070]: received can message (#2) std can_id=0x100 size=7
[20:05:20][D][canbus:070]: received can message (#3) std can_id=0x201 size=7
[20:05:20][D][canbus:070]: received can message (#4) std can_id=0x700 size=7
[20:05:21][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:21][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:05:21][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:05:21][D][main:848]: Antwort von 180 Float: 85.000000
[20:05:21][D][main:849]: Antwort von 180 Dez.: 0 85
[20:05:25][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:25][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:05:25][D][main:847]: Antwort von 180 Hex: 22 0 c 0 af 0 0
[20:05:25][D][main:848]: Antwort von 180 Float: 0.000000
[20:05:25][D][main:849]: Antwort von 180 Dez.: 0 0
[20:05:26][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:26][D][canbus:070]: received can message (#2) std can_id=0x201 size=7
[20:05:27][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:27][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:05:27][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:05:27][D][main:848]: Antwort von 180 Float: 85.000000
[20:05:27][D][main:849]: Antwort von 180 Dez.: 0 85
[20:05:30][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:30][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:05:30][D][canbus:070]: received can message (#1) std can_id=0x500 size=7
[20:05:30][D][canbus:070]: received can message (#2) std can_id=0x700 size=7
[20:05:30][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:30][D][canbus:070]: received can message (#1) std can_id=0x602 size=7
[20:05:34][D][canbus:070]: received can message (#1) std can_id=0x480 size=7
[20:05:35][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:35][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:05:35][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:35][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:05:36][D][canbus:070]: received can message (#1) std can_id=0x480 size=7
[20:05:36][D][canbus:070]: received can message (#1) std can_id=0x480 size=7
[20:05:36][D][canbus:070]: received can message (#2) std can_id=0x480 size=7
[20:05:36][D][canbus:070]: received can message (#3) std can_id=0x480 size=7
[20:05:36][D][canbus:070]: received can message (#4) std can_id=0x480 size=7
[20:05:36][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:40][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:40][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:05:40][D][main:847]: Antwort von 180 Hex: 22 0 c 0 ae 0 0
[20:05:40][D][main:848]: Antwort von 180 Float: 0.000000
[20:05:40][D][main:849]: Antwort von 180 Dez.: 0 0
[20:05:40][D][canbus:070]: received can message (#1) std can_id=0x500 size=7
[20:05:40][D][canbus:070]: received can message (#2) std can_id=0x700 size=7
[20:05:41][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:41][D][canbus:070]: received can message (#2) std can_id=0x201 size=7
[20:05:41][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:41][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:05:41][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:05:41][D][main:848]: Antwort von 180 Float: 85.000000
[20:05:41][D][main:849]: Antwort von 180 Dez.: 0 85
[20:05:44][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:44][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:05:44][D][main:847]: Antwort von 180 Hex: 22 0 c 0 af 0 0
[20:05:44][D][main:848]: Antwort von 180 Float: 0.000000
[20:05:44][D][main:849]: Antwort von 180 Dez.: 0 0
[20:05:45][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:45][D][canbus:070]: received can message (#2) std can_id=0x201 size=7
[20:05:46][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:46][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:05:46][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:05:46][D][main:848]: Antwort von 180 Float: 85.000000
[20:05:46][D][main:849]: Antwort von 180 Dez.: 0 85
[20:05:49][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:49][D][canbus:070]: received can message (#1) std can_id=0x601 size=7
[20:05:50][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:50][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:05:50][D][canbus:070]: received can message (#1) std can_id=0x500 size=7
[20:05:50][D][canbus:070]: received can message (#2) std can_id=0x700 size=7
[20:05:54][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:54][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:05:55][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:55][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:05:59][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:05:59][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:05:59][D][canbus:070]: received can message (#1) std can_id=0x480 size=7
[20:06:00][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:00][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:06:00][D][canbus:070]: received can message (#1) std can_id=0x500 size=7
[20:06:00][D][canbus:070]: received can message (#2) std can_id=0x700 size=7
[20:06:00][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:00][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:00][D][main:811]: waermemertrag_electr_ww_tag_wh_float received over can is 32.768002
[20:06:00][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 22 80 0
[20:06:00][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:00][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:01][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:01][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:06:01][D][main:847]: Antwort von 180 Hex: 22 0 c 0 ae 0 0
[20:06:01][D][main:848]: Antwort von 180 Float: 0.000000
[20:06:01][D][main:849]: Antwort von 180 Dez.: 0 0
[20:06:01][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:01][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:01][D][main:779]: waermemertrag_electr_ww_tag_kwh received over can is 32768.000000
[20:06:01][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 23 80 0
[20:06:01][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:01][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:01][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:01][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:01][D][main:815]: waermemertrag_electr_heiz_tag_wh_float received over can is 32.768002
[20:06:01][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 26 80 0
[20:06:01][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:01][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:01][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:01][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:01][D][main:783]: waermemertrag_electr_heiz_tag_kwh received over can is 32768.000000
[20:06:01][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 27 80 0
[20:06:01][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:01][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:01][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:01][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:01][D][main:819]: waermemertrag_ww_tag_wh_float received over can is 32.768002
[20:06:01][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 2a 80 0
[20:06:01][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:01][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:01][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:01][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:02][D][main:787]: waermemertrag_ww_tag_kwh received over can is 32768.000000
[20:06:02][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 2b 80 0
[20:06:02][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:02][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:02][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:02][D][canbus:070]: received can message (#2) std can_id=0x201 size=7
[20:06:02][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:02][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:02][D][main:823]: waermemertrag_ww_total_kWh_float received over can is 32.768002
[20:06:02][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 2c 80 0
[20:06:02][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:02][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:02][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:02][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:02][D][main:791]: waermemertrag_ww_total_mWh received over can is 32768.000000
[20:06:02][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 2d 80 0
[20:06:02][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:02][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:02][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:02][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:02][D][main:827]: waermemertrag_heiz_tag_wh_float received over can is 32.768002
[20:06:02][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 2e 80 0
[20:06:02][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:02][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:02][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:02][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:02][D][main:795]: waermemertrag_heiz_tag_kwh received over can is 32768.000000
[20:06:02][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 2f 80 0
[20:06:02][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:02][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:03][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:03][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:03][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:06:03][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:06:03][D][main:848]: Antwort von 180 Float: 85.000000
[20:06:03][D][main:849]: Antwort von 180 Dez.: 0 85
[20:06:03][D][canbus:070]: received can message (#3) std can_id=0x180 size=7
[20:06:03][D][main:831]: waermemertrag_heiz_total_kWh_float received over can is 32.768002
[20:06:03][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 30 80 0
[20:06:03][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:03][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:03][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:03][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:03][D][main:799]: waermemertrag_heiz_total_kWh_float received over can is 32768.000000
[20:06:03][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 31 80 0
[20:06:03][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:03][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:04][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:04][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:06:04][D][main:847]: Antwort von 180 Hex: 22 0 c 0 ae 0 0
[20:06:04][D][main:848]: Antwort von 180 Float: 0.000000
[20:06:04][D][main:849]: Antwort von 180 Dez.: 0 0
[20:06:05][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:05][D][canbus:070]: received can message (#2) std can_id=0x201 size=7
[20:06:06][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:06][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:06:06][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:06:06][D][main:848]: Antwort von 180 Float: 85.000000
[20:06:06][D][main:849]: Antwort von 180 Dez.: 0 85
[20:06:09][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:09][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:06:10][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:10][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:06:10][D][canbus:070]: received can message (#1) std can_id=0x500 size=7
[20:06:10][D][canbus:070]: received can message (#2) std can_id=0x700 size=7
[20:06:13][D][sensor:094]: 'WM elektr. Warmwasser total': Sending state 32800.76953 kWh with 3 decimals of accuracy
[20:06:13][D][sensor:094]: 'WM elektr. heizen total': Sending state 32800.76953 kWh with 3 decimals of accuracy
[20:06:13][D][sensor:094]: 'WM Warmwasser total': Sending state 32800.76953 MWh with 3 decimals of accuracy
[20:06:13][D][sensor:094]: 'WM Heizen total': Sending state 32800.76953 MWh with 3 decimals of accuracy
[20:06:13][D][sensor:094]: 'WM Heizung heute': Sending state 32800.76953 kWh with 3 decimals of accuracy
[20:06:13][D][sensor:094]: 'WM Warmwasser heute': Sending state 32800.76953 kWh with 3 decimals of accuracy
[20:06:13][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:13][W][component:204]: Component time took a long time for an operation (0.05 s).
[20:06:13][W][component:205]: Components should block for at most 20-30ms.
[20:06:13][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:13][D][main:724]: el_aufnahmeleistung_ww_tag_kwh received over can is 32.768002
[20:06:13][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 1a 80 0
[20:06:13][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:13][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:13][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:13][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:13][D][main:755]: el_aufnahmeleistung_ww_tag_kwh received over can is 32768.000000
[20:06:13][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 1b 80 0
[20:06:13][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:13][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:13][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:13][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:13][D][main:732]: el_aufnahmeleistung_ww_total_kkWh received over can is 32.768002
[20:06:13][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 1c 80 0
[20:06:13][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:13][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:13][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:13][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:13][D][main:763]: el_aufnahmeleistung_ww_total_mWh received over can is 32768.000000
[20:06:13][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 1d 80 0
[20:06:13][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:13][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:14][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:14][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:14][D][main:728]: el_aufnahmeleistung_heiz_tag_wh received over can is 32.768002
[20:06:14][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 1e 80 0
[20:06:14][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:14][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:14][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:14][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:14][D][main:759]: el_aufnahmeleistung_heiz_tag_kwh received over can is 32768.000000
[20:06:14][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 1f 80 0
[20:06:14][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:14][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:14][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:14][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:14][D][main:736]: el_aufnahmeleistung_heiz_total_kWh received over can is 32.768002
[20:06:14][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 20 80 0
[20:06:14][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:14][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:14][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:14][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:14][D][main:767]: el_aufnahmeleistung_heiz_total_mWh received over can is 32768.000000
[20:06:14][D][main:847]: Antwort von 180 Hex: d2 0 fa 9 21 80 0
[20:06:14][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:14][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:15][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:15][D][canbus:070]: received can message (#2) std can_id=0x601 size=7
[20:06:16][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:16][D][canbus:070]: received can message (#2) std can_id=0x602 size=7
[20:06:19][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:19][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:06:19][D][main:847]: Antwort von 180 Hex: 22 0 c 0 af 0 0
[20:06:19][D][main:848]: Antwort von 180 Float: 0.000000
[20:06:19][D][main:849]: Antwort von 180 Dez.: 0 0
[20:06:20][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:20][D][canbus:070]: received can message (#2) std can_id=0x201 size=7
[20:06:20][D][canbus:070]: received can message (#1) std can_id=0x500 size=7
[20:06:20][D][canbus:070]: received can message (#2) std can_id=0x700 size=7
[20:06:21][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:21][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:21][D][main:847]: Antwort von 180 Hex: 22 0 fa 4f 46 0 55
[20:06:21][D][main:848]: Antwort von 180 Float: 85.000000
[20:06:21][D][main:849]: Antwort von 180 Dez.: 0 85
[20:06:24][D][canbus:070]: received can message (#1) std can_id=0x100 size=7
[20:06:24][D][canbus:070]: received can message (#2) std can_id=0x180 size=7
[20:06:24][D][main:847]: Antwort von 180 Hex: 22 0 c 0 ae 0 0
[20:06:24][D][main:848]: Antwort von 180 Float: 0.000000
[20:06:24][D][main:849]: Antwort von 180 Dez.: 0 0
[20:06:24][D][canbus:070]: received can message (#1) std can_id=0x480 size=7
[20:06:24][D][sensor:094]: 'Stromverbrauch Warmwasser total': Sending state 32800.76953 MWh with 3 decimals of accuracy
[20:06:24][D][sensor:094]: 'Stromverbrauch Heizung total': Sending state 32800.76953 MWh with 3 decimals of accuracy
[20:06:24][D][sensor:094]: 'Stromverbrauch Warmwasser heute': Sending state 32800.76953 kWh with 3 decimals of accuracy
[20:06:24][D][sensor:094]: 'Stromverbrauch Heizung heute': Sending state 32800.76953 kWh with 3 decimals of accuracy
[20:06:24][D][main:574]: EVU Sperre requested
[20:06:24][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:24][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:24][D][sensor:094]: 'Außentemperatur': Sending state 17.40000 °C with 1 decimals of accuracy
[20:06:24][D][main:692]: Temperature received over can is 17.400000
[20:06:24][D][main:847]: Antwort von 180 Hex: d2 0 fa 0 c 0 ae
[20:06:24][D][main:848]: Antwort von 180 Float: 174.000000
[20:06:24][D][main:849]: Antwort von 180 Dez.: 0 174
[20:06:24][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:24][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:25][D][sensor:094]: 'Vorlauftemperatur Heizung': Sending state 32.76800 °C with 1 decimals of accuracy
[20:06:25][D][main:662]: Temperature received over can is 32.768002
[20:06:25][D][main:847]: Antwort von 180 Hex: d2 0 fa 0 d 80 0
[20:06:25][D][main:848]: Antwort von 180 Float: 32768.000000
[20:06:25][D][main:849]: Antwort von 180 Dez.: 128 0
[20:06:25][D][canbus:033]: send standard id=0x680 rtr=FALSE size=7
[20:06:25][D][canbus:070]: received can message (#1) std can_id=0x180 size=7
[20:06:25][D][sensor:094]: 'Heizkreis Vorlauf': Sending state 0.19600 °C with 1 decimals of accuracy
[20:06:25][D][main:672]: Temperature received over can is 0.196000
[20:06:25][D][main:847]: Antwort von 180 Hex: d2 0 fa 0 f 0 c4
[20:06:25][D][main:848]: Antwort von 180 Float: 196.000000
[20:06:25][D][main:849]: Antwort von 180 Dez.: 0 196


I am asking for interpretations if they are ok and what next

HPA-O 8 CS Plus pump

Hello everyone.
I tested the BartekTK code
Everything works for me except “confort tank target temp.”, “eco storage target temp.”,“return temperature heat”, and “source temperature” it is -3276.8 everywhere and does not change.
Please advise how to improve it.
cs8 pump + hm trend.
Thank you in advance for any help.

Hello
please let me know why the 3rd digit is 1 and not zero 0xa1, 0x14

What did you do to get it working?

http://juerg5524.ch/data/Telegramm-Aufbau.txt
Use deepl for translation for example :wink:

Thanks @tomcat! This helped a lot.
Although not ESPHome, I’d like to share my current working solution using a Python script via AppDaemon:

# **************************************************************************************
# CANBUS-Processor for Stiebel Eltron LWZ heatpump                                                                 *
# **************************************************************************************
# This program establishes a TCP socket with a CANBUS-Wifi gateway (ECAN-W01S) connected
# to a Stiebel Eltron LWZ5CS Premium heatpump. It continuously reads CANBUS frames
# and regularly requests values. The frames are analyzed and values are written to
# sensor values.
#
# The incoming frames are 13 bytes in length composed of (left to right):
# byte 1:       payload length (usually 07 -> 7 bytes of data)
# byte 2-5:     sender CAN ID (in reverse order: 30 01 00 00 - > 0x103)
# byte 6-7:     receiver CAN ID (see below)
# byte 8:       usually 0xfa
# byte 9-10:    value index (see https://juerg5524.ch/list_data.php -> ElsterTable.inc)
# byte 11-12:   value
# byte 13:      filler 0x00
#
# CAN-ID conversion:
#   6    1    0    1
#   ^    ^         ^
#   |    1: read   |
#   |    2: write  |
#   |              |
#   0x60 * 8     + 1 = 0x301
#
# Stiebel Eltron LWZ CAN ID's
#   Local display   0x69e:  sender ID = 9e06 destination ID = d11e/d21e
#   FES display     0x69f:  sender ID = 9f06 destination ID = d11f/d21f
#   Heatpump 1      0x180:  sender ID = 8001 destination ID = 3100/3200
#   Heatpump 2      0x301:  sender ID = 0103 destination ID = 6101/6201
#   HomeAssistant   0x6a2:  sender ID = a206 destination ID = d122/d222
#
# Example:
#  07 8001 0000 d21e fa 000e 0200 00
#   07:   7 bytes in payload
#   8001: 0x180 as source CAN ID
#   0000: filler
#   d21e: convert to 0x69e as CAN ID with 2 as write indicator
#   fa:   always there?
#   000e: value index for boiler temperature
#   0200: value for temperature -> 512 in decimal equals to 51.2 degrees
#   00:   filler


import appdaemon.plugins.hass.hassapi as hass
import socket
import time
from datetime import datetime
import asyncio

class CANBusDataProcessor(hass.Hass):

    async def initialize(self):
        self.data_buffer = ""  # Initialize an empty data buffer as a string
        self.tcp_host = "192.168.178.201"  # CANBUS source IP address
        self.tcp_port = 8881  # CANBUS source port
        self.tcp_socket = None
        self.process_interval = 30

        # Define a parameter mapping dictionary (ElsterTable.inc)
        self.parameter_mapping = {
            '0001': 'fehlermeldung',
            '0004': 'heizkreistemperatur_soll',
            '000c': 'aussentemperatur',
            '000e': 'speichertemperatur',
            '000f': 'heizkreistemperatur_ist',
            '0011': 'raumtemperatur',
            '0014': 'verdampfertemperatur',
            '0075': 'raumfeuchte',
            '001a': 'kollektortemperatur',
            '0112': 'programm',
            '0121': 'wochentag',
            '0122': 'tag',
            '0123': 'monat',
            '0124': 'jahr',
            '0125': 'stunde',
            '0126': 'minute',
            '0176': 'betriebsstatus',
            '019a': 'softwareversion',
            '0596': 'zuluft_soll',
            '0597': 'zuluft_ist',
            '0598': 'abluft_soll',
            '0599': 'abluft_ist',
            '059c': 'verfluessigertemperatur',
            '069e': 'motordrehzahl',
            '06a0': 'motorleistung',
            '0693': 'oelsumpftemperatur',
            '091a': 'elekt_energie_ww_tag_wh',
            '091b': 'elekt_energie_ww_tag_kwh',
            '091c': 'elekt_energie_ww_summe_kwh',
            '091d': 'elekt_energie_ww_summe_mwh',
            '091e': 'elekt_energie_heizen_tag_wh',
            '091f': 'elekt_energie_heizen_tag_kwh',
            '0920': 'elekt_energie_heizen_summe_kwh',
            '0921': 'elekt_energie_heizen_summe_mwh',
            '092a': 'therm_energie_ww_tag_wh',
            '092b': 'therm_energie_ww_tag_kwh',
            '092c': 'therm_energie_ww_summe_kwh',
            '092d': 'therm_energie_ww_summe_mwh',
            '092e': 'therm_energie_heizen_tag_wh',
            '092f': 'therm_energie_heizen_tag_kwh',
            '0930': 'therm_energie_heizen_summe_kwh',
            '0931': 'therm_energie_heizen_summe_mwh',
            'c0ee': 'heiz_kuehlleistung',
            'c355': 'solar_status'
        }
        # CANBUS request frames
        self.data_to_send = [
            b'\x07\xa2\x06\x00\x00\x61\x01\xfa\x00\x04\x00\x00\x00', #HK_temperatur_soll
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x05\x97\x00\x00\x00', #zuluft_ist
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x05\x99\x00\x00\x00', #abluft_ist
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x06\x9e\x00\x00\x00', #motordrehzahl
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x06\xa0\x00\x00\x00', #motorleistung
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\xc0\xee\x00\x00\x00', #heiz_kuehlleistung
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x00\x14\x00\x00\x00', #verdampfertemperatur
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x05\x9c\x00\x00\x00', #verfluessigertemperatur
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x09\x1a\x00\x00\x00', #elekt_energie_ww_tag_wh
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x09\x1b\x00\x00\x00', #elekt_energie_ww_tag_kwh
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x09\x1c\x00\x00\x00', #elekt_energie_ww_summe_kwh
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x09\x1d\x00\x00\x00', #elekt_energie_ww_summe_mwh
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x09\x1e\x00\x00\x00', #elekt_energie_heizen_tag_wh
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x09\x1f\x00\x00\x00', #elekt_energie_heizen_tag_kwh
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x09\x20\x00\x00\x00', #elekt_energie_heizen_summe_kwh
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x09\x21\x00\x00\x00', #elekt_energie_heizen_summe_mwh
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x09\x2a\x00\x00\x00', #therm_energie_ww_tag_wh
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x09\x2b\x00\x00\x00', #therm_energie_ww_tag_kwh
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x09\x2e\x00\x00\x00', #therm_energie_heizen_tag_wh
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\x09\x2f\x00\x00\x00', #therm_energie_heizen_tag_kwh
            b'\x07\xa2\x06\x00\x00\x31\x00\xfa\xc3\x55\x00\x00\x00'  #solar_status
        ]

        await self.run_every(self.send_data, datetime.now(), self.process_interval)
        await self.main()


    async def connect_to_tcp(self):
        try:
            self.tcp_socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
            self.tcp_socket.settimeout(30)
            self.tcp_socket.connect((self.tcp_host, self.tcp_port))
            self.log("Connected to CANBUS source.")
        except Exception as e:
            self.log(f"TCP connection error: {e}")

    async def process_data(self):
        data_buffer = ""
        # Receive data from the TCP connection
        data = self.tcp_socket.recv(1024)
        if data:
            # Append received data to the buffer
            data_buffer += data.hex()
            # Extract 26-character segment from the buffer
            while len(data_buffer) >= 26:
                segment = data_buffer[:26]
                self.log(f'Extracted CAN frame: {segment[0:2]} {segment[2:6]} {segment[6:10]} {segment[10:14]} {segment[14:16]} {segment[16:20]} {segment[20:24]} {segment[24:26]}')
                # Remove the processed data from the buffer
                data_buffer = data_buffer[26:]

                # Extract data from segment
                source = segment[2:6]
                destination = segment[10:14]
                id_hex = segment[16:20]
                value_hex = segment[20:24]

                if source == "0103" or source == "8001":
                    # Look up the parameter name in the mapping
                    parameter_name = self.parameter_mapping.get(id_hex, "unknown_parameter")

                    # Construct sensor names and set their states
                    sensor_name = f'sensor.{parameter_name}_can_value'

                    if parameter_name == "unknown_parameter":
                        await self.set_state('sensor.unknown_parameter_id', state=id_hex)
                        self.log(f'Set value {value_hex} for {sensor_name}')

                    await self.set_state(sensor_name, state=value_hex)
        else:
            self.tcp_socket.close()
            self.log("No data. Closing TCP socket")

    async def send_data(self,kwargs):
        try:
            # Send the data over the existing TCP socket
            for frame in self.data_to_send:
                self.tcp_socket.send(frame)
                time.sleep(0.1)
        except Exception as e:
            self.log(f"Error sending data: {e}")

    async def main(self):
        self.log("Launching CANBUS reader ...")
        while True:
            self.log("Connecting to TCP socket ...")
            await self.connect_to_tcp()
            while self.tcp_socket:
                await self.process_data()
            self.log("TCP socket closed.")

    def terminate(self):
        self.tcp_socket.close()
        self.log("Terminate. TCP socket closed.")

There’s still a lot of optimizations to be made especially when the connection drops or invaild frames are sent.

Hi everybody,
i come across this nice documentation and as i have also a Stiebel Eltron WP i would like to rebuild it.
But i have a question related the wiring. The documentation from here: CAN bus — ESPHome and the pictures there confuses me a little bit when i combare it with the pictures from robrreiter.

What is the red marked part?

Does somebody has this wiring plan?

And another question is on my end related this plan:

Is the left part the ESP Wroom 32 board?
Because my one looks different

It converts the voltage to the right level of the esp32. I guess it takes the power from the heatpump itself…just use a 5V USB Power supply…

1 Like

its a D1 mini with an esp8266…just look at the ports…

1 Like

Hello,
I found something interesting for person who have pump with WPM4 module and FET device. My FET(can ID 401) send temperature inside room at 0x4ec7 address, and humidity at 0x4ec8 address. I use @bullitt186 code and add two lines in ElsterTable.h see below:

  { "TEMPERATURE_FET"                                   , 0x4ec7, et_dec_val}, //added
  { "HUMIDITY_FET"                                      , 0x4ec8, et_dec_val},

and add catch information sended by FET

    - can_id: 0x401
      then:
        - lambda: |-
            unsigned short canId = 401;
            std::string value;
            const ElsterIndex* ei = processCanMessage(canId, value, x);

            if(ei->Name == "HUMIDITY_FET") {
              id(humidity).publish_state(std::stof(value));
              return;
            }
            if(ei->Name == "TEMPERATURE_FET") {
              id(tempInside).publish_state(std::stof(value));
              return;
            }

off course you need add sensor etc.

1 Like