[APP][Pro] Modbus

Hm, it seems they start counting at #1 (mean Register 1 = address 0).
And if (some) registers are used for read and write, it should be HoldingRegisters.

Try this for Register 2

It should return the ambient temp in 1/10° as integer. Value 80 means 8,0°.


Some details about Modbus…

Summary

Modbus: When 40001 Really Means 1, or 0 Really Means 1

Documentation for Modbus is not well standardized. Actually there is a standard, but not well followed when it comes to documentation. You will have to do one or more of the following to decipher which register a manufacturer is really referring to:

a) Look for the register description, such as holding register, coil, etc. If the documentation says #1, and tells you they are holding registers, then you have holding register #1. You also have user friendly documentation.

b) Look at the numbers themselves. If you see the first register on the list having a number 40001, that really tells you register #1, and it is a holding register. This form of notation is often referred to as the old Modicon convention.

c) Look for a definition of function codes to be used. If you see a register #1, along with notation telling you to use function codes 3 and 16, that also tells you it is holding register #1.

IMPORTANT: Register 1 is address 0. Read on…

d) Do the numbers in your documentation refer to the register number or address? Register #1 is address zero. If it is not clear whether your documentation refers to register or address, and you are not getting the expected result, try plus or minus one for register number. All Control Solutions products refer to register numbers in configuration software or web pages. However, some manufacturers document their devices showing address, not register numbers. When you have addresses, you must add one when entering that register into configuration software from Control Solutions.

Hi,

I just tried it, and at first it didn’t worked, I didn’t got the error anymore. But only 0 or 1 as a response. I’ve then put it at adress starting with 0. And now it worked:

I got a value of 151. So that means 15,1°

Thanks for the help, now I can start playing around with it :).

How should it work if I want to give it instructions ? What write should I use in that case ?

BR
Jan Wynen

Use the “write Holding Register” card.
Set the register ID like you did. Use a register that is writeable.
In most cases it should be INT16 as datatype.
Then read again to be sure the correct value is written. Some devices are using different LE/BE encoding. That’s trial/error to find the right type :slight_smile:

Hi,

Stupid question probably :slight_smile:
As you told me the temperature comes out like 151, and it is 15.1 degrees.

But how can I let Homey calculate it like that ?
I tried it like this, but doesn’t work and get an error. Probably I need a variable or something.

Please try {{ tag / 10 }}. This is the common way to use MathJS expressions.

Super, it worked! :smiley:

Hi, could you check again if it’s working?
I just checked the written Byte if that’s the correct value. How did you write the value before? Just added the INT values and write as INT16?

Hi all, any idea to integrate my heat radiant and my controlled Mechanical Ventilation produced by Eurotherm in Homey using modbus? I attach code

edge://preview/Communication.Protocol.SmartComfort.365_EN_Rev06.pdf

I have no idea to start…

Please correct the URL :slight_smile:

Sorry attach file

https://github.com/user-attachments/files/18782860/Communication.Protocol.SmartComfort.365_EN_Rev06.pdf

Short version:

  • connect the device using the IP address, Port 502 and ID 1
  • Use the “Read holding register” flow card
  • Use the register number from page #3
  • decimals values are stores as integer. For temperatures, you have to calculate /10 (see examples/unit column)
  • the PDF has “address” as column title, so try “address, start with #0” in the flow card.

Good luck :slight_smile:

Sorry, working 7 days a week so not a lot of time to spend on Homey… At the moment it looks like writing in test mode is not working at all. Reading bits is working quite well, maybe a bit slow but that can be the issue of Homey :). Already a few weeks it’s reading the state of different door and window sensors right.

Can you show me some examples if you have some time?
I wonder whap happens in your case. It just reads INT16, addes the bit with a bitmask and writes back the INT16.
Or is it a 2 register field? Shouln’d be one if using Bits :thinking: