My OEG-KS2W boiler installation is in the attic as well as my raspberry pi 4B 2 GB.
Debian is installed on the RPI and has been in use for some time for VirtualHere server, among other things.
The RPI is connected to the OEG-KS2W via a USB cable.
Virtualhere ensures that COM3 can be forwarded to my Windows 10 laptop via WiFi.
The “Software zum KMS-D” is installed on the laptop so that I can connect to the OEG-KS2W via WiFi and the RPI.
By chance I found the site OEG KMS data in Home Assistant – Welcome to DIY! and I also wanted some parameters
of my OEG-KS2W in my home assistant.
I have installed the “github software” on the existing RPI software.
Installed all software from my user (robert) account.
Starting the oeg_kmsd.service always produced the following error
Loaded: loaded (/lib/systemd/system/oeg_kmsd.service; enabled; vendor pres>
Active: activating (auto-restart) (Result: exit code) since Mon 2023-05-22>
Process: 8508 ExecStart=/usr/bin/python3 /home/pi/oeg_kmsd/oegscan_mqtt.py >
Main PID: 8508 (code=exited, status=1/FAILURE)
CPU: 87ms
lines 1-6/6 (END)
By manually running the command “/usr/bin/env python3 /home/robert/oeg_kmsd/oegscan_mqtt.py” via:
Also found somewhere to put "env " in the line, to solve an error, I don’t remember it anymore,
sudo /usr/bin/env python3 /home/robert/oeg_kmsd/oegscan_mqtt.py I was able to solve several problems:
I have therefore adapted the service line accordingly.
The following modules did not work or did not work properly: minimalmodbus,pyserial,paho-mqtt.
Perhaps because apparently multiple versions of Python are installed on my RPI.
With the help of “google” I was able to solve these errors, but I still couldn’t start the service,
because there was no connection to the OEG-KS2W device.
Using google and this command:
sudo python -m serial.tools.miniterm , got me a list of my RPI serial ports:
Available ports:
— 1: /dev/ttyACM0 ‘SELTRON HEATING CONTROLLER’
— 2: /dev/ttyAMA0 ‘ttyAMA0’
— Enter port index or full name: 1
— Miniterm on /dev/ttyACM0 9600,8,N,1 —
— Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H —
— unknown menu character Ctrl+[ –
I then modified the “oegscan_mqtt.py” as follows:
instrument = minimalmodbus.Instrument(’/dev/ttyACM0’, 128, minimalmodbus.MODE_ASCII) # port name, slave address (in decimal)
#Change the COM port above to the OEG Usb comport or USB address on Linux.
instrument.serial.baudrate = 9600 # Baud
instrument.serial.parity = serial.PARITY_NONE
instrument.serial.bytesize = 8
instrument.serial.stop bits = 1
instrument.serial.timeout = 0.05 # seconds
Now the service starts without errors and the MQTT connection between OEG-KS2W > RPI > Home Assistant works without problems
My HA runs on an Odroid C4 as HomeAssistant OS;
To make the KS2W entities work in HA I also modified the configuration.yaml:
#MQTT sensors
mqtt:
sensor:
- name: “Roof T1”
unique_id: “Roof_T1”
state_topic: “home-assistant/oeg/OegT1”
state_class: “measurement”
unit_of_measurement: “C”
- name: "Boiler low T2"
unique_id: "Low_T2"
state_topic: "home-assistant/oeg/OegT2"
state_class: "measurement"
unit_of_measurement: "C"
- name: "Boiler high T3"
unique_id: "High_T3"
state_topic: "home-assistant/oeg/OegT3"
state_class: "measurement"
unit_of_measurement: "C"
- name: "OEG pump"
unique_id: "OEG_pump"
state_topic: "home-assistant/oeg/oegpump"
unit_of_measurement: "%"
It remains to be seen why the Oeg pump does not provide data, but this will also be fine.
regards
robert
translation from dutch to english with google translate.