A small step for Hubitat, a big step for me (modbus integration)

I'm happy since yesterday !

I installed node-red into my fanless W7 computer, installed related software (modbustcp) and connected it to my modbus plc, through its ip address and obtained 1 value :slight_smile:

That means I will (future) be able to harvest data from my plc and integrate them into HE.

But I need more help here. it's about that integration, of course. MQTT broker, apps/drivers, etc.

If i have node-red working and harvesting data, what are the next steps to send them to HE ?
Just the basic rules of what to do will be enough for now, I'll dig into it later.
Thanks

1 Like

What are you using the plc for?

I have a PLC on my septic system. Handles pumps and alarms. Really interested in what you're doing here. Would love to get alarm and status info from the PLC.

S.

Do a search for Hubitat MQTT drivers and pick one that is close to what your plc is being used for. Then modify it for your topics and payloads. There's a pattern to the drivers that you have to learn plus groovy learning time but it all makes sense.

1 Like

@scottgu3

I do home automation for years and have some industrial plc to collect data from different devices:

floaters, temperatures (from a modbus to 1-wire network) from my house (remember, was made before the wireless things) and inside my geothermal unit, from water boilers, have some flow/btu meters to collect water pressure (geo loop circuit, main water inlet) and can activate relays (pumps by example). I have a thermal solar to hook into this but I'm short about time...
Plc are absolutely reliable and reboot/freeze is pretty unknown with them. Ok, the price is not the same.:pensive:

HE is more about rules triggered by wireless sensors/timers and I wanted to merge this with my actual system. I felt from the beginning that "something" could be possible but had to read a little bit more.
This is the idea and I have now a path to follow to reach my goal. But now, I have to learn about mqqt and other drivers/apps :smiley:

I will for sure (this is my monitored french drain) !

1 Like

Stupid question did jour: What's a PLC?

plc

Thank you.

There are no stupid questions, only questions that will make you wiser my Hubitat friend!

3 Likes

What brand is that? I've done plc programming for 40 years. I've probably used that one, but don't remember. Mostly retired now and don't keep up on all the latest models.

Tbox - semaphore/servelec. A belgian company at first, now part of a french one. I programmed the MS units (modular) for a project and have at home the LTx units. Plus independent TCP modbus controllers from temcocontrols that are hooked to them. Have some TCP barionet too for 1-wire sensors and a bunch of rtu slaves.

https://www.servelectechnologies.com/servelec-technologies/products-services/remote-telemetry-units/tbox/

https://www.barix.com/products-by-area/automation-development/barionet/

So far, so good.

Tested the node-red with one of my master plc (Tbox/Semaphore): polled a couple of successive int16 registers (node-red returns an error when trying to poll float registers) and all data were displayed as expected ! And those data are coming in fact from a remote rtu slave (a 1-wire to modbus slave) connected to my tbox :slight_smile:

*Edit: with float registers, I need to read 2 consecutive registers and convert them (low/high) to display the result. Easy-cheesy :slight_smile:

Good Stuff!

It's been awhile since I looked at the PLC in my Septic Control system, but it's a Siemens model of some sort. I did some reading on it at one point, and it has an ethernet interface I should be able to connect to. Your efforts have dredged it back up, and I'll have to take some time to look at it again.

My goal would be simply to generate alerts on alarms, and allow remote overrides of the pump. That would save me from standing in the rain and throwing the toggle to do just that! LOL

S.

1 Like

I absolutely agree !

A google home message like : "Sh*t [censored] is flowing outside the septic tank !" will be a plus into HE and WAF :slight_smile:

2 Likes

Multiple modbus polls: consecutive int16 registers (temperatures), rounded float registers (electricity metering and temperatures). Going better and better... Must sleep a litlle bit now !

1 Like

Well done Mike - great progress,

Your next step for your integration is to either directly provide the value(s) to a HE device through Maker API / Webhook or to publish the values to MQTT and import the device from there.

You know what I'm going to say.. :yawning_face: (community yawn) my app will do that and I have added you to the alpha test if you do want to play. Ideally if you present the device on MQTT using the 'homie' format it would just be discovered by HE but a single payload with a value can also be used.

homie format would look something like the below (from an iris-one battery sensor) so would take about 10 topics. The important value is presented in 'measure-battery =100' but called whatever you want e.g. 'instant-watts'. 'iris-one' could be 'SDM631' is that is a useful identifier name. The other values are all just telling HE what it can expect value wise.

You would publish this message to your MQTT broker homie topic
homie/yourhubname/iris-one

image

or a single message (that could be fleshed out to full homie later)

homie/mikes-he/SDM631/instant-watts = 1848.66

P.S. image That's the effect of last nights Xmas party !

Added today a cloud mqtt broker and connected everything.
Was able to harvest int16 registers, write locally and trough mqtt broker coils (relays).

Nice to hear the clic of the relay of the plc next to me, while sending some values into the broker !
And because my plc has an embedded mail server, when I activate/deactivate the relay, I receive an e-mail with the status.

1 Like

Does anybody know a good android mqtt app, able to connect a cloud mqtt broker (local broker like mosquitto aswell), so I can continue my tests with my modbus plc's and node-red ?

There are local broker apps, but I want to begin with a cloud one, prior to install a local one.

Thank you

Hi Scott, some follow-up.
I'm using the latest alpha5 app/driver from @kevin and was able to connect it to my modbus master/node-red, using his MQTT bridge (Installed a local mosquitto instead of a cloud one like I did before).
So far, so good, I have now 2 tiles with temperatures of 2 PT1000 sensors hooked to my modbus unit.
And that's the beginning. I'm now confident that the modbus integration will be ok very soon with other sensors/values (in fact, as you know, just modbus addresses) and the future will be to manage to send values (HE=>MQTT=>Node-Red=>Modbus) to change addresses like relays.

Values (tiles <=> MQTT explorer) are different because taken at different time. But the idea is there

2%20sensors%20-%202%20tiles

1 Like