More than one Arduino

How are you configuring them?
If you are doing the following that’s why it’s complaing:

arduino:
  port: /dev/ttyACM0
arduino:
  port: /dev/ttyACM1

Try this instead

arduino:
  port: /dev/ttyACM0
  port: /dev/ttyACM1

Why don’t you use I2C IO expanders?
Such as the MCP23017

Or for ADC
ADS1115

I’ve tried this way and this gave me no error
arduino:
port: /dev/ttyACM0
port: /dev/ttyACM1

but in switches I can use only one platform Arduino:(example below)

switch:

  • platform: arduino
    pins:
    11:
    name: Arduino PIN11
    12:
    name: Arduino PIN12
    13:
    name: Arduino PIN13 - Led

using
switch:
#Arduino MEGA clone

  • arduino
    11 (…)
    #Arduino Uno
  • arduino
    11 (…)

doesn’t work (only the first switch is shown)

for expanders I2C IO
I need to read about them. I’m still new this is my first Home Automation implementation and I would like to learn as much as I can and choose the best way to create my HA experience…

Have you also tried

arduino:
  port: /dev/ttyUSB0
  port: /dev/ttyUSB1

which is mentioned in the docs?

Also have you confirmed the second one is ttyACM1?
Try deleting ttyACM0 from your config, can you then see ttACM1 ok?

Before spending too much money on Arduino or cabling parts I would start off simple and make a test rig. I would still recomend having a look into the Sonoff-Tasmota firmware all you need to install is Mosquitto and setup WiFi and it is pretty much set and forget after that.

@wills106
Thanks for your patience and time.

I made a test and put in configuration.yaml my second Arduino only

arduino:
  port: /dev/ttyACM1

and works (Led blinks in Port 13 after switching on). That means that my first and second Arduinos are connected ok.

When I try to use

arduino:
  port: /dev/ttyACM0
  port: /dev/ttyACM1

I get only a switch for first connected Arduino…

… and using Configurator an error shown

  • When I conncect using Putty (“dmesg” command) i see ATM0 and ATM1 so there is no connection error.

For sonoff Tasmota - I have one configured myself couple of days ago and it work flawless using MQTT. This is a good method, but I still would like to have everything wired and controlled by Rpi / Arduinos because this way I can avoid problems like password change issue / sonoff crash / wifi signal problems / new software update errors / security issues. When I use method with FTP’s I don’t need to deal with so much problems that can occurs during some years of using HA, plus maintain standard installation up and running even when something bad happen.

I appreciate your wish to avoid wifi and envy your ability to wire your home from scatch.

Another approach perhaps: set up each arduino with an ethernet shield and get it communicate with home assistant via mqtt.

2 Likes

Thanks nickrout, I don’t have experience with shields but I think it will be not so easy to control Pin inside Shield using Home Assistant (MQTT will work but setup will be hard).

I will try to create some custom components like arduino2.py today. Maybe this helps.

I also created a topic in future requests (More than one Arduino board).

If nothing works - maybe I will wire my lightning only (24 pins will be enough) and control the rest of sensors using Sonoff or Shelly over MQTT,

I’ve created custom component and works great. The files are placed in GIT repo. If someone want to connect more than one Arduino my custom components will work Arduino Boards extension.

Tomorrow I will provide some images how this works.

Nice project you got, and as @nickrout said, it’s envious that u can wire you house.

In my opinion wiring your entire house from a central location for all sensors isn’t the best. Except you want to use voltage balancing in signal transmission coupled with STP cabling.

If you don’t it will only input noise into your system, especially if u have stuffs like washing machine, dryers, HVAC or other high inductive loads on in the house. In short any strong EMC generator.

The desire to avoid WiFi is legit as I will do same, but instead of trying to have all the twisted pair cables run to the center, I would follow the advice of @nickrout and use the ESP chips over Twisted pair Ethernet cables using MQTT. Besides, the idea of using USB is a lot of work. There is a possibility the allocated name might change when the Pi reboots, or the connection being flaky over time. USB is not as rugged as Ethernet that is properly crimped or punched down.

What you can do is run a single network cable to each location, and connect an ESP chip to that cable to manage that location. Like each location having its own ESP chip over the network. Ethernet will help you manage the long runs, and this will ensure your signals are legit and less prone to interference.

This to me is not only better but more reliable and robust. I get Its not the cheapest, but could be depending on how u allocate the chip to the locations. You don’t want a system that just works, you need a system that is robust and future prove. With the Ethernet cable, u can easily expand over time as more things come up by simply changing the chip that manages that location.

You said it might be hard software wise, but there are tons of code out there based on ESP MQTT that u can modify for your use case. You got time, so why the rush? Better you build something robust now and safe you a headache in the future, than just rush it and u potentially regret it later on.

Regards

Are there esp chips that do this? I was only aware of wifi versions.

Strictly speaking, wifi is a form of ethernet…

But yeah I think all esp chips are wireless ethernet, aka wifi.

With the shield I meant sorry for the misinformation

Well I meant Ethernet cable :slight_smile:

Thank you for advice @Odianosen25 I want to achieve best results so I will consider your idea. Please tell me is there some scheme / sketch to show how to build this kind of installation? I have some experience in Home Assistant but I still don’t choose the best way to build whole installation. The idea of ESP looks good because when technology change - you can just change hardware and system will be up to date. Question is, shoud I use ESP in every room in light + electricity slot and how to connect them in reality?

Hello @Michal_Nowakowski, it depends really.

If you got the cash, I will advice each room having their own ESP with the associated shield for cabled Ethernet. The ESP can then be connected to the relay and sensors needed for that room.These sensors can be the window or door for that room. That to me is the best approach, and it allows the MQTT topics to be better managed also.

As to the schematic, I haven’t built one before so not sure how to show you one. But since you have a light and sensors schematic, all you need to do is to edit it so each light connects to its room ESP. An Added advantage is that the ESP could also be used to sense contact closure for dumb low voltage wall switches, so either HA or the wall switch (while also reporting to HA) can control the lights locally.

Regards

Regards

Ok so I will try to sketch this idea myself today or tomorrow and send it in this post. Thanks guys for your help and see all soon :slight_smile:

When you say esp, I assume you mean arduino.

1 Like

I think this is the idea @nockrout, @Odianosen25, @wills106 talked about. From arduino you have relays that control 5v > 230 V cirquit. You can switch relays on or off, plus you can control switches and sensor directly in each room. Sensor is connected to 230V (if Sonoff / Shelly) or 3,3 V separate UTP cable (mySensors, Arduino). These MQTT hardware can be controlled over Internet or Wifi.

Is this the idea? I can miss something. I’m learning this installation secrets day by day but I’m still not good at it…

I am a bit confused by your Diagram.
Are you suggesting for example to be able to switch a relay on/off with both an Arduino and a Sonoff / ESP at the same time? I don’t understand the green wires from the Arduino to the relays.

If you use a Sonoff T1 Wall switch it is self contained, the relay to switch the light bulb on/off is built in to the wall switch.

You can turn the light on / off by either physically touching the switch or by using mqtt.

I think you are going round in circles and getting yourself awfully tied up.

I have reread the last few posts and I think the diagram you are after is as follows.

Yes I can’t spell…

Don’t Worry about the 10/100BaseT IEE802.3u and Ethernet. They are there just to get the point across that I am referring to using the Cat 5/5e/6 for it’s intended purpose.

Home Assistant using Cat 5 or what ever to the switch.
Switch connects to each Ethernet Shield (Running MQTT Client) in Room 1, Room 2 etc.
Ethernet Shield - Arduino
Arduino has sensors, relays, switches etc
Arduino passes sensor states back to Ethernet Shield.
Ethernet Shield converts sensor state into MQTT.
Ethernet Shield sends MQTT back down the ethernet cable where Mosquitto passes it to Home Assistant and does it’s thing.

1 Like