Is there any way to change the modbus data format from float32 to sw. float32?

I’m using the modbus integration to pull sensor values from my EV charger, however i found that all the float values displayed were not accurate.
For example register 358 is showing a value of 1.69 instead of ~0.38

Bit of digging with a modbus scanner revealed that the value should be formatted in “32bit sw. float”
http://www.protoconvert.com/Portals/0/RadzioModbusMasterSim/RMMS-v0.1.6/ModbusMasterSim-v0.1.6.zip
reg358_32bitswfloat

ps: the value here is pulled during the trickle charge stage and hence below 1.

Configuration

modbus:
  - name: EVSE
    type: tcp
    host: 192.168.0.X
    port: 502

    sensors:
    - name: EV Charger - Current Charge Rate
      address: 358
      unit_of_measurement: kW
      slave: 255
      data_type: float
      scan_interval: 2
      precision: 2

I’m no expert on Modbus but I think the registers are only 8 bits wide. So for a 32bit word you have to set the count option to 4. You may also have to configure the swap option.

Thanks for the tip! I tried to set it to count 4 and it gave an astronomical value, so i tried 2 and it seems to be correct at least for the values i can read off currently. I’d be able to tell if count 2 really did it the next time i charge my car in a few days.

Current values

Update: Count 2 did the trick without any swap required.

The model I have is the Schneider Evlink Smart Wallbox, for those looking to do the same. :slight_smile:
Built a simple dashboard and some automations to alert when the charging has completed.

1 Like

Hey Chris,

Did your charger have spelled out modbus connection terminals? I’ve got the one below and it doesn’t appear to have anything labeling those points.

Hey Poldim, I connected to modbus via TCP/IP from an RJ45 connector. Yours look very different from mine so I suppose you must have another model. Perhaps searching the product pages or contacting your service representative might help.

https://download.schneider-electric.com/files?p_enDocType=Instruction+sheet&p_File_Name=NNZ2678201-05.pdf&p_Doc_Ref=NNZ2678201

@chrislimk are you able to share the modbus register address mapping for the Schneider EVlink Smart Wallbox? I’m trying to get mine working too. Thanks!

Let me get back to you as I am currently away on vacation.

Here’s a small snippet to get you started

##Charge Rate
- name: EV Charger - Current Charge Rate
address: 358
unit_of_measurement: kW
device_class: power
state_class: measurement
slave: 255
data_type: float32
scan_interval: 5
precision: 2

##Charge Time
- name: EV Charger - Charge Time
  address: 31
  unit_of_measurement: s
  slave: 255
  data_type: uint16
  scan_interval: 5

Thanks for your reply. I’ve managed to work out most of the registers, see attached.

One important thing I’m missing is accumulated charge energy (Wh / kWh), either session or lifetime.

The modbus docs for the new EVlink Pro has both of those values documented, but the register maps are very different.