- Platform information:
- Hardware: Raspberry Pi 2 Model B Rev 1.1, 1 GB RAM, 14 GB storage
- OS: _Linux openhabian 5.15.76-v7+ #1597 SMP Fri Nov 4 12:13:17 GMT 2022 armv7l _
- Java Runtime Environment: openjdk 11.0.16 2022-07-19, OpenJDK Runtime Environment (build 11.0.16+8-post-Raspbian-1deb11u1), OpenJDK Server VM (build 11.0.16+8-post-Raspbian-1deb11u1, mixed mode)
- openHAB version: openHAB 3.3.0 - Release Build
- Issue of the topic:
Hello forum,
I have successfully installed OpenHAB 3 to monitor my Nilan Heatpump. To set-up, I mainly followed the thread here: Nilan heatpump cts 700 - #5 by mRintamaki
I have 54 things with status online and can readout 43 items without errors.
Now I would like to receive the current value of the humidity sensor. Unfortunately, this value is only accessible after providing admin password.
The Nilan modbus protocol CTS700_MODBUS-rev 2.01.pdf gives me Information about addresses and registers.
There I find the following instruction:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
(Page 12/106)
2. Introduction
This manual contains information regarding the monitoring and control of Administration level Nilan
NCS700 systems via MODBUS Ethernet. It include short protocol description, registers list and they a
mapping into NCS700 RTDB variables.The slave device uses 502-nd port for requests receiving.
Modbus of NCS700 support two level of access to registers - the Common level and Administration level.
A access to Administration level registers executed with previous authentication only.
All attempts of access without previous authentication will fault and will return Modbus erro
(Page 13/106)
3.2. Authentication procedure
For receiving access to Administration level registers it is necessary to execute authentication procedure.
This procedure is an operation of password write into special registers.
If procedure is success and password is valid the access into Administration registers will open.
The authentication registers (first register number is 7777) description is placed in paragraph 4.267 [typo].
(Page 66/106)
4.267. Authentication registers
All registers of group are Write-Only and must be preset by one “Preset Multiple Registers” Modbus - function.7777 (W) - Registers quantity : 8
The authentication string registers:
Reg1 Hi-byte: Password char
Reg1 Lo-byte: Password char
Reg2 Hi-byte: Password char
Reg2 Lo-byte: Password char
.
.
.
Reg8 Lo-byte: Password char
Reg8 Hi-byte: Password charNote: All unused bytes must be filled by 0 (zero) symbol.
^^^^^^^^^^^^^^^^^^^^^^^
I also considered the documentation of modbus binding in Modbus - Bindings | openHAB
According to the above mentioned thread I supopose the modbus admin passwort is 6699 (or 7675)
So I composed the following lines in my nilan.things file:
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
Bridge poller NilanAdmin [ start=7777, length=1, refresh=10000, type="holding" ] {
Thing data Nilan_Admin [ writeStart="7777", writeTransform="6699", writeMultipleEvenWithSingleRegisterOrCoil="true", writeValueType="int16", writeType="holding" ]
}
In Browser this line is converted to:
UID: modbus:data:nilan:NilanAdmin:Nilan_Admin
label: Modbus Data
thingTypeUID: modbus:data
configuration:
readTransform: default
writeTransform: 0x3636,0x3939,0,0,0,0,0,0
writeType: holding
updateUnchangedValuesEveryMillis: 1000
writeValueType: int16
writeMultipleEvenWithSingleRegisterOrCoil: "true"
writeMaxTries: 3
writeStart: "7777"
bridgeUID: modbus:poller:nilan:NilanAdmin
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
These lines - and several variants thereof - are (obviously) not working and result in an error message “Status: OFFLINE - BRIDGE_OFFLINE - No online bridge”
probably relevant lines in openhab.log:
> 2022-11-27 21:08:46.224 [ERROR] [rt.modbus.internal.ModbusManagerImpl] - Last try 3 failed when executing request (ModbusReadRequestBlueprint [slaveId=1, functionCode=READ_MULTIPLE_REGISTERS, start=7777, length=1, maxTries=3]). Aborting. Error was: net.wimpi.modbus.ModbusSlaveException Error Code = 2 [operation ID 3fa59e34-e366-4b54-89c7-916d5282e8cc]
My Questions:
- How to I reach all 8 registers at once (both hi- and lo-byte)
- How do I transfer the passwort “6699” (characters, not integern!?) to the registers of address 7777?
- How do I fill remaining 4(8) registers with 0 (values not characters)
- why is […] READ-multiple-register […] mentioned in openhab.log, athough I try a WRITE access?
- Or summarizing: What is wrong with my approach?
If I have a general misconception for this in mind, please point me to the right direction
Thanks in advance for any hints
Rai