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

No luck :frowning:

Please don’t try to Upload this sketch to your UNO WiFi Rev 2 board. Simply click the VERIFY button, not the UPLOAD button. We’re trying to only see if your libraries are set up correctly. Let’s see if that compiles successfully. You don’t even need the Arduino plugged in to perform this test.

I am pretty sure that your board is not going to work without code modifications. I don’t foresee supporting your particular board any time soon, due to the issue I found with it back in April.

As for what other boards are available... there are many to choose from, but it will depend specifically on your requirements and the exact models of devices you’d like to use. The list of supported boards can be found in the ReadMe, near the beginning.

2 Likes

Greetings to you.

Dan, refer to "ST_Anything_Servos_ESP8266WiFi", the signal going to servo from ESP8266, is it duplex or simplex? The reason I am asking to know if any signal from servo is being sent to ESP8266. If not, I might use logic circuit to operate multiple servo with one signal by using buffer circuit without changing the signal. Comment please.

What exactly are you trying to accomplish?

The current EX_Servo software allows for control of multiple EX_Servo devices simultaneously. So, if controlling three different window blinds, all three will move at the same time.

Hope that helps.

Dan, thanks for replying me. I need to control 7 windows blinds but with one ESP8266 I can run 5 motors efficiently. So, wondering if I can do parallel operations for remaining 2 with any two of the 5 servo motors. Otherwise, I will need add one more ESP8266.

As long as you provide sufficient power, I believe you can run all 7 servos off of one pin if you really want to. The output signal is simply a pwm square wave that is used by the Servo motors as a position target. There is no feedback to the ESP8266 from the Servo motors.

1 Like

Got it thanks for the suggestions

Before I screw something up, I thought I'd ask: is it possible to create multiple executor devices that use the same Arduino output pin? I'm still playing with WindowShades and looking for a way to open or close them halfway. I'm wondering if it is possible to create a second WindowShade device to control the same shade, but with different values for the momentary relay timing. It would be better to have a single device with multiple virtual buttons in the Hubitat interface, each with different timings, but I'm not sure that's possible, so this is the workaround I'm considering. Thoughts? Will it work? Is there a better way?

It may work. Give it a try and let us know how it goes. Obviously activating multiple devices that control the same output pin will result in unreliable behavior.

You could create your own ST_Anything Device class that implements exactly the logic you desire.

That's probably out of my league, but to get a sense of what it would require... if I managed to create an AdvancedWindowShades device class that accepted two additional variables in the constructor (UpHalf and DownHalf), wouldn't I also have to modify the Hubitat device driver to accept those as additional commands/buttons within the WindowShade device on the Hubitat side? (Please excuse my ignorance here...) Thanks!

For the record, it does seem to work to have multiple devices that activate the same output pin, with the caveat you note. If I can't get anything else working, I can at least use the multiple device workaround as an inelegant but functional solution.

2 Likes

Does anyone else have issues with the contact driver/implementation? I often see brief open events (closes again about 400 milliseconds later) that happen "out of nowhere". Causes a lot of false alarms on HSM.
thinking about modifying the sketch to ignore open events of less than 500 ms.

Not saying that there is anything wrong with the code, BTW. Pretty sure it's a hardware issue

1 Like

Sounds like you may have a wiring or magnetic reed switch issue causing things to be on the hairy edge of stable.

You can adjust the debounce feature of the IS_Contact device in the sketch without having to make any major code changes...

The last parameter is the number of times through the loop() routine that a sensor has to stay in a new state before data will be sent to the Hubitat hub... Try increasing yours to eliminate spurious data.

For example, from the following

st::IS_Contact sensor6(F("contact1"), PIN_CONTACT, HIGH, true, 500);

to

st::IS_Contact sensor6(F("contact1"), PIN_CONTACT, HIGH, true, 5000);

Here is the documentation for the IS_Contact device...

//******************************************************************************************
//  File: IS_Contact.h
//  Authors: Dan G Ogorchock & Daniel J Ogorchock (Father and Son)
//
//  Summary:  IS_Contact is a class which implements the SmartThings "Contact Sensor" device capability.
//			  It inherits from the st::InterruptSensor class.
//
//			  Create an instance of this class in your sketch's global variable section
//			  For Example:  st::IS_Contact sensor6(F("contact1"), PIN_CONTACT, HIGH, true, 500);
//
//			  st::IS_Contact() constructor requires the following arguments
//				- String &name - REQUIRED - the name of the object - must match the Groovy ST_Anything DeviceType tile name
//				- byte pin - REQUIRED - the Arduino Pin to be used as a digital input
//				- bool iState - REQUIRED - LOW or HIGH - determines which value indicates the interrupt is true
//				- bool internalPullup - OPTIONAL - true == INTERNAL_PULLUP
//				- long numReqCounts - OPTIONAL - number of counts before changing state of input (prevent false alarms)

I had this exact thing happen for one of my contacts and it was a bad reed switch as olgiwon mentioned. Replaced the reed switch and all is well now. Mine would open for almost 2 seconds exactly and it too set off HSM.

1 Like

Thanks Dan!

1 Like

I have a question on using PS_Generic to pass data to Hubitat from within a sketch rather than writing code within getData() routine within PS_Generic.cpp. I have the following code in my Polling Sensor:

static st::PS_Generic barnVoltage(F("barnVoltage"),30,0);

I have added the sensor to the "Everything" Class. The sensor shows up in Hubitat as a child. I have some complex code in my Arduino sketch that reads data from a Victron solar charger/battery via a software read. I was hoping to use the callback routine to trigger this software serial read and pass the data to Hubitat. I am having issues on how I pass a string to Hubitat using the generic barnVoltage sensor in this manner.

If you want to use a complex sketch, I would forget about using ST_Anything. Just use the "SmartThings" library to add Communications to your Hubitat hub.

As long as you send data in the form of "voltage1 120.4", it will work with the existing "Child Voltage" driver.

I don't have time right now, but take a look at the example sketches in the "SmartThings" library instead of the ST_Anything examples.

Thanks for the quick reply. I started down that road and then felt like I should have been using the ST_Anything library as I have a DHT sensor and relay attached on the same board. A bit confusing when first jumping into the 2 different libraries. Switched over from OH and was using MQTT for communication. I saw the myVariable portion of the PS_Generic but I cannot figure out how to get it to pass data (the 8 generic children set up quickly using the Parent/Child auto add). Seems like a quick and easy way to add custom type sensor/sketch data to Hubitat if we could throw generic data in this fashion like the smartthing.send() in the smartthings library. My lack of understanding the whole picture probably a big issue. Are there any examples out there using the generic sensor? Couldn't find any examples via Google, but seems like a powerful tool. Thanks for the great libraries and the work you guys put into this!

Well...that does change things a bit. If you have some devices that work directly with ST_Anything, then I’d keep using ST_Anything.

There are options for either doing your custom voltage logic in the sketch, or you could simply use PS_Generic and customize its c++ code to read you voltage device and send data in the form “voltage1 120.1”.

I am still a little tied up today, but I’ll try to provide some examples of what I am taking about...

Any help would be awesome. Long story short, there are timing issues with the software serial request to the device then answer with a conversion of answer coming from the Victron. They did not make talking to it an easy task for sure. Took a bit of time to get all this worked out on the Arduino side. Not sure how or if "I" could convert it to c++ side of this. It would be best to be able to update PS_Generic from the sketch or send directly to Hubitat an update from the Sketch side. I understand being busy for sure and again thanks for any help you can give here.