[Release] HubDuino v1.1.9 - Hubitat to Arduino / ESP8266 / ESP32 / ThingShield Integration (ST_Anything)

Complete shot in the dark here, but has anyone used a board to connect to a hunter pro-c irrigation controller that will look at the weather and activate the rain skip function? My rain sensor broke, but my guess is it is just some sort of relay that completes the circuit activating a skip.

Probably an amateur question, can you have multiple Arduinos or multiple instances of Hubduino running at the same time? I want to be able to add sensors in a few different rooms without running all the wires back to a central location.
Thanks,

yes you can. when you create the virtual device, you specify the IP address of the arduino, so you can have multiple connected to one hub

2 Likes

Thanks mate,

So, I was able to handle a single touch sensor using this board Standalone Momentary Capacitive Touch Sensor Breakout [AT42QT1010] : ID 1374 : $5.95 : Adafruit Industries, Unique & fun DIY electronics and kits. The sensor works using an a IS_Button connected to a selected pin of the Arduino Nano 33 IoT.
But, with the MPR121 I get nothing: I can't send you the log (as a stupid I've deleted the sensor and all the logs...), but I remember that it was making a mess with multiple push/release/hold events. I try to investigate more what's going on (given that now I know what should happen when everything works) but I've a strong feeling that I need an array of IS_Button, built into the PS_Adafruit_MPR121. My first attempt was with sending an event for each button with a given suffix (button 1 -> pushed1, button 2 -> pushed2... ), but I've understood that it's not working.

Have you tried to use the board, if you've got one?

Now it's really late, I can't test anymore. But I'll try in the next days. Thanks for the cool work, anyway, it allows to integrate each type of hardware with the hub.

Is it possible to send data from the hub to the Arduino? Say I have a servo or LED strip connected to an Arduino. Can I control the servo or LEDs from my Hubitat?

Yes you can.

I assume your arduino that you want to control from hubitat has a network connection of some sorts ? If so, and you can control the servo by sending a command over http from a browser to the arduino, then it should be super easy to do that.

Excellent. I don't have it set up yet. I just bought my hubitat and move into a new house in a couple months. I didn't think it was worth the headache to set it up all now for only a couple months. I have a few ESP32s on the way.

Thanks for your help.

Duh you will be running Hubduino on the ESPs so yeah you will be able to for sure do LEDs from hubitat. I haven't done servos with it yet... Just search this thread, I'm sure there is something about servos in here.

I've successfully coded the management of different buttons with the mpr121 sensor. However, the board within the hub is recognised but no buttons are assigned (not only 1).
I've extended my handled class from InterruptSensor instead of IS_Button due to all the code that I should have removed or handled otherwise. But it looks that there's a deep difference between the two, that I'm not able to see and reproduce in my custom class.

Where is exactly defined/added /created the button that the board manages? Is just because its of the type IS_Button that's is recognised as a button?

I am not sure I understand exactly what you’re asking…:thinking:

As long as your new class sends events to the Hubitat hub in the form of “button1 pushed”, “button1 held”, and “button1 released”, the PARENT HubDuino device on your hub will generate events that any App on the hub can subscribe to. There will not be any Child devices created.

Note: “held” events are not required, if your code does not differentiate between “pushed” and “held”.

Note: the syntax I mention above must be followed exactly as I have shown it. For additional button numbers, simply increment the numeric value. Since the MPR121 supports 12 inputs, simply use the values 1 through 12 as the “button” suffix. “button1 pushed” through “button12 pushed”, for example.

Mhhh... That means that sending events of the type [device name] pushed #, where device name is TouchSensor is definitely not working.

Then, if the things are like this, I'm almost finished with my project.
I'll try in the evening and I'll report here the results.

It works! Many many thanks for the work you've done and your help.
Now I just need to clean the code and build a nice PCB where fix the boards and "print" the buttons.

1 Like

Glad to hear you’ve got it working! Please keep us posted on how this performs in real-world applications. Always great to see and hear about unique applications like yours.

Yes, for sure!
I would post a video, but I don't know how to do it here (without uploading somewhere, but I would not do it...)
Edit: I've done a GIF to show how it works. It needs a way to identify where the buttons are, otherwise it's going to be a bit hard to push the correct ones :wink:
CapacitiveTouchTest

1 Like

I've noted that sometimes the loop hangs, like if it waits/is blocked by something.
In this case I get no log, and the sensor is not working. Then, after several seconds (almost 1 minute), all the actions I've done are sent all together. Anyway, this doesn't happen always, sometimes it stays there, doing nothing.

Could it be something related to the sensor or is something connected to the way the manager works (not to point the finger, just to know in which direction should I investigate more)?

Without seeing your sketch, along with your new MPR121 device code, I really cannot assist in troubleshooting very effectively. If I had to guess, the MPR121 touch sensor is probably triggering events too frequently, thereby causing issues either on the microcontroller side, or the Hubitat hub side. It is always a good idea to make sure your code does not send a bunch of events in rapid succession. For a normal digital input, I typically implement 'debounce logic' to prevent this from happening. Perhaps that is worth a try in your code as well?

If you want to have a look, the code is here: ST_Anything branch.
The board can be programmed for a custom debounce. I've set 3 for push and 2 for release.

Anyway, I've read also that the board is really susceptible to any field nearby (of course!) that can cause a "lock". In my attempts I have had the power line close to the board, hence it could be that the problem was this.

Today is working since some hours without stop.

Edit: sketch is just create button device, add to handler, run loop.

Really nice shop!! I'd like to see a video tour.