This is the forum archive of Homey. For more information about Homey, visit the Official Homey website.

The Homey Community has been moved to https://community.athom.com.

This forum is now read-only for archive purposes.

Modbus/TCP

Would it be possible to implement Modbus/TCP? This would open-up the possibility of a lot of PLC based controllers  working together with Homey :smile: 

Don't know if it could be of use, but found the following Json script on Github:
https://github.com/dresende/node-modbus-tcp/blob/master/package.json

«1

Comments

  • Sound nice, I like modbus very much. The only problem is that most devices are industrial and therefor pretty expensive. It's also possible to use an arduino as a modbus slave. But mate there are better protocols to use between an arduino and Homey. For example think about the polling which is needed for some applications which can cost a lot of network traffic.
  • SteefphSteefph Member
    edited January 2016
    Sure, you've to poll Modbus but, this can be done at a slow rate. Most industrial devices still use a 19k2 baud on the background. I'm not talking about an arduino because yes, you can better use other equipment for that. I'm talking about industrial sensors and such. 

    I'm currently working on a project to upgrade a 1928 inner-watership to today's domotica capabilities. In the engine room already a PLC is in use and it would be great if Homey could talk with it to report status via voice, the Knightrider under the ships :smile: 
  • Ok, but do you want to connect Homey to a PLC via modbus? That doesn't make sence. You don't want to use a PLC as a modbus slave. A PLC is ment to be a modbus master. There are better protocols to let Homey communicate with a PLC.
  • Why would a PLC be a master? In most applications it is the slave as it just generates the data for a graphical interface which has no priority for the PLC. 

    Anyway, that's not the question, if the PLC only has modbus, you can say there are better options but, if it is the only one, there aren't.....
  • Normaly the PLC needs values to measure and decide if a valve must be open or close. Therefor it request data from a levelmeter for example. Or it uses modbus tobretreive the status of a emergencie power supply, both are applucations we've build.

    But I agree that that's not the question. What brand and type if PLC do you have?
  • Peter, I do not know where you want to take this thread? I ask, if it would be possible to implement Modbus/TCP as a host on the Homey. 

    I use for example Siemens PLC S7 or CCC Series5/Series6 (Turbine/Compressor Control System) controllers which are slaves to SCADA systems. They to the calculations on their own and just tell the SCADA on request of the SCADA what they are doing. The SCADA can also give manual commandos as in setpoints or valve control.

    My vriend is also used the CCC equipment and we can get them relatively cheap. It would be nice to have a "simple" interface like Homey for his wife to be able to control everything ;)
  • MarcoFMarcoF Member
    edited January 2016
    Which physical connections do these PLC have? Modbus is just a protocol and you need something like WiFi/BT/Ethernet/IR/etc to talk to it. 

    If there's a Modbus NodeJS lib, then its possible to add it to Homey. The biggest challenge will be homey talk to the PLC.

    I use 2 Modbus device in my homey (1x Kamstrup 162, 1x Kamstrup Multical) and I use 2 arduino's with on one end IR-Head and on the other end an EthernetShield. Arduino uses the IR-Head to talk to the meters and translates it to a URL and post it to my SQLite database.
  • I use Modbus/TCP to read the energy values from my SolarEdge solar panels (via the SunSpec protocol). On the HW side I use a USR-WIFI232-604 to convert from RS485 to the network. I made a plugin for Vera and will be trying to get this running on the Homey some time (when it arrives and I get around to this part...). So if the Modbus part is already there that would be nice. I'd only need to add the SunSpec decoding (which is the main part).
  • SteefphSteefph Member
    edited January 2016
    Connections are on older devices RS485/422 but, they could be connected to a Modbus/TCP converter. So, if the homey would understand Modbus over TCP it could cover a wide range of devices used in the industry and solar panels smile 

  • My dad uses a XLogic plc with modbus integration to control most of his house. I wont make any promises, but im planning to make a modbus app in my spare time within the next 4 months
  • How to write a multiple coils in modscan32
  • MariaMaria Member
    Sound nice, I like modbus very much. The only problem is that most devices are industrial and therefor pretty expensive. It's also possible to use an arduino as a modbus slave. But mate there are better protocols to use between an arduino and Homey. For example think about the polling which is needed for some applications which can cost a lot of network traffic.

    Here are some low cost Modbus I/O modules and Modbus Touch Screen PLC's in case you need anything like that.  

    Low Cost Modbus I/O:  http://www.icpdas-usa.com/tmseries.php

    Low Cost Modbus Touch Screen Controllers: http://www.icpdas-usa.com/touch_pad_controller.html
  • OGSOGS Member
    @Reinier, are you still planning to create an app for Modbus?
    I would also like a similar app for FINS protocol (Omron PLC) so I could connect my PLC to it.
    FINS is very similar to Modbus TCP, it is only a different string and different port nr but the rest is the same.

  • MarcoFMarcoF Member
    Reinier was last seen on the forum on Last April 22.
    No idea if he is still on the Athom ship....
  • wingiewingie Member
    MarcoF said:
    Reinier was last seen on the forum on Last April 22.
    No idea if he is still on the Athom ship....
    According to his LinkedIn profile he still is https://www.linkedin.com/in/reinierhasper
  • MarcoFMarcoF Member
    edited July 2016
    @wingie;
    I saw that and there could be multiple reasons to keep that on a profile.

    Emile confirmed Reinier is not fully available.
  • OGSOGS Member
    Anybody who would like to work together on an app for PLC comms?
    for me FINS and also Modbus?

  • I have been very busy the last couple of months which gave me no time for any side projects. Regarding the modbus app, when looking at my spare time for the upcoming months i don't think there is any time left for developing this app, as soon as i start i will let you guys know.
  • OGSOGS Member
    I already have all the knowledge about the protocols and the hardware to test (FINS and Modbus) but no knowledge about writing an app for Homey.
    I would love to have the connection to my PLC.
  • Then just start coding.
    You have nothing to lose, but only to gain.
    It'll take some time to learn and you'll maybe have to start with an very simple app and later start for modbus
  • Hi everyone 

    any news? 
  • Hi,

    Any news? 
  • I wrote an app that works but isn't finished. Anyone who like to finish it? 

  • MarcoF said:
    Which physical connections do these PLC have? Modbus is just a protocol and you need something like WiFi/BT/Ethernet/IR/etc to talk to it. 

    If there's a Modbus NodeJS lib, then its possible to add it to Homey. The biggest challenge will be homey talk to the PLC.

    I use 2 Modbus device in my homey (1x Kamstrup 162, 1x Kamstrup Multical) and I use 2 arduino's with on one end IR-Head and on the other end an EthernetShield. Arduino uses the IR-Head to talk to the meters and translates it to a URL and post it to my SQLite database.
    Hi MacroF,
    Would you please tell How do you add a NodeJS lib to Homey?!

    Thanks
  • Connecting a S7 PLC to Domotica systems is one of my whishlist. At this moment I'm using a Raspberry Pi with Node-Red for a lot of automation tasks (interaction with Homey is done by MQTT, see Athom app-store).

    I didn't try it, but in Node-Red there are installable nodes which can be installed to interact with a Siemens S7;
    https://flows.nodered.org/node/node-red-contrib-s7
    https://flows.nodered.org/node/node-red-contrib-s7comm

    For ModBus there are a lot of available nodes for installation, so that should also be a probability.

    Just a suggestion. Could be nice for testing and easy to setup?


  • RemcoHanninkRemcoHannink Member
    edited December 2017
    Hello,

    There is a Dru fireplace app on Github. The fireplace is controlled via ModBus TCP. It works, however there is a memory leak or something inside which makes it crash after 1-2 days. I was not able to fix this. The app is not being supported anymore.

    But the code from this app might help you guys build a generic ModBus TCP app. And if you find the memory leak in the Dru app, please let me know  ;)


    Gr. Remco
  • Just got Homey and I would love to have a modbus TCP option or a Siemens S7 (PLC) integration. Is someone working on it?  :)
  • CalderCalder Member
    edited May 2018
    I would also like this, to be able to log my PV-production offline.
    SolarEdge's API shouldn't be polled to often, but with Modbus I can poll the inverter every five minutes (or every second).

    I have been using this from Github: https://github.com/tjko/sunspec-monitor to play with, and since I have the Modbus Meter there are a lot of information available. Excerpt below (using my mac).

    INVERTER:
                 Model: SolarEdge  SE17K
      Firmware version: 3.2186
         Serial Number: -
        Device Address: 1
    
                Status: ON (MPPT)
    
     Power Output (AC):         8522 W
      Power Input (DC):         8651 W
            Efficiency:        98.51 %
      Total Production:      136.425 kWh
          Voltage (AC):       415.60 V (49.98 Hz)
          Current (AC):        35.54 A
          Voltage (DC):       747.20 V
          Current (DC):        11.58 A
           Temperature:        49.24 C (heatsink)
    
    METER (#1):
                 Model: WattNode WND-3Y-400-MB
                Option: Export+Import
      Firmware version: 25
         Serial Number: -
    
       Exported Energy:       10.910 kWh
       Imported Energy:        7.313 kWh
            Real Power:         7736 W
         Real Power L1:         2607 W
         Real Power L2:         2754 W
         Real Power L3:         2374 W
        Apparent Power:         7738 VA
          Power Factor:        -1.00
          Voltage (AC):      -240.27 V (50.00 Hz)
          Current (AC):         0.00 A
                Events:            0
    
                  Time: 2018-05-13 10:00:01
    


Sign In or Register to comment.