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

I’d have to understand a little more about what you’re planning on controlling. For some more complicated applications, it may simply be better to write a custom Arduino sketch and the add the proper communications libraries to allow for integration with Hubitat. You might even want a completely custom Hubitat driver that is tailor made for your specific application.

Gotcha. A custom sketch might be the way to go. Let me put together a better description and see where it goes

1 Like

got my project completed! so glad i was able to save $200 on a new smart feeder and just hack into the existing one :smiley:

1 Like

I just added a motion sensor and the dashboard was showing it on when I didn't think it should
I hooked up the serial console and could see it sending motion inactive, but for whatever reason the hub side was not getting the message (guessing here).... anyone see this...solution
I will point out on the next one it may update the dashboard....just not doing all the time
Below is pic of serial console w dashboard and device status

Is there any chance your Hubitat hub has changed its IP address? Did you reserve an IP address for your HE hub in your router’s DHCP server?

So here is the description I promised

Warm water Heating system controller

There are several Temp sensors.
Outdoor Temperature
Room temperature
Water Mix temperature

User variables
Mix Maximum water temperature
Mix Design temperature
Room temperature setting (Can a Virtual thermostat be used for this?)
Warm weather shutdown (WWSD)

Control relays
Boiler control
Mixing Valve
Main Pump

Variables that are dependant on Math done in the Groovy
Water Mix target

First off. ALL the safety mechanisms for the system are outside the scope of this project.
High temp, low water are in place and working independantly.

Synopsis of operation:
The mix water temperature is decided by a formula of Outdoor Temp.,
Outdoor design Temp, and the Room Temperature. The mix water temperature will be controlled by
the main boiler water temp and the mixing valve that will mix the hot water to the cooler
water returning from the floor system.

The user variables will generally only need to be set once and could be set in the device
driver with the exception of the room temperature.

From a user perspective I would like to see in a dashboard:
Room Temperature
Outside Temperature
Mix temperature
Mix target
Thermostat to set the Room Temperature
Indicator that the Main Pump is operating
Indicator for the Mix Valve (Not a requirement)

Graph of the Heating curve attached. This is where the formula needs to be extracted from.

So How hard will this be to implement?Capture

Wow! That appears to be a fairly complicated thermostat/control application.

Once you get an Arduino sketch up and running that performs the tasks correctly, we can discuss how you might be able to integrate this with Hubitat. Please be sure to not use any long blocking calls, like a delay() statement, as these will interfere with the network connectivity to Hubitat.

If a commercial,off-the-shelf thermostat is available for this application, I would strongly encourage you to simply purchase one and use that instead. Tuning control loops, while not rocket science, is not trivial. I have worked in industrial control automation for my whole career. I would never consider building my own thermostat device when I know the folks at Honeywell, Nest, Ecobee, etc... have invested millions in designing and building robust, reliable commercially available solutions.

1 Like

Thanks Dan for your comments. I have looked into controls for doing this and they are very expensive! And they are not IoT so to speak. The controller I have now works but I have to change it at the controller. I want to be able to check it and change the settings from my Hubitat.

My thought was to use a dedicated Arduino 256 and your sketch to get info to the HE. Could the math be done in the sketch? Or would it be better in the driver?

PS. I am now using HE to control warm water baseboard heat in two locations in my house with no issues so far.

1 Like

Cruising aroung the interwebs there appears to be only two controllers to do what I need to do. One by Viega and another by Tekmar. They are well above $350.00. They are Outdoor reset controllers. Using the outside temperature and the heating curve to control the water temperature. Not your average thermostat

1 Like

For something that needs to run reliably, I would always perform the control algorithms in the Arduino sketch. This way, your Hubitat hub can be rebooted or replaced, without losing the basic functionality of the thermostat. To make your sketch able to survive reboots, you may want to also look into how to use the EEPROM a capability of the Arduino microcontrollers to store data in NVRAM. This way settings can be persisted through a power outage or a restart. You may also want to add a local touchscreen display, to allow local user input. You’re basically building a full blown thermostat.

Hopefully you’ll be able to find someone else’s open source Arduino sketch that implements this specialized type of temperature control. That would be a good starting point. Then customize it as necessary for your requirements, and to add some integration to Hubitat.

This is not an insignificant undertaking, as you’ll be writing a lot of custom code on both the Arduino and Hubitat sides. But, it should be interesting to watch your project as it progresses. I would encourage you to create a dedicated thread for your project.

Thanks Dan.
The display and using the NVRAM are great tips. I'll keep you posted

its worked thank you so much Dan

Dan,
I moved my W5500 to Hubitat, it worked on ST. I have updated the sketch with 39501 and comment out the ST. I followed all your steps. Hubitat added all children per sketch but none of them work. this is only a relay with 6 switches. Thank you

Not sure why they wouldn't work... A few things to verify:

In the Arduino Sketch, the Arduino PORT should be 8090 still...no change needed vs ST.

As you mentioned, the HUB Port should be 39501.

The Arduino IP address needs to be unique on your home network.

Double check the Parent Device's settings on your Hubitat hub for the Arduino IP address and port (8090).

do i need to update Network Device Id in Hubitat with MAC address?

Not any longer. With Hubitat, I have streamlined things to use the IP Address of the Arduino as the DNI. This happens automagically after you enter the Arduino's IP address into the parent and click SAVE under the user preferences/settings.

Should if match?

I see in the logging that Hubitat is sending commands but nothing happening on the Arduino Side

dev:512020-10-31 12:46:04.407 pm debugdescription= 'mac:2CF7F1080C38, ip:c0a801dd, port:1f9a, headers:SFRUUC8xLjEgMjAwIE9LDQo=, body:'

dev:512020-10-31 12:46:04.332 pm debugUsing ip: 192.168.1.221 and port: 8090 for device: 51

dev:512020-10-31 12:46:04.328 pm debugExecuting 'sendEthernet' switch1%20on

no, not exactly... One is a text string, and the other is the hexadecimal representation of the IP address.