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

I use InfluxDB + Grafana running on an always-on home server in my house. Hubitat sends the data to InfluxDB for time-series archiving. Grafana then displays that data in an easy to use web app.

Here is an example

Yeah, unfortunately I don't have an always on server running in the house. I saw some stuff about sending data to Google Sheets, but I don't know how feasible that would be either. I wasn't sure if there was a way I could somehow format an array and send it over to Hubitat and get it to graph that. I poked around a bit and Hubitat isn't really setup for displaying generic data, it really tends to think of it as a sensor.

But I do see things like Weather tiles that can have an image as an attribute:

Could I build up an image somehow on the Arduino and send that to Hubitat to display? I realize this would require me to develop a child device, which also might be beyond my skillset. Just trying to see what options I really have here that might be relatively easy.

Do you have a Raspberry Pi hanging around no doing much? Even a small RPi Zero W would be enough to run InfluxDB and Grafana... :wink:

I am not aware of any way to transfer an image from a microcontroller to the HUbitat hub, unless you figure out how to use Hubitat's File Storage feature. Then, display that image file from a browser/dashboard?

Sending the data to a Google Sheet would be a pretty slick way of doing it as well.

Nope, unfortunately not. Maybe one day I will take the plunge and do get one and figure out how to do all that. But for me right now, that sounds like a lot more time than I want to put into it just to get a simple graph going. It's probably easier than I am fearing. But I want to get this project up and going ASAP, so I'll just deal with all that later.

1 Like

I've been using ThinkSpeak to log data from a couple of my application. Not specifically HubDuino based but I bet you could get it to work. Here is an example logging the environment in my crawlspace;

Screenshot 2023-01-14 081545

OK, I thought I would share back with the community what I've got working. As of this morning all is going well with phase 1 of my (evil) plan.

I can now automate the flow of water to either the pond or the house, and have rules in place to make sure the house gets a good water supply while the water softener is running. I'm not yet monitoring the level of the pond, that will come later, but the ESP32 is doing it's job and sensing whether the pump is running and monitoring temperature. I also came across Quick Chart, which is VERY easy to use for charting basic data. Installing it was a bit of a head scratcher, but once in, it was very intuitive to use.

Here's my pump house (before cleaning up the wiring):

And the dashboard I quickly created:

Thank you very much for all the help, I'm really excited about evolving this, but this is miles ahead of where I was.

4 Likes

So very happy to hear and see the fruits of your labor. Thank you for sharing your project. Very nicely done. Enjoy!

2 Likes

Dear ogiewon,

Is it possible to use hubduino with sensors not yet listed in on the github? I mean, to send arbitrary variables.

I'm using it with bme280s, and works like charm (esp8266), but I'd like to use it with Sensirion SCD30, which gives CO2, Temperature, and Humidity. It has I2C interface and very easy to implement due to the available libraries.
So actually I have 3 float variables that I wish to send over to Hubitat.

Is it possible?

Best regards,

Gergő

It is pretty easy to simply add a new sensor device class to support a new sensor. Just start by copying the PS_AdafruitBME280_TempHumidPress.h and PS_AdafruitBME280_TempHumidPress.cpp files to new ones named for the SCD30 sensor. Then, simply modify all of the internal code to use whatever library is needed for the SCD30. The Temperature and Humidity will be easy to handle. CO2 may be a little tricky... It does appear that Hubitat now does support a Capability called CarbonDioxideMeasurement with a numeric attribute of "carbonDioxide". I would need to add support for that in the Hubitat HubDuino drivers. That would not be too difficult, if you can handle the Arduino code side of things. Let me know how you'd like to proceed. Sounds link a decent addition to HubDuino!

Wow! That is one pricey sensor, eh? About $60 USD from vendors here in the USA. I was tempted to purchase one and simply add support for it... but not for $60! :slight_smile:

Of course... If you want to send me one, I could add support for it to HubDuino for you... :wink: :thinking: :sunglasses:

I've justified my purchase with the fact that I'm doing it for the sake of my family's health.
:slight_smile:

Easier to press the pay with Paypal button this way.

Will try it as soon as I manage to have some free time.

Thanks for the detailed help.

Gergő

2 Likes

I have been trying to get "ST_Anything_Multiples_ESP32WiFi.ino " to compile on my ESP32, but keep getting the following error. Has anyone experienced this?

I am using Arduino 1.8.16 & ESP32 V1.0.6

Arduino: 1.8.16 (Windows 10), Board: "ESP32 Dev Module, FTDI Adapter, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, Core 1, Core 1, Verbose, Disabled"

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp: In static member function 'static void st::SmartThingsESP32WiFi::WiFiEvent(arduino_event_id_t)':

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WIFI_READY' not handled in switch [-Werror=switch]

   switch (event) {

          ^

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WIFI_SCAN_DONE' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WIFI_STA_STOP' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WIFI_STA_AUTHMODE_CHANGE' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WIFI_STA_GOT_IP6' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WIFI_STA_LOST_IP' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WIFI_AP_START' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WIFI_AP_STOP' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WIFI_AP_STACONNECTED' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WIFI_AP_STADISCONNECTED' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WIFI_AP_STAIPASSIGNED' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WIFI_AP_PROBEREQRECVED' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WIFI_AP_GOT_IP6' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WIFI_FTM_REPORT' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_ETH_START' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_ETH_STOP' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_ETH_CONNECTED' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_ETH_DISCONNECTED' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_ETH_GOT_IP' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_ETH_GOT_IP6' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WPS_ER_SUCCESS' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WPS_ER_FAILED' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WPS_ER_TIMEOUT' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WPS_ER_PIN' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_WPS_ER_PBC_OVERLAP' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_SC_SCAN_DONE' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_SC_FOUND_CHANNEL' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_SC_GOT_SSID_PSWD' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_SC_SEND_ACK_DONE' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_PROV_INIT' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_PROV_DEINIT' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_PROV_START' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_PROV_END' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_PROV_CRED_RECV' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_PROV_CRED_FAIL' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_PROV_CRED_SUCCESS' not handled in switch [-Werror=switch]

C:\Users\matts\OneDrive\Documents\Arduino\libraries\SmartThingsESP32WiFi\SmartThingsESP32WiFi.cpp:72:10: error: enumeration value 'ARDUINO_EVENT_MAX' not handled in switch [-Werror=switch]

cc1plus.exe: some warnings being treated as errors

Multiple libraries were found for "WiFi.h"

 Used: C:\Users\matts\AppData\Local\Arduino15\packages\esp32\hardware\esp32\2.0.6\libraries\WiFi

 Not used: C:\Users\matts\OneDrive\Documents\Arduino\libraries\WiFiNINA

 Not used: C:\Program Files (x86)\Arduino\libraries\WiFi

 Not used: C:\Users\matts\OneDrive\Documents\Arduino\libraries\WiFiEspAT

exit status 1

Error compiling for board ESP32 Dev Module.



I'll prepare the Arduino code and send it to you in the forthcoming days. I'd be grateful if you could include the CO2 in the Hubduino drivers.

I'm controlling the central ventilation system with multiple parameters (season, inside and outside temperature, humidity, on demand override), but an important parameter is missing, the CO2 level. I think others would benefit from this addition too.

Thank you,

Gergő

I have added support for Hubitat's "Carbon Dioxide Measurement" capability to the latest "HubDuino Parent Ethernet Beta" driver code.

See this post for instructions on using the new version which should eliminate the need for most of the custom Child drivers from HubDuino.

This is a breaking change, however you can run old parent devices running the "HubDuino Parent Ethernet" driver alongside a new parent device running the "HubDuino Parent Ethernet Beta" driver. Be sure to install the new parent driver, along with all of the new custom "hubduino-component-{name}.groovy" drivers on your hub. All of the new code is in the GitHub repo.

I tested the CO2 measurement support by simply adding a PS_Voltage device, and using the new child device name "carbonDioxide1" as shown below.

 static st::PS_Voltage             sensor1(F("carbonDioxide1"), 10, 0, PIN_WATER_1, 0, 1023, 0, 3300, 1, 100);

Doing so, the HubDuino parent device created a new child device using Hubitat's built-in "Generic Component Carbon Dioxide Detector" child driver.

So, as long as your new ST_Anything device sends its three measured values, using the standard naming convention ("temperature1 55.1", "humidity1 43.2", and "carbonDioxide1 123.4"), all three child devices will be automatically created on the HE Hub for use in whatever Apps you'd like.

1 Like

Has anyone else had issues with servos jumping position?
I have an ESP8266 driving 4 servos - mostly they work beautifully, but I've noticed that sometimes they seem to jump randomly.
I think I've spotted it happening today. I'm using a slow speed - the default rate is set to 30000. It seems to be that when instructed the servo moves to the correct position, then jumps randomly at full speed to another angle.
I've seen this happen three times when the servo was directed 180 deg/100% and it then jumped to around 40% once and 60% the other time.
When you next direct the servo to move, it jumps to 180, then moves slowly to the required position.....
I've not seen it happen when directed to angles other than 180, though that may just be chance.
Does this ring any bells with anyone?
Cheers,
James

Yes I had exactly the same problem you describe across multiple ESPs/servos. Even across types of ESP boards, NodeMCU and D1 minis. In some locations I have 1 mcu controlling 2 servos on different GPIOs and 1 servo would exhibit this behavior and the other wouldn't.

My blinds required 270 degree servos for full range of motion, so the specified angle was different, but the issue still occurred occasionally.

I have been using this setup for several years and it would occur 1-3x/week and only upon opening. Moving from 0 to 90 degrees, never from 90 to 0

It did seem that the problem became worse using slower speeds. 4000ms

Not suggesting that you do what I did as Hubduino is a great project, but I have since switched them all to Tasmota and no longer have the issue. :man_shrugging: I can DM you the relevant post on Tasmota/servos if you want.

Good to know it may not be something I've done wrong! TBH I had not realised that Tasmota was set up for servos too. I guess I might move over to that - I do already use it for some other things.
The documentation I've found (HOWTO control servo motors · Discussion #10443 · arendst/Tasmota · GitHub) only shows it driving 2 servos, and I have 4 on one esp8266, but I ought to be able to work that out, it just looks like it may take a bit of getting my head round.
I don't suppose anyone out there has got the the bottom of this issue in HubDuino? TBH I would rather stick with that......

That's the example I followed, using a variation of the first wiring diagram (v5.1.2).

I did not use the MP1584/separate servo power.

I wired the servos (1 or 2 per ESP in my case) power and ground to the ESP USB 5V/GND pin and the servo signal line direct to a gpio.

The Tasmota web interface is a little wonky with 2 servos but it does work flawlessly with commands from Node-Red in my case. No odd movements in several months.

Ok, so I've got a button sketch running on an esp8266 and have established communication back and forth. What I'm trying to figure out now is how I can establish trigger behavior on the esp8266 based on data sent from the sendData function on Hubitat. I can see the data in the serial monitor, but so far I haven't been able to get anything to react from the message.

Great!

Typically, a Button sketch is designed to transmit data from the microcontroller to the HE hub. Receiving data from the Hub isn't going to be parsed into anything actionable, as the IS_Button device will simply ignore it.

It appears that it has been a few months since we last discussed any of this. Please update us on your goals for the project so we can assess the options available.