Spyke

Syndicated from the fediverse. Read and engage on the original instance.

View original on lemmy.world

Modbus problem

In the office we have an automation system that talks in modbus. Right now I have Node Red that receives data from modbus (via IP), sends it to MQTT and send messages from MQTT to modbus. In HA I have 15 MQTT climates that works. I want to bypass Node Red; I've added an automation that gets triggered when a MQTT values arrives and sends the new value to mobus:

alias: Climate_update_modbus_setpoint_studio1
description: ""
triggers:
  - trigger: mqtt
    topic: home_assistant/thermostat/setpoint/Studio1
actions:
  - data:
      hub: picnet
      address: 1099
      value: "{{ (trigger.payload | float * 10) | int }}"
    action: modbus.write_register
mode: queued

The problem is that the modbus change takes a lot.

  • I change the climate setpoint, after about 0.5 seconds the MQTT value changes and the automation gets triggered
  • the modbus register changes in a range of about 0.5-3 seconds
  • sometimes the automation gets triggered and I see the trigger bar yellow instead of blue and the modbus register changes after longer

With Node Red I have no problem with modbus. What can I check to try to find the source of the problem?

View original on lemmy.world
7

2 replies

Sorry, I don't fully understand your setup or the problem.

Seems like it's modbus <--> node-red <--> MQTT <--> HASS?

But you want to cut out node red? So if the input to MQTT is slow, what's writing that MQTT value?

Without having any more context, I think I'd reach for Wireshark/tcpdump and just see the packets come in and understand timing.

1

You might want to check with some industrial controls guys that know Modbus.

I don't run into Modbus much at work but here's what I do know. Mosbus is shit. If a light is red, check the communication cables.

1

You reached the end

Modbus problem | Spyke