Connecting a PLC with zigbie and external I/O's using Home assistant using Modbus TCP/IP + Modbus Serial
Table of Contents
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
- 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)
- Router
- PLC: Vision 280
- IO with ethernet: ADAM-5000/TCP
- Raspberrpy pi zero2-w
- Zigbie gateway
- Zigbie light
- Zigbie temperature sensor
- Zigbie radiator valve
- Server: PineA64
- Server: Simple desktop pc Windows
-
Connect your router to the internet, and your server device using an ethernet cable.
-
For a desktop server, for a pinecone A64.
-
-
This will explain how I did it, you can use another installer, but I used a windows PC
-
Install Home asistant using this link on your server. I used the Virtual box version.
-
Proceed when you have gotten home assistant running
-
-
- WIP
-
-
-
Connect zigbie gateway to the router
-
Install the Tuya smart home app, and add your devices in there
-
Follow this tutorial to setup tuya with homeassistant
-
After restarting home assistant you should be able to enable/ disable/ do other stuff with your zigbie devices.
-
-
- Follow this tutorial to setup the EQ3 max!
-
First in the project settings add these settings:
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:

Here are the steps recorded.
-
-
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!
modbus: - name: NAME close_comm_on_error: true type: tcp host: IP_ADDRESS port: 502The 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
binary_sensors: - name: NAME address: 1 slave: 1 scan_interval: 20 unique_id: NAMEswitches: - name: NAME address: 12 slave: 2 write_type: coil unique_id: NAMEsensors: - 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 -

