Fabian-Schmidt / esphome-truma_inetbox

ESPHome component to remote control Truma CP Plus Heater
GNU General Public License v3.0
37 stars 7 forks source link

Truma & Victron on one ESP? #2

Closed snipah closed 1 year ago

snipah commented 1 year ago

Hi Fabian,

Just switched from inetbox2mqtt to your implementation because I prefer the hassle free config/update-procedure via Wireguard from everywhere! Everything is working as expected! Thanks for your great work!

I understood, that I might be able to run your Truma and Victon-Implmentation on one ESP! I currently have https://github.com/KinDR007/VictronMPPT-ESPHOME running on a separate 8266 for a Shunt and Smart Solar. Can I run the victrun-stuff to the same ESP your Truma-implementation is running on?

I expanded my Truma.yaml-file with the Victron-config. Truma is working initially but does the ESP even connect to the Victron-devices via BLE? Not sure... and then everything crashes... see log below.

Is it due to memory constraints? Am I doing something wrong?

name: "esphome-truma"

ota:

api:

external_components:
  - source: github://Fabian-Schmidt/esphome-truma_inetbox
  - source: github://Fabian-Schmidt/esphome-victron_ble

logger:
  level: DEBUG

esp32:
  board: esp32dev
  framework:
    type: arduino

esp32_ble_tracker:

victron_ble:
  - id: MySmartShunt
    mac_address: "E7:B0:D9:6d:62:03"    
    bindkey: "e289af4fb6c8ed333494297acc0bb637"
  - id: MySmartSolar
    mac_address: "58:10:C2:BD:7D:05"
    bindkey: "3af563e56794c0fb9198f541af2f08a9"

uart:
  - id: lin_uart_bus
    tx_pin: 17
    rx_pin: 16
    baud_rate: 9600
    data_bits: 8
    parity: NONE
    stop_bits: 2

truma_inetbox:
  uart_id: lin_uart_bus

binary_sensor:
  - platform: truma_inetbox
    name: "CP Plus alive"
    type: CP_PLUS_CONNECTED
  - platform: truma_inetbox
    name: "Room Heater active"
    type: HEATER_ROOM
    id: HEATER_ROOM
  - platform: truma_inetbox
    name: "Water Heater active"
    type: HEATER_WATER
    id: HEATER_WATER
  - platform: truma_inetbox
    name: "Timer active"
    type: TIMER_ACTIVE
    id: TIMER_ACTIVE
  - platform: truma_inetbox
    name: "Timer Room Heater active"
    type: TIMER_ROOM
  - platform: truma_inetbox
    name: "Timer Water Heater active"
    type: TIMER_WATER
  - platform: victron_ble
    victron_ble_id: MySmartShunt
    name: "Battery has Alarm"
    type: ALARM
  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "MPPT is in Fault state"
    type: DEVICE_STATE_FAULT
  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "MPPT has Error"
    type: CHARGER_ERROR

climate:
  - platform: truma_inetbox
    name: "Truma Room"
    type: ROOM
  - platform: truma_inetbox
    name: "Truma Water"
    type: WATER

number:
  - platform: truma_inetbox
    name: "Target Room Temperature"
    type: TARGET_ROOM_TEMPERATURE
  - platform: truma_inetbox
    name: "Target Water Temperature"
    type: TARGET_WATER_TEMPERATURE

sensor:
  - platform: truma_inetbox
    name: "Current Room Temperature"
    type: CURRENT_ROOM_TEMPERATURE
  - platform: truma_inetbox
    name: "Current Water Temperature"
    type: CURRENT_WATER_TEMPERATURE
  - platform: truma_inetbox
    name: "Target Room Temperature"
    type: TARGET_ROOM_TEMPERATURE
  - platform: truma_inetbox
    name: "Target Water Temperature"
    type: TARGET_WATER_TEMPERATURE
  - platform: truma_inetbox
    name: "Operating status"
    type: OPERATING_STATUS
  # MySmartShunt
  - platform: victron_ble
    victron_ble_id: MySmartShunt
    name: "Time remaining"
    type: TIME_TO_GO
  - platform: victron_ble
    victron_ble_id: MySmartShunt
    name: "Battery voltage"
    type: BATTERY_VOLTAGE
  - platform: victron_ble
    victron_ble_id: MySmartShunt
    name: "Starter Battery"
    # AUX_VOLTAGE or MID_VOLTAGE or TEMPERATURE.
    # Depending on configuration of SmartShunt.
    type: AUX_VOLTAGE
  - platform: victron_ble
    victron_ble_id: MySmartShunt
    name: "Current"
    type: BATTERY_CURRENT
  - platform: victron_ble
    victron_ble_id: MySmartShunt
    name: "Consumed Ah"
    type: CONSUMED_AH
  - platform: victron_ble
    victron_ble_id: MySmartShunt
    name: "State of charge"
    type: STATE_OF_CHARGE

  # MySmartSolar
  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Battery Voltage"
    type: BATTERY_VOLTAGE
  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Battery Current"
    type: BATTERY_CURRENT
  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Yield Today"
    type: YIELD_TODAY
  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "PV Power"
    type: PV_POWER
  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "Load Current"
    type: LOAD_CURRENT

text_sensor:
  - platform: victron_ble
    victron_ble_id: MySmartShunt
    name: "Battery Alarm reason"
    type: ALARM_REASON

  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "MPPT state"
    type: DEVICE_STATE
  - platform: victron_ble
    victron_ble_id: MySmartSolar
    name: "MPPT Error reason"
    type: CHARGER_ERROR

switch:
  - platform: template
    name: "Activate Room Heater"
    lambda: |-
      return id(HEATER_ROOM).state;
    turn_on_action:
      - truma_inetbox.heater.set_target_room_temperature:
          # You can use lambda functions
          temperature: !lambda |-
            return 16;
          # Optional set heating mode: `"OFF"`, `ECO`, `HIGH`, `BOOST`
          heating_mode: ECO
    turn_off_action:
      - truma_inetbox.heater.set_target_room_temperature:
          # Disable heater by setting temperature to `0`.
          temperature: 0
  - platform: template
    name: "Activate Water Heater"
    lambda: |-
      return id(HEATER_WATER).state;
    turn_on_action:
      - truma_inetbox.heater.set_target_water_temperature:
          # Set water temp as number: `0`, `40`, `60`, `80`
          temperature: 40
    turn_off_action:
      - truma_inetbox.heater.set_target_water_temperature:
          # Disable heater by setting temperature to `0`.
          temperature: 0
  - platform: template
    name: "Activate Water Heater (enum)"
    lambda: |-
      return id(HEATER_WATER).state;
    turn_on_action:
      - truma_inetbox.heater.set_target_water_temperature_enum:
          # Set water temp as text: `"OFF"`, `ECO`, `HIGH`, `BOOST`
          temperature: ECO
    turn_off_action:
      # You can also use the simplified syntax.
      - truma_inetbox.heater.set_target_water_temperature_enum: "OFF"
  - platform: template
    name: "Active Timer"
    lambda: |-
      return id(TIMER_ACTIVE).state;
    turn_on_action:
      - truma_inetbox.timer.activate:
          start: 7:00
          stop: 9:30
          # Required: Set room temp to a number between 5 and 30
          room_temperature: 13
          # Optional: Set heating mode: `"OFF"`, `ECO`, `HIGH`, `BOOST`
          heating_mode: ECO
          # Optional: Set water temp as number: `0`, `40`, `60`, `80`
          water_temperature: 0
          # Optional: Set energy mix to: `GAS`, `MIX`, `ELECTRICITY`
          energy_mix: GAS

    turn_off_action:
      # You can also use the simplified syntax.
      - truma_inetbox.timer.disable

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    # Set this to the IP of the ESP
    static_ip: 192.168.1.29
    # Set this to the IP address of the router. Often ends with .1
    gateway: 192.168.1.1
    # The subnet of the network. 255.255.255.0 works for most home networks.
    subnet: 255.255.255.0

and the ESP starts up fine and connects to Home Assistant but then throws and error and disconnects...

INFO Reading configuration /config/esphome/truma.yaml...
INFO Starting log output from 192.168.1.29 using esphome API
INFO Successfully connected to 192.168.1.29
[15:30:46][I][app:102]: ESPHome version 2023.2.4 compiled on Feb 26 2023, 14:38:05
[15:30:46][C][wifi:504]: WiFi:
[15:30:46][C][wifi:362]:   Local MAC: 0C:B8:15:CD:8F:F4
[15:30:46][C][wifi:363]:   SSID: '[redacted]'
[15:30:46][C][wifi:364]:   IP Address: 192.168.1.29
[15:30:46][C][wifi:366]:   BSSID: [redacted]
[15:30:46][C][wifi:367]:   Hostname: 'esphome-truma'
[15:30:46][C][wifi:369]:   Signal strength: -57 dB ▂▄▆█
[15:30:46][C][wifi:373]:   Channel: 13
[15:30:46][C][wifi:374]:   Subnet: 255.255.255.0
[15:30:46][C][wifi:375]:   Gateway: 192.168.1.1
[15:30:46][C][wifi:376]:   DNS1: 0.0.0.0
[15:30:46][C][wifi:377]:   DNS2: 0.0.0.0
[15:30:46][C][logger:293]: Logger:
[15:30:46][C][logger:294]:   Level: DEBUG
[15:30:46][C][logger:295]:   Log Baud Rate: 115200
[15:30:46][C][logger:296]:   Hardware UART: UART0
[15:30:46][C][uart.arduino_esp32:108]: UART Bus 1:
[15:30:46][C][uart.arduino_esp32:109]:   TX Pin: GPIO17
[15:30:46][C][uart.arduino_esp32:110]:   RX Pin: GPIO16
[15:30:46][C][uart.arduino_esp32:112]:   RX Buffer Size: 256
[15:30:46][C][uart.arduino_esp32:114]:   Baud Rate: 9600 baud
[15:30:46][C][uart.arduino_esp32:115]:   Data Bits: 8
[15:30:46][C][uart.arduino_esp32:116]:   Parity: NONE
[15:30:46][C][uart.arduino_esp32:117]:   Stop bits: 2
[15:30:46][C][template.switch:076]: Template Switch 'Activate Room Heater'
[15:30:46][C][template.switch:099]:   Restore Mode: restore defaults to OFF
[15:30:46][C][template.switch:060]:   Restore State: NO
[15:30:46][C][template.switch:061]:   Optimistic: NO
[15:30:46][C][template.switch:076]: Template Switch 'Activate Water Heater'
[15:30:46][C][template.switch:099]:   Restore Mode: restore defaults to OFF
[15:30:46][C][template.switch:060]:   Restore State: NO
[15:30:46][C][template.switch:061]:   Optimistic: NO
[15:30:46][C][template.switch:076]: Template Switch 'Activate Water Heater (enum)'
[15:30:46][C][template.switch:099]:   Restore Mode: restore defaults to OFF
[15:30:46][C][template.switch:060]:   Restore State: NO
[15:30:46][C][template.switch:061]:   Optimistic: NO
[15:30:46][C][template.switch:076]: Template Switch 'Active Timer'
[15:30:46][C][template.switch:099]:   Restore Mode: restore defaults to OFF
[15:30:46][C][template.switch:060]:   Restore State: NO
[15:30:46][C][template.switch:061]:   Optimistic: NO
[15:30:46][C][victron_ble:014]: Victorn BLE:
[15:30:46][C][victron_ble:015]:   Address: E7:B0:D9:6D:62:03
[15:30:46][C][victron_ble:014]: Victorn BLE:
[15:30:46][C][victron_ble:015]:   Address: 58:10:C2:BD:7D:05
[15:30:46][C][truma_inetbox.LinBusListener:031]: LinBusListener:
[15:30:46][C][truma_inetbox.LinBusListener:034]:   Update Interval: 0.5s
[15:30:46][C][truma_inetbox.LinBusListener:035]:   LIN checksum Version: 2
[15:30:46][C][truma_inetbox.LinBusListener:036]:   Observer mode: NO
[15:30:46][C][:019]: Truma CP Plus Binary Sensor
[15:30:46][C][:040]: Truma Heater Binary Sensor
[15:30:46][C][truma_inetbox.binary_sensor:041]: Type 0
[15:30:46][C][:040]: Truma Heater Binary Sensor
[15:30:46][C][truma_inetbox.binary_sensor:041]: Type 1
[15:30:46][C][:029]: Truma Timer Binary Sensor
[15:30:46][C][truma_inetbox.binary_sensor:030]: Type 6
[15:30:46][C][:029]: Truma Timer Binary Sensor
[15:30:46][C][truma_inetbox.binary_sensor:030]: Type 7
[15:30:46][C][:029]: Truma Timer Binary Sensor
[15:30:46][C][truma_inetbox.binary_sensor:030]: Type 8
[15:30:46][C][victron_ble.binary_sensor:010]: Victron Binary Sensor 'Battery has Alarm'
[15:30:46][C][victron_ble.binary_sensor:011]: Type 0
[15:30:46][C][victron_ble.binary_sensor:010]: Victron Binary Sensor 'MPPT is in Fault state'
[15:30:46][C][victron_ble.binary_sensor:011]: Type 4
[15:30:46][C][victron_ble.binary_sensor:010]: Victron Binary Sensor 'MPPT has Error'
[15:30:46][C][victron_ble.binary_sensor:011]: Type 1
[15:30:46][C][truma_inetbox.truma_room_climate:035]: Truma Room Climate
[15:30:46][C][truma_inetbox.truma_water_climate:019]: Truma Climate
[15:30:46][C][:041]: Truma Heater Number
[15:30:46][C][truma_inetbox.sensor:042]: Type 0
[15:30:46][C][:041]: Truma Heater Number
[15:30:46][C][truma_inetbox.sensor:042]: Type 1
[15:30:46][C][truma_inetbox.sensor:042]: Truma Sensor 'Current Room Temperature'
[15:30:46][C][truma_inetbox.sensor:042]:   Device Class: 'temperature'
[15:30:46][C][truma_inetbox.sensor:042]:   State Class: 'measurement'
[15:30:46][C][truma_inetbox.sensor:042]:   Unit of Measurement: '°C'
[15:30:46][C][truma_inetbox.sensor:042]:   Accuracy Decimals: 1
[15:30:46][C][truma_inetbox.sensor:042]:   Icon: 'mdi:thermometer'
[15:30:46][C][truma_inetbox.sensor:043]: Type 0
[15:30:46][C][truma_inetbox.sensor:042]: Truma Sensor 'Current Water Temperature'
[15:30:46][C][truma_inetbox.sensor:042]:   Device Class: 'temperature'
[15:30:46][C][truma_inetbox.sensor:042]:   State Class: 'measurement'
[15:30:46][C][truma_inetbox.sensor:042]:   Unit of Measurement: '°C'
[15:30:46][C][truma_inetbox.sensor:042]:   Accuracy Decimals: 1
[15:30:46][C][truma_inetbox.sensor:042]:   Icon: 'mdi:thermometer'
[15:30:46][C][truma_inetbox.sensor:043]: Type 1
[15:30:46][C][truma_inetbox.sensor:042]: Truma Sensor 'Target Room Temperature'
[15:30:46][C][truma_inetbox.sensor:042]:   Device Class: 'temperature'
[15:30:46][C][truma_inetbox.sensor:042]:   State Class: 'measurement'
[15:30:46][C][truma_inetbox.sensor:042]:   Unit of Measurement: '°C'
[15:30:46][C][truma_inetbox.sensor:042]:   Accuracy Decimals: 0
[15:30:46][C][truma_inetbox.sensor:042]:   Icon: 'mdi:thermometer'
[15:30:46][C][truma_inetbox.sensor:043]: Type 2
[15:30:46][C][truma_inetbox.sensor:042]: Truma Sensor 'Target Water Temperature'
[15:30:46][C][truma_inetbox.sensor:042]:   Device Class: 'temperature'
[15:30:46][C][truma_inetbox.sensor:042]:   State Class: 'measurement'
[15:30:46][C][truma_inetbox.sensor:042]:   Unit of Measurement: '°C'
[15:30:46][C][truma_inetbox.sensor:042]:   Accuracy Decimals: 0
[15:30:46][C][truma_inetbox.sensor:042]:   Icon: 'mdi:thermometer'
[15:30:46][C][truma_inetbox.sensor:043]: Type 3
[15:30:46][C][truma_inetbox.sensor:042]: Truma Sensor 'Operating status'
[15:30:46][C][truma_inetbox.sensor:042]:   Device Class: 'temperature'
[15:30:46][C][truma_inetbox.sensor:042]:   State Class: 'measurement'
[15:30:46][C][truma_inetbox.sensor:042]:   Unit of Measurement: ''
[15:30:46][C][truma_inetbox.sensor:042]:   Accuracy Decimals: 0
[15:30:46][C][truma_inetbox.sensor:042]:   Icon: 'mdi:power'
[15:30:46][C][truma_inetbox.sensor:043]: Type 7
[15:30:47][C][victron_ble.sensor:010]: Victron Sensor 'Time remaining'
[15:30:47][C][victron_ble.sensor:010]:   Device Class: 'duration'
[15:30:47][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:30:47][C][victron_ble.sensor:010]:   Unit of Measurement: 'min'
[15:30:47][C][victron_ble.sensor:010]:   Accuracy Decimals: 0
[15:30:47][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:30:47][C][victron_ble.sensor:011]: Type 22
[15:30:47][C][victron_ble.sensor:010]: Victron Sensor 'Battery voltage'
[15:30:47][C][victron_ble.sensor:010]:   Device Class: 'voltage'
[15:30:47][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:30:47][C][victron_ble.sensor:010]:   Unit of Measurement: 'V'
[15:30:47][C][victron_ble.sensor:010]:   Accuracy Decimals: 2
[15:30:47][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:30:47][C][victron_ble.sensor:011]: Type 9
[15:30:47][C][victron_ble.sensor:010]: Victron Sensor 'Starter Battery'
[15:30:47][C][victron_ble.sensor:010]:   Device Class: 'voltage'
[15:30:47][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:30:47][C][victron_ble.sensor:010]:   Unit of Measurement: 'V'
[15:30:47][C][victron_ble.sensor:010]:   Accuracy Decimals: 2
[15:30:47][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:30:47][C][victron_ble.sensor:011]: Type 7
[15:30:47][C][victron_ble.sensor:010]: Victron Sensor 'Current'
[15:30:47][C][victron_ble.sensor:010]:   Device Class: 'current'
[15:30:47][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:30:47][C][victron_ble.sensor:010]:   Unit of Measurement: 'A'
[15:30:47][C][victron_ble.sensor:010]:   Accuracy Decimals: 3
[15:30:47][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:30:47][C][victron_ble.sensor:011]: Type 8
[15:30:47][C][victron_ble.sensor:010]: Victron Sensor 'Consumed Ah'
[15:30:47][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:30:47][C][victron_ble.sensor:010]:   Unit of Measurement: 'Ah'
[15:30:47][C][victron_ble.sensor:010]:   Accuracy Decimals: 1
[15:30:47][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:30:47][C][victron_ble.sensor:011]: Type 11
[15:30:47][C][victron_ble.sensor:010]: Victron Sensor 'State of charge'
[15:30:47][C][victron_ble.sensor:010]:   Device Class: 'battery'
[15:30:47][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:30:47][C][victron_ble.sensor:010]:   Unit of Measurement: '%'
[15:30:47][C][victron_ble.sensor:010]:   Accuracy Decimals: 1
[15:30:47][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:30:47][C][victron_ble.sensor:011]: Type 20
[15:30:47][C][victron_ble.sensor:010]: Victron Sensor 'Battery Voltage'
[15:30:47][C][victron_ble.sensor:010]:   Device Class: 'voltage'
[15:30:47][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:30:47][C][victron_ble.sensor:010]:   Unit of Measurement: 'V'
[15:30:47][C][victron_ble.sensor:010]:   Accuracy Decimals: 2
[15:30:47][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:30:47][C][victron_ble.sensor:011]: Type 9
[15:30:47][C][victron_ble.sensor:010]: Victron Sensor 'Battery Current'
[15:30:47][C][victron_ble.sensor:010]:   Device Class: 'current'
[15:30:47][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:30:47][C][victron_ble.sensor:010]:   Unit of Measurement: 'A'
[15:30:47][C][victron_ble.sensor:010]:   Accuracy Decimals: 3
[15:30:47][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:30:47][C][victron_ble.sensor:011]: Type 8
[15:30:47][C][victron_ble.sensor:010]: Victron Sensor 'Yield Today'
[15:30:47][C][victron_ble.sensor:010]:   Device Class: 'energy'
[15:30:47][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:30:47][C][victron_ble.sensor:010]:   Unit of Measurement: 'kWh'
[15:30:47][C][victron_ble.sensor:010]:   Accuracy Decimals: 2
[15:30:47][C][victron_ble.sensor:010]:   Icon: 'mdi:power'
[15:30:47][C][victron_ble.sensor:011]: Type 23
[15:30:47][C][victron_ble.sensor:010]: Victron Sensor 'PV Power'
[15:30:47][C][victron_ble.sensor:010]:   Device Class: 'power'
[15:30:47][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:30:47][C][victron_ble.sensor:010]:   Unit of Measurement: 'W'
[15:30:47][C][victron_ble.sensor:010]:   Accuracy Decimals: 0
[15:30:47][C][victron_ble.sensor:010]:   Icon: 'mdi:power'
[15:30:47][C][victron_ble.sensor:011]: Type 19
[15:30:47][C][victron_ble.sensor:010]: Victron Sensor 'Load Current'
[15:30:47][C][victron_ble.sensor:010]:   Device Class: 'current'
[15:30:47][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:30:47][C][victron_ble.sensor:010]:   Unit of Measurement: 'A'
[15:30:47][C][victron_ble.sensor:010]:   Accuracy Decimals: 1
[15:30:47][C][victron_ble.sensor:010]:   Icon: 'mdi:power'
[15:30:47][C][victron_ble.sensor:011]: Type 15
[15:30:47][C][victron_ble.text_sensor:010]: Victron Text Sensor 'Battery Alarm reason'
[15:30:47][C][victron_ble.text_sensor:011]: Type 2
[15:30:47][C][victron_ble.text_sensor:010]: Victron Text Sensor 'MPPT state'
[15:30:47][C][victron_ble.text_sensor:011]: Type 4
[15:30:47][C][victron_ble.text_sensor:010]: Victron Text Sensor 'MPPT Error reason'
[15:30:47][C][victron_ble.text_sensor:011]: Type 3
[15:30:47][C][esp32_ble:214]: ESP32 BLE:
[15:30:47][C][esp32_ble_tracker:583]: BLE Tracker:
[15:30:47][C][esp32_ble_tracker:584]:   Scan Duration: 300 s
[15:30:47][C][esp32_ble_tracker:585]:   Scan Interval: 320.0 ms
[15:30:47][C][esp32_ble_tracker:586]:   Scan Window: 30.0 ms
[15:30:47][C][esp32_ble_tracker:587]:   Scan Type: ACTIVE
[15:30:47][C][esp32_ble_tracker:588]:   Continuous Scanning: True
[15:30:47][C][mdns:108]: mDNS:
[15:30:47][C][mdns:109]:   Hostname: esphome-truma
[15:30:47][C][ota:093]: Over-The-Air Updates:
[15:30:47][C][ota:094]:   Address: 192.168.1.29:3232
[15:30:47][W][ota:103]: Last Boot was an unhandled reset, will proceed to safe mode in 6 restarts
[15:30:47][C][api:138]: API Server:
[15:30:47][C][api:139]:   Address: 192.168.1.29:6053
[15:30:47][C][api:143]:   Using noise encryption: NO
[15:30:48][D][truma_inetbox.TrumaiNetBoxApp:442]: Requesting initial data.
[15:30:49][D][binary_sensor:036]: 'CP Plus alive': Sending state ON
[15:30:49][D][truma_inetbox.LinBusProtocol:221]: Multi package request  BB.00.1F.00.1E.00.00.22.FF.FF.FF.54.01.14.33.00.CD.00.00.00.00.00.00.00.00.00.00.01.01.4A.0B.33.0B.00.00.00.00.00.00.00.00 (41)
[15:30:49][I][truma_inetbox.TrumaiNetBoxApp:303]: StatusFrameHeater
[15:30:49][D][truma_inetbox.LinBusProtocol:227]: Multi package response FB
[15:30:50][D][binary_sensor:036]: 'Room Heater active': Sending state OFF
[15:30:50][D][binary_sensor:036]: 'Water Heater active': Sending state OFF
[15:30:50][D][climate:387]: 'Truma Room' - Sending state:
[15:30:50][D][climate:390]:   Mode: OFF
[15:30:50][D][climate:401]:   Preset: NONE
[15:30:50][D][climate:410]:   Current Temperature: 13.70°C
[15:30:50][D][climate:416]:   Target Temperature: nan°C
[15:30:50][D][climate:387]: 'Truma Water' - Sending state:
[15:30:50][D][climate:390]:   Mode: OFF
[15:30:50][D][climate:410]:   Current Temperature: 16.00°C
[15:30:50][D][climate:416]:   Target Temperature: nan°C
[15:30:50][D][number:012]: 'Target Room Temperature': Sending state 0.000000
[15:30:50][D][number:012]: 'Target Water Temperature': Sending state 0.000000
[15:30:50][D][sensor:127]: 'Current Room Temperature': Sending state 13.70001 °C with 1 decimals of accuracy
[15:30:50][D][sensor:127]: 'Current Water Temperature': Sending state 16.00000 °C with 1 decimals of accuracy
[15:30:50][D][sensor:127]: 'Target Room Temperature': Sending state nan °C with 0 decimals of accuracy
[15:30:50][D][sensor:127]: 'Target Water Temperature': Sending state nan °C with 0 decimals of accuracy
[15:30:50][D][sensor:127]: 'Operating status': Sending state 0.00000  with 0 decimals of accuracy
[15:30:51][D][api:102]: Accepted ::FFFF:192.168.1.21
[15:30:51][D][api.connection:918]: Home Assistant 2023.2.5 (::FFFF:192.168.1.21): Connected successfully
[15:31:04][D][truma_inetbox.TrumaiNetBoxApp:448]: Requesting initial data again.
[15:31:05][D][truma_inetbox.LinBusProtocol:221]: Multi package request  BA.00.1F.00.1E.00.00.22.FF.FF.FF (11)
[15:31:05][D][truma_inetbox.TrumaiNetBoxApp:237]: Requested read: Sending init
[15:31:05][D][truma_inetbox.LinBusProtocol:227]: Multi package response FA.00.1F.00.1E.00.00.22.FF.FF.FF.54.01.00.0A.01.9F (17)
[15:31:06][D][truma_inetbox.LinBusProtocol:221]: Multi package request  BB.00.1F.00.1E.00.00.22.FF.FF.FF.54.01.0C.0B.00.1A.02.00.01.00.50.00.00.04.04.01.0B.12.00.00.00.00.00.00.00.00.00.00.00.00 (41)
[15:31:06][I][truma_inetbox.TrumaiNetBoxApp:384]: StatusFrameDevice
[15:31:06][D][truma_inetbox.TrumaiNetBoxApp:401]: StatusFrameDevice 1/2 - 4.04.01 0050.00 (0B 12)
[15:31:06][W][truma_inetbox.TrumaiNetBoxApp:419]: Unkown information in StatusFrameDevice found. Please report.
[15:31:06][D][truma_inetbox.LinBusProtocol:227]: Multi package response FB
[15:31:06][E][truma_inetbox.LinBusListener:154]: PID 3D (7D) order - unable to send response
[15:31:08][D][truma_inetbox.LinBusProtocol:221]: Multi package request  BB.00.1F.00.1E.00.00.22.FF.FF.FF.54.01.0C.0B.00.27.02.01.01.00.40.03.22.02.00.01.00.00.00.00.00.00.00.00.00.00.00.00.00.00 (41)
[15:31:08][I][truma_inetbox.TrumaiNetBoxApp:384]: StatusFrameDevice
[15:31:08][D][truma_inetbox.TrumaiNetBoxApp:401]: StatusFrameDevice 2/2 - 2.00.01 0340.22 (00 00)
[15:31:08][D][truma_inetbox.LinBusProtocol:227]: Multi package response FB
[15:31:08][E][truma_inetbox.LinBusListener:154]: PID 3D (7D) order - unable to send response
[15:31:09][D][truma_inetbox.LinBusProtocol:221]: Multi package request  BB.00.1F.00.1E.00.00.22.FF.FF.FF.54.01.14.33.00.CD.00.00.00.00.00.00.00.00.00.00.01.01.4A.0B.33.0B.00.00.00.00.00.00.00.00 (41)
[15:31:09][I][truma_inetbox.TrumaiNetBoxApp:303]: StatusFrameHeater
[15:31:09][D][truma_inetbox.LinBusProtocol:227]: Multi package response FB
[15:31:10][D][climate:387]: 'Truma Room' - Sending state:
[15:31:10][D][climate:390]:   Mode: OFF
[15:31:10][D][climate:401]:   Preset: NONE
[15:31:10][D][climate:410]:   Current Temperature: 13.70°C
[15:31:10][D][climate:416]:   Target Temperature: nan°C
[15:31:10][D][climate:387]: 'Truma Water' - Sending state:
[15:31:10][D][climate:390]:   Mode: OFF
[15:31:10][D][climate:410]:   Current Temperature: 16.00°C
[15:31:10][D][climate:416]:   Target Temperature: nan°C
[15:31:10][D][number:012]: 'Target Room Temperature': Sending state 0.000000
[15:31:10][D][number:012]: 'Target Water Temperature': Sending state 0.000000
[15:31:10][D][sensor:127]: 'Current Room Temperature': Sending state 13.70001 °C with 1 decimals of accuracy
[15:31:10][D][sensor:127]: 'Current Water Temperature': Sending state 16.00000 °C with 1 decimals of accuracy
[15:31:10][D][sensor:127]: 'Target Room Temperature': Sending state nan °C with 0 decimals of accuracy
[15:31:10][D][sensor:127]: 'Target Water Temperature': Sending state nan °C with 0 decimals of accuracy
[15:31:10][D][sensor:127]: 'Operating status': Sending state 0.00000  with 0 decimals of accuracy
[15:31:11][D][truma_inetbox.LinBusProtocol:221]: Multi package request  BB.00.1F.00.1E.00.00.22.FF.FF.FF.54.01.18.3D.00.53.00.00.00.00.00.00.00.00.00.00.01.01.00.00.00.00.00.00.00.00.00.00.00.00 (41)
[15:31:11][I][truma_inetbox.TrumaiNetBoxApp:314]: StatusFrameTimer
[15:31:11][D][truma_inetbox.TrumaiNetBoxApp:329]: StatusFrameTimer target_temp_room: nan target_temp_water: nan 0:0 -> 0:0  OFF
[15:31:11][D][truma_inetbox.LinBusProtocol:227]: Multi package response FB
[15:31:11][D][binary_sensor:036]: 'Timer active': Sending state OFF
[15:31:11][D][binary_sensor:036]: 'Timer Room Heater active': Sending state OFF
[15:31:11][D][binary_sensor:036]: 'Timer Water Heater active': Sending state OFF
[15:31:11][W][truma_inetbox.LinBusListener:234]: LIN v1 CRC error
WARNING 192.168.1.29: Connection error occurred: [Errno 104] Connection reset by peer
INFO Disconnected from ESPHome API for 192.168.1.29
WARNING Disconnected from API
INFO Successfully connected to 192.168.1.29
[15:31:21][D][api.connection:918]: Home Assistant 2023.2.5 (::FFFF:192.168.1.21): Connected successfully
[15:31:21][C][truma_inetbox.sensor:042]: Truma Sensor 'Operating status'
[15:31:21][C][truma_inetbox.sensor:042]:   Device Class: 'temperature'
[15:31:21][C][truma_inetbox.sensor:042]:   State Class: 'measurement'
[15:31:21][C][truma_inetbox.sensor:042]:   Unit of Measurement: ''
[15:31:21][C][truma_inetbox.sensor:042]:   Accuracy Decimals: 0
[15:31:21][C][truma_inetbox.sensor:042]:   Icon: 'mdi:power'
[15:31:21][C][truma_inetbox.sensor:043]: Type 7
[15:31:21][C][victron_ble.sensor:010]: Victron Sensor 'Time remaining'
[15:31:21][C][victron_ble.sensor:010]:   Device Class: 'duration'
[15:31:21][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:31:21][C][victron_ble.sensor:010]:   Unit of Measurement: 'min'
[15:31:21][C][victron_ble.sensor:010]:   Accuracy Decimals: 0
[15:31:21][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:31:21][C][victron_ble.sensor:011]: Type 22
[15:31:21][C][victron_ble.sensor:010]: Victron Sensor 'Battery voltage'
[15:31:21][C][victron_ble.sensor:010]:   Device Class: 'voltage'
[15:31:21][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:31:21][C][victron_ble.sensor:010]:   Unit of Measurement: 'V'
[15:31:21][C][victron_ble.sensor:010]:   Accuracy Decimals: 2
[15:31:21][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:31:21][C][victron_ble.sensor:011]: Type 9
[15:31:21][C][victron_ble.sensor:010]: Victron Sensor 'Starter Battery'
[15:31:21][C][victron_ble.sensor:010]:   Device Class: 'voltage'
[15:31:21][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:31:21][C][victron_ble.sensor:010]:   Unit of Measurement: 'V'
[15:31:21][C][victron_ble.sensor:010]:   Accuracy Decimals: 2
[15:31:21][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:31:21][C][victron_ble.sensor:011]: Type 7
[15:31:21][C][victron_ble.sensor:010]: Victron Sensor 'Current'
[15:31:21][C][victron_ble.sensor:010]:   Device Class: 'current'
[15:31:21][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:31:21][C][victron_ble.sensor:010]:   Unit of Measurement: 'A'
[15:31:21][C][victron_ble.sensor:010]:   Accuracy Decimals: 3
[15:31:21][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:31:21][C][victron_ble.sensor:011]: Type 8
[15:31:21][C][victron_ble.sensor:010]: Victron Sensor 'Consumed Ah'
[15:31:21][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:31:21][C][victron_ble.sensor:010]:   Unit of Measurement: 'Ah'
[15:31:21][C][victron_ble.sensor:010]:   Accuracy Decimals: 1
[15:31:21][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:31:21][C][victron_ble.sensor:011]: Type 11
[15:31:22][C][victron_ble.sensor:010]: Victron Sensor 'State of charge'
[15:31:22][C][victron_ble.sensor:010]:   Device Class: 'battery'
[15:31:22][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:31:22][C][victron_ble.sensor:010]:   Unit of Measurement: '%'
[15:31:22][C][victron_ble.sensor:010]:   Accuracy Decimals: 1
[15:31:22][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:31:22][C][victron_ble.sensor:011]: Type 20
[15:31:22][C][victron_ble.sensor:010]: Victron Sensor 'Battery Voltage'
[15:31:22][C][victron_ble.sensor:010]:   Device Class: 'voltage'
[15:31:22][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:31:22][C][victron_ble.sensor:010]:   Unit of Measurement: 'V'
[15:31:22][C][victron_ble.sensor:010]:   Accuracy Decimals: 2
[15:31:22][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:31:22][C][victron_ble.sensor:011]: Type 9
[15:31:22][C][victron_ble.sensor:010]: Victron Sensor 'Battery Current'
[15:31:22][C][victron_ble.sensor:010]:   Device Class: 'current'
[15:31:22][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:31:22][C][victron_ble.sensor:010]:   Unit of Measurement: 'A'
[15:31:22][C][victron_ble.sensor:010]:   Accuracy Decimals: 3
[15:31:22][C][victron_ble.sensor:010]:   Icon: 'mdi:battery'
[15:31:22][C][victron_ble.sensor:011]: Type 8
[15:31:22][C][victron_ble.sensor:010]: Victron Sensor 'Yield Today'
[15:31:22][C][victron_ble.sensor:010]:   Device Class: 'energy'
[15:31:22][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:31:22][C][victron_ble.sensor:010]:   Unit of Measurement: 'kWh'
[15:31:22][C][victron_ble.sensor:010]:   Accuracy Decimals: 2
[15:31:22][C][victron_ble.sensor:010]:   Icon: 'mdi:power'
[15:31:22][C][victron_ble.sensor:011]: Type 23
[15:31:22][C][victron_ble.sensor:010]: Victron Sensor 'PV Power'
[15:31:22][C][victron_ble.sensor:010]:   Device Class: 'power'
[15:31:22][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:31:22][C][victron_ble.sensor:010]:   Unit of Measurement: 'W'
[15:31:22][C][victron_ble.sensor:010]:   Accuracy Decimals: 0
[15:31:22][C][victron_ble.sensor:010]:   Icon: 'mdi:power'
[15:31:22][C][victron_ble.sensor:011]: Type 19
[15:31:22][C][victron_ble.sensor:010]: Victron Sensor 'Load Current'
[15:31:22][C][victron_ble.sensor:010]:   Device Class: 'current'
[15:31:22][C][victron_ble.sensor:010]:   State Class: 'measurement'
[15:31:22][C][victron_ble.sensor:010]:   Unit of Measurement: 'A'
[15:31:22][C][victron_ble.sensor:010]:   Accuracy Decimals: 1
[15:31:22][C][victron_ble.sensor:010]:   Icon: 'mdi:power'
[15:31:22][C][victron_ble.sensor:011]: Type 15
[15:31:22][C][victron_ble.text_sensor:010]: Victron Text Sensor 'Battery Alarm reason'
[15:31:22][C][victron_ble.text_sensor:011]: Type 2
[15:31:22][C][victron_ble.text_sensor:010]: Victron Text Sensor 'MPPT state'
[15:31:22][C][victron_ble.text_sensor:011]: Type 4
[15:31:22][C][victron_ble.text_sensor:010]: Victron Text Sensor 'MPPT Error reason'
[15:31:22][C][victron_ble.text_sensor:011]: Type 3
[15:31:22][C][esp32_ble:214]: ESP32 BLE:
[15:31:22][C][esp32_ble_tracker:583]: BLE Tracker:
[15:31:22][C][esp32_ble_tracker:584]:   Scan Duration: 300 s
[15:31:22][C][esp32_ble_tracker:585]:   Scan Interval: 320.0 ms
[15:31:22][C][esp32_ble_tracker:586]:   Scan Window: 30.0 ms
[15:31:22][C][esp32_ble_tracker:587]:   Scan Type: ACTIVE
[15:31:22][C][esp32_ble_tracker:588]:   Continuous Scanning: True
[15:31:22][C][mdns:108]: mDNS:
[15:31:22][C][mdns:109]:   Hostname: esphome-truma
[15:31:22][C][ota:093]: Over-The-Air Updates:
[15:31:22][C][ota:094]:   Address: 192.168.1.29:3232
[15:31:22][W][ota:103]: Last Boot was an unhandled reset, will proceed to safe mode in 5 restarts
[15:31:22][C][api:138]: API Server:
[15:31:22][C][api:139]:   Address: 192.168.1.29:6053
[15:31:22][C][api:143]:   Using noise encryption: NO
WARNING 192.168.1.29: Connection error occurred: 
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 520, in send_message_await_response_complex
    await fut
asyncio.exceptions.CancelledError

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 520, in send_message_await_response_complex
    await fut
  File "/usr/local/lib/python3.9/dist-packages/async_timeout/__init__.py", line 129, in __aexit__
    self._do_exit(exc_type)
  File "/usr/local/lib/python3.9/dist-packages/async_timeout/__init__.py", line 212, in _do_exit
    raise asyncio.TimeoutError
asyncio.exceptions.TimeoutError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 303, in _keep_alive_loop
    await self._ping()
  File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 628, in _ping
    await self.send_message_await_response(PingRequest(), PingResponse)
  File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 537, in send_message_await_response
    res = await self.send_message_await_response_complex(
  File "/usr/local/lib/python3.9/dist-packages/aioesphomeapi/connection.py", line 522, in send_message_await_response_complex
    raise TimeoutAPIError(
aioesphomeapi.core.TimeoutAPIError: Timeout waiting for response for <class 'api_pb2.PingRequest'> after 10.0s
INFO Disconnected from ESPHome API for 192.168.1.29
WARNING Disconnected from API
WARNING Can't connect to ESPHome API for 192.168.1.29: Error connecting to ('192.168.1.29', 6053): [Errno 111] Connect call failed ('192.168.1.29', 6053)
INFO Trying to reconnect to 192.168.1.29 in the background
Fabian-Schmidt commented 1 year ago

Thanks for the logs. I am looking into the issue. It appears that logging is a blocking operation. So when a log is send via Wifi it takes too long. And the Lin listener is using an interrupt which than takes too long.

I developed and tested only via USB connection which has no issue.

I should have an update in a day or two.

Fabian-Schmidt commented 1 year ago

Hi, I have uploaded a new version which should fix this issue. Can you please test again?

snipah commented 1 year ago

I have the feeling, that once I activate logging, the connection breaks. If I deactivate logging, everything works without problems. But I just tested the Truma part. Will keep on testing.

Fabian-Schmidt commented 1 year ago

Try setting refresh on the component to ensure you have the latest version e.g.

  - source: github://Fabian-Schmidt/esphome-truma_inetbox
    components: ["truma_inetbox", "uart"]
    refresh: always
snipah commented 1 year ago

Thanks!