Modbus issues

And the errors you see now are…same…different?
Are the sensors returning any values? OR unavailable?

Log seems to be similar:

2019-10-02 16:14:54 DEBUG (SyncWorker_6) [pymodbus.transaction] Running transaction 219
2019-10-02 16:14:54 DEBUG (SyncWorker_6) [pymodbus.transaction] SEND: 0x1 0x3 0x0 0x28 0x0 0x1 0x4 0x2
2019-10-02 16:14:54 DEBUG (SyncWorker_6) [pymodbus.framer.rtu_framer] Changing state to IDLE - Last Frame End - 1570022094.948568, Current Time stamp - 1570022094.973189
2019-10-02 16:14:54 DEBUG (SyncWorker_6) [pymodbus.client.sync] New Transaction state 'SENDING'
2019-10-02 16:14:54 DEBUG (SyncWorker_6) [pymodbus.transaction] Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
2019-10-02 16:14:57 DEBUG (SyncWorker_6) [pymodbus.transaction] Incomplete message received, Expected 7 bytes Recieved 0 bytes !!!!
2019-10-02 16:14:57 DEBUG (SyncWorker_6) [pymodbus.transaction] Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
2019-10-02 16:14:57 DEBUG (SyncWorker_6) [pymodbus.transaction] RECV: 
2019-10-02 16:14:57 DEBUG (SyncWorker_6) [pymodbus.framer.rtu_framer] Frame - [b''] not ready
2019-10-02 16:14:57 DEBUG (SyncWorker_6) [pymodbus.transaction] Getting transaction 219
2019-10-02 16:14:57 DEBUG (SyncWorker_6) [pymodbus.transaction] Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
2019-10-02 16:14:58 ERROR (SyncWorker_6) [homeassistant.components.modbus.sensor] No response from hub hub1, slave 1, register 40
2019-10-02 16:14:58 DEBUG (SyncWorker_16) [pymodbus.transaction] Current transaction state - TRANSCATION_COMPLETE
2019-10-02 16:14:58 DEBUG (SyncWorker_16) [pymodbus.transaction] Running transaction 220
2019-10-02 16:14:58 DEBUG (SyncWorker_16) [pymodbus.transaction] SEND: 0x1 0x3 0x1 0xe 0x0 0x1 0xe4 0x35
2019-10-02 16:14:58 DEBUG (SyncWorker_16) [pymodbus.framer.rtu_framer] Changing state to IDLE - Last Frame End - 1570022097.982249, Current Time stamp - 1570022098.073025
2019-10-02 16:14:58 DEBUG (SyncWorker_16) [pymodbus.client.sync] New Transaction state 'SENDING'
2019-10-02 16:14:58 DEBUG (SyncWorker_16) [pymodbus.transaction] Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
2019-10-02 16:15:01 DEBUG (SyncWorker_16) [pymodbus.transaction] Incomplete message received, Expected 7 bytes Recieved 0 bytes !!!!
2019-10-02 16:15:01 DEBUG (SyncWorker_16) [pymodbus.transaction] Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
2019-10-02 16:15:01 DEBUG (SyncWorker_16) [pymodbus.transaction] RECV: 
2019-10-02 16:15:01 DEBUG (SyncWorker_16) [pymodbus.framer.rtu_framer] Frame - [b''] not ready
2019-10-02 16:15:01 DEBUG (SyncWorker_16) [pymodbus.transaction] Getting transaction 220
2019-10-02 16:15:01 DEBUG (SyncWorker_16) [pymodbus.transaction] Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
2019-10-02 16:15:01 ERROR (SyncWorker_16) [homeassistant.components.modbus.sensor] No response from hub hub1, slave 1, register 270

sensors have data (maybe even correct one), but I can’t confirm their accuracy nor change speed as i’m remotely connected to the machine.

From the first debug you posted… The errors pertain to:

register 297 = Last Measured DHW Energy Produced – Wh part (READ ONLY)
I don’t like - ()

register 28 = A/C Mode Z1 Heating(room temp)/Heating(curve) [28/40029].2
I don’t like / . () []

register 38 = Holiday [38/40039] Normal/Holiday
I don’t like [] /

Plus the names ALL just seems too long? Any reason why you are doing that?
My advice is to eliminate all ‘special’ characters.

If it was me I would shorten back to just one sensor as a test.

Lets say


## MODBUS ##
  - platform: modbus
    registers:

      
      - name: MelcoBEMS MINI A1
        hub: hub1
        slave: 1
        register: 10

If that one works you have found the problem

I’m behind HMI again.
When I put DHW on prohibit from HMI then it takes minutes to update status in HA.
I reduced sensor.yaml to the following:

## MODBUS ##
  - platform: modbus
    registers:
      - name: Firmware Version
        hub: hub1
        slave: 1
        register: 10

      - name: Holiday
        hub: hub1
        slave: 1
        register: 38

      - name: DHW On Prohibit
        hub: hub1
        slave: 1
        register: 39




      

      

      

Minutes is what I expect with HA modbus…what about the same sensors in node-red?
How is the log looking with just those sensors now?

If the log is looking better rework all your HA sensors to something like the above and observe for 24 hours I think…noting what happens to values when you adjust settings from the HMI.

EDIT: The lag time for sensor change is something which has been annoying me in my own system here. It makes it difficult to use them in critical automations but I have found ways around it that work for me.

wow- that long time delay is normal?!
I can’t replicate my node red set up again. I’m quite new to it and don’t know how to reliably use it.
But log errors are still present:

Transaction failed. (read failed: device reports readiness to read but returned no data (device disconnected or multiple access on port?))

That tells me your device is being read simultaneously by HA and Node-Red

That is a problem. You probably need to think carefully about how you move forward.

As a for instance…If I am updating my PLC program. I first MUST stop HA.
I find it is not possible to have two “Master” devices running at the same time without errors.

I suspected that node red could play it’s negative role …

I exchanged several emails today with Mitsubishi technical support.
And came to conclusion that my options for controlling my heat pump the way I want are quite limited.

  • Initial plan was to use modbus. But this is full of read-only options.
  • Before that I had (still have) their MelCloud wifi module, which as the name says is cloud based- I don’t know if it is possible to integrate that into HA some way.
    US market uses something similar- Kumo Cloud, which supports ITFFF. I’m still trying to figure out if I can install that one with my region pump. Also there is some confusion if the wifi module is same or not. I’m waiting some feedback regarding this from the tech.support.
  • Then there is the CN105 hack, but reading the source code it seems to support air-to-air units only.
  • Yesterday I thought that maybe the robust way to control the pump controller would be to solder some contacts into HMI and connect it over ESP/MQTT etc. This seems a lot of work and probably is beyond my coding skills.

Maybe I have to face the fact that my realistic resolution to control the pump is only On/Off .

Don’t give up just yet.
Kill one of the multiple masters by a choice to proceed via HA or Node-Red.

Then setup all the sensors you want on the chosen platform and continue to monitor all readings while you use the HMI to make changes.

Once comfortable your sensors are accurate then move forward with trying to control from your chosen platform.

I think that could possibly destroy your device if you are not expert with precise soldering but the replacement device cost could be an affordable option for you?

Have you looked at the PCB itself yet? If possible post a photo showing the likely places you would solder? Both sides of the board may be useful?

I haven’t taken it apart yet, but I assume this is not that difficult to solder contacts under buttons.


They are simple push buttons.
Anyway this would be the last option and carries the risk of destroying something.

After you solder your wires you will need to bring them out to the device doing the switching. Then it also depends on your equipment you have at hand as well.
Do you do much electronics work?

By far the best solution is to gain control via modbus, wifi or mqtt.

Not much, but small scale soldering is not unfamiliar to me and I have previously done some smaller projects with arduino, ESP. I’m more worried about the programming part later.

Did you eliminate one?
Sensors working better?

I deleted node red flows and restarted HA.
Errors are still same. Weird.

And how are the sensors going? Accurate values?
Maybe post some more from the logs?

Can’t use HMI so sensor values are unknown. I expect them to be correct.

some more log:

2019-10-03 11:15:01 ERROR (SyncWorker_11) [homeassistant.components.modbus.sensor] No response from hub hub1, slave 1, register 38
2019-10-03 11:15:01 DEBUG (SyncWorker_5) [pymodbus.transaction] Current transaction state - TRANSCATION_COMPLETE
2019-10-03 11:15:01 DEBUG (SyncWorker_5) [pymodbus.transaction] Running transaction 119
2019-10-03 11:15:01 DEBUG (SyncWorker_5) [pymodbus.transaction] SEND: 0x1 0x3 0x0 0x27 0x0 0x1 0x34 0x1
2019-10-03 11:15:01 DEBUG (SyncWorker_5) [pymodbus.framer.rtu_framer] Changing state to IDLE - Last Frame End - 1570090501.033281, Current Time stamp - 1570090501.146843
2019-10-03 11:15:01 DEBUG (SyncWorker_5) [pymodbus.client.sync] New Transaction state 'SENDING'
2019-10-03 11:15:01 DEBUG (SyncWorker_5) [pymodbus.transaction] Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
2019-10-03 11:15:04 DEBUG (SyncWorker_5) [pymodbus.transaction] Incomplete message received, Expected 7 bytes Recieved 0 bytes !!!!
2019-10-03 11:15:04 DEBUG (SyncWorker_5) [pymodbus.transaction] Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
2019-10-03 11:15:04 DEBUG (SyncWorker_5) [pymodbus.transaction] RECV: 
2019-10-03 11:15:04 DEBUG (SyncWorker_5) [pymodbus.framer.rtu_framer] Frame - [b''] not ready
2019-10-03 11:15:04 DEBUG (SyncWorker_5) [pymodbus.transaction] Getting transaction 119
2019-10-03 11:15:04 DEBUG (SyncWorker_5) [pymodbus.transaction] Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
2019-10-03 11:15:04 ERROR (SyncWorker_5) [homeassistant.components.modbus.sensor] No response from hub hub1, slave 1, register 39
2019-10-03 11:15:04 DEBUG (SyncWorker_16) [pymodbus.transaction] Current transaction state - TRANSCATION_COMPLETE
2019-10-03 11:15:04 DEBUG (SyncWorker_16) [pymodbus.transaction] Running transaction 120
2019-10-03 11:15:04 DEBUG (SyncWorker_16) [pymodbus.transaction] SEND: 0x1 0x3 0x0 0xa 0x0 0x1 0xa4 0x8
2019-10-03 11:15:04 DEBUG (SyncWorker_16) [pymodbus.framer.rtu_framer] Changing state to IDLE - Last Frame End - 1570090504.158418, Current Time stamp - 1570090504.185571
2019-10-03 11:15:04 DEBUG (SyncWorker_16) [pymodbus.client.sync] New Transaction state 'SENDING'
2019-10-03 11:15:04 DEBUG (SyncWorker_16) [pymodbus.transaction] Changing transaction state from 'SENDING' to 'WAITING FOR REPLY'
2019-10-03 11:15:07 DEBUG (SyncWorker_16) [pymodbus.transaction] Incomplete message received, Expected 7 bytes Recieved 0 bytes !!!!
2019-10-03 11:15:07 DEBUG (SyncWorker_16) [pymodbus.transaction] Changing transaction state from 'WAITING FOR REPLY' to 'PROCESSING REPLY'
2019-10-03 11:15:07 DEBUG (SyncWorker_16) [pymodbus.transaction] RECV: 
2019-10-03 11:15:07 DEBUG (SyncWorker_16) [pymodbus.framer.rtu_framer] Frame - [b''] not ready
2019-10-03 11:15:07 DEBUG (SyncWorker_16) [pymodbus.transaction] Getting transaction 120
2019-10-03 11:15:07 DEBUG (SyncWorker_16) [pymodbus.transaction] Changing transaction state from 'PROCESSING REPLY' to 'TRANSACTION_COMPLETE'
2019-10-03 11:15:07 ERROR (SyncWorker_16) [homeassistant.components.modbus.sensor] No response from hub hub1, slave 1, register 10

[pymodbus.framer.rtu_framer] Frame - [b''] not ready

I have not had anything to do with modbus RTU so I really don’t know what this is telling me.

Anyone else looking at this thread got a clue?

Apart from that the other problems I saw seem to have cleared up?
What do you think?

If the values are accurate it could be a case of just keep monitoring when you operate the HMI for a while.

I’m not sure it other problems have cleared up.
I need to set up the whole range again and monitor sensors over time to see if they make sense and update within reasonable time.

If you see anything of concern in the log just post it and I’ll help if I can.

Dear Steve,

im trying to write from input number to modbus register same as you do,but its not working .

if i set value:(any constant ) it work but with code like this :
value: ‘{{ states(’‘input_number.box’’) | int }}’ it stop wroking.
i try it in developer service to check the error (see attached photo)

- id: '1571772791342'
  alias: write modbus
  description: write modbus
  trigger:
  - entity_id: input_number.box
    platform: state
  condition: []
  action:
  - service: modbus.write_register
    data:
      address: 4100
      hub: delta
      unit: 1
      value: '{{ states(''input_number.box'') | int }}'