Question: I'm pretty new to Raspberry and I searched the net for a while now trying to find a good and simple answer to this question.

Ok, so I have a network that is connected to the internet.
I want to start a new network for IOT devices around my workplace to do and alert me on various things.
I'm using HomeAssistant for the system, and I have a separate router for the IOT network.

My question is how can I set it all up so the Raspberry will be connected to the internet through the wifi and connected to the IOT network through the ethernet?

I heard they can't work together at the same time and I want it to either switch between them automatically or if it does work if someone can point me in the right direction of where to read or what to look for that will really help me a lot.

I run the Raspberry Pi 3 model B+.

EDIT: I posted the solution as an answer. at least what has worked for me for the last few days now.

Answer: 
After connecting the pi over the wlan to the internet network and through eth0 to the IOT network, the mqtt I run over the IOT network works, but the notifications that worked before stopped working. I tried installing some packages but it wouldn't find them and won't install them, that's when I started thinking it was a problem with the routing table like @goldilocks suggested.

what I got from the ip route command:

```
pi@hassbian:~ $ ip route
default via 192.168.1.1 dev eth0 src 192.168.1.50 metric 202
default via 10.0.0.138 dev wlan0 src 10.0.0.101 metric 303
10.0.0.0/24 dev wlan0 proto kernel scope link src 10.0.0.101 metric 303
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.50 metric 202

```

In order to work through the internet which is run on the 10.0.0.0/24 network I needed to edit the /etc/dhcpcd.conf file and add at the end of the file:

```
interface wlan0
metric 200

interface eth0
metric 300

```

Assigning lower metric give precedence over the other in terms of where the internet connection comes from (at least that is what I understood). This will result in the wlan0 making all the internet connection.

I hope this will help people solve their connection problems.
If the 2 networks have `DHCP` servers (operating on their own network - using multiple `DHCP` servers on a single network is problematical) then the Pi should obtain the necessary configuration parameters, then it should work.

No additional configuration should be required if using the default `dhcpcd` network manager. `route` will show the final routing. If this cannot be done automatically then you may need to manually configure the routing table as suggested by goldilocks - this is more involved, as the table is normally automatically configured and will overwrite manual configuration.