Skip to content

Dugske/connected_devices

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Connecting a PLC with zigbie and external I/O's using Home assistant using Modbus TCP/IP + Modbus Serial

Table of Contents
  1. About The Project
  2. Getting Started
  3. Setup
  4. Usage
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments


About the project:

I made this project as a school task. Ive spent time on it, but I won't get maintained, this project also is not finished yet, neither is the documentation



Getting started:

Requirements:

  • Router
  • Server/ device to run homeassistant on
  • PLC, with ethernet +/ RS485 *
  • External IO, with ethernet *
  • raspberry pi pico *
  • Zigbie gateway *
  • Zigbie devices *

*(You don't have to use all these things, since my project links a lot of different devices, you could just connect two with homeassistant)


Products I used:


Setup:

  1. Connect your router to the internet, and your server device using an ethernet cable.

  2. Setup a server


    For a desktop server, for a pinecone A64.

    • Desktop:

      • This will explain how I did it, you can use another installer, but I used a windows PC

      1. Install Home asistant using this link on your server. I used the Virtual box version.

      2. Proceed when you have gotten home assistant running

    • Pinecone:

      • WIP
  • Setup Zigbie devices

    1. Connect zigbie gateway to the router

    2. Install the Tuya smart home app, and add your devices in there

    3. Follow this tutorial to setup tuya with homeassistant

    4. After restarting home assistant you should be able to enable/ disable/ do other stuff with your zigbie devices.

  • Setup EQ3 Max!

    1. Follow this tutorial to setup the EQ3 max!
  • Setup a (visiologic) plc.

    First in the project settings add these settings:

    IP Address: 192.168.0.28, Protocol: TCP, Port Number: 20256, PLC Name: PLC Name
    You can use your own IP address and a custom name

    Here are the steps recorded.


    This is the code I used to setup the PLC:

    Settings

    The card init settings are these:

    The socket 1 settings are these:

    The socket 2 settings are these:

    The socket 3 settings are these:

    Here are the steps recorded.

  • Setup external ethernet I/O (ADAM 5000)

    • Connect the external I/O to the router

    • Connect your laptop to the router (via ethernet)

    • Download the most recent version.

    • Open the ADAM/APAX utility software, and press the searchglass.

    • Let it search the network

    • When it finds the device, you can select it, go to the network tab and you can change/ see the IP address.

    Here are the steps recorded.

    • Now in homeassistant add the file editor plugin and change the configuration.yaml, we will be adding mobus lines there! You can use this to find more info about the below commands!

    The code:

    modbus:
      - name: NAME
      close_comm_on_error: true
      type: tcp
      host: IP_ADDRESS
      port: 502
    

    The slave number is like the key, you start with 1, and with every different thing you check, you add +1

    The address is the place where the sensor is 'stored' in the adam, you can check it using the tool

    Reading digital outputs:

    binary_sensors:
      - name: NAME
        address: 1
        slave: 1
        scan_interval: 20
        unique_id: NAME
    

    Writing digital inputs:

    switches:
      - name: NAME
        address: 12
        slave: 2
        write_type: coil
        unique_id: NAME
    

    Reading analog outputs:

    sensors:
      - name: NAME
        slave: 3
        address: 43
        input_type: holding       
        state_class: measurement       
        count: 1       
        scale: 1       
        offset: 0       
        precision: 1       
        data_type: int16
        unique_id: NAME
    

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published