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

Ryan,

I had the same thing happen just over a week ago when my Hubitat hub locked up. This is the first time the hub became so unresponsive that i was forced to pull the plug on it. Afterwards, both of my HubDuino boards, one an Arduino Mega and the other an ESP8266, both refused to reestablish communications with Hubitat. I had to power cycle both boards.

Unfortunately, I do not understand why this is happening, nor do i have any ideas on how to resolve it. Without the ability to reproduce this issue on demand, it will be very difficult to troubleshoot.

Dan

Okay...as long as you're seeing it too, then I'm not totally crazy (just partially). If you do find a possible fix, I'd be happy to help test it out for you. If not, at least I know what's required to fix it. Thanks!!

1 Like

@ogiewon Can this be used for window blinds? Looks like the servo library is min or max for the title. Right now I am using jetpuf's ESP8266 / Arduino servo controlled smart blinds. Looking at moving everything over to Hubitat.

I have not tried using HubDuino/ST_Anything for window blinds. I believe @Ryan780 has done so. Perhaps he can share his experience?

The servo support is very basic at this time. I added it for a ST User who wanted to make his own smart air vents.

If you're happy with your current smart blinds solution, why not simply port it over to run on Hubitat? There aren't too many changes necessary for most Apps and Drivers.

Porting it over may be over my head. I feel conformable changing bits but writing anything new would be over my head.

I just looked at his code and he is also just mapping a dim level from 0 to 100 to a servo positions from 0 to 180 degrees.

HubDuino should work fine.

I will see if I can figure this out this weekend. Thanks Dan for looking into it.

All of mine are running on the native Hubduino servo library now. Runs much faster and is able to close them much tighter.

However, fair warning, depending on your motion sensors, your blinds might set them off. I have to have my blinds set to never change when HSM is armed because the Iris motion sensors are sensitive enough to pick up that motion, even across the room. I actually set mine off the other day that way, accidentally. So, I would be careful about adjusting them while that's armed.

1 Like

Do you have it setup for just open and close? The way I have them setup now with smartthings is they kinda act like a light dimmer. I am able to adjust them. I haven't got a chance to look at the servo portion of the code yet, but will this weekend. I just got my HE hub and haven't yet started switching things over.

2 Likes

My Servo implementation treats them like a dimmer. In fact, it only has a dimmer value. No On or Off support. You'll be able to adjust them from 0 to 180 degrees (using dimmer values of 0 to 100). Also, there is an optional parameter in the sketch when you declare the servo device as to whether or not you want power removed from the servo after the move is complete. This helps to prevent servo buzzing...

1 Like

Just be careful trying to set them to 0. Because normal dimmers just turn off when you send level 0, I found it was easier to send level 1 to get them to close down completely. I can't tell the difference between them. Also, 99 works better than 100 for full tilt up. I found that a timeout of 500 to 800 works good for my servos. Anything lower and they weren't finishing executing the command every time, especially if rotating a large percentage.

2 Likes

Okay, I've been hunting around and for the life of me I can't see where you're controlling the timing for the RSSI updates to the hub. I wanted to push those out to 5 minutes too. I know it's going to be a "face-palm" moment when you tell me but I'm throwing in the towel.

Take a look in "SmartThings\SmartThingsEthernet.h" and you'll find the following section of code...

//Adjust the RSSI Transmit Interval below as you see fit (in milliseconds)
//  Note:  When the board first boots, it transmits frequently, then slows over 
//         time to the interval below.
#define RSSI_TX_INTERVAL 60000

Note, when you boot up the microcontroller initially, the RSSI values are sent much more frequently. They keep getting slower and slower until they eventually are repeated at the interval defined below. My thought was that after a power up, you might want to move the device around to see if you could improve the WiFi signal. This would require frequent updates. But later, it was fine to reduce those updates to once a minute (or longer.) The logic for ramping the transmit interval and sending the RSSI values is within the SmartThingsESP8266.cpp or SmartThingsESP32WiFi.cpp

1 Like

Sweet...I will take a look. Thanks!

2 Likes

I am unable to find the parameter for removing power from the servos. Unless its in EX_Servo.h ?

Other than that, its working. Thanks for the great write up!

At the top of each device class' .h and .cpp file you will find the documentation for the object's C++ constructor (which is what you're calling in the sketch's setup() routine.)

As you can see below, there is a 'detachAfterMove' parameter. Simply set that one to 'true' when you define the device. You can also adjust the 'servoMoveTime' parameter to give your servo just enough time to move a full 180 degrees before power is removed from the servo.

Here is a simple example of a servo that will turn off it power after 1000 milliseconds

st::EX_Servo executor1(F("servo1"), PIN_SERVO, INITIAL_ANGLE, true, 1000);

//******************************************************************************************
//  File: EX_Servo.h
//  Authors: Dan G Ogorchock
//
//  Summary:  EX_Servo is a class which implements the SmartThings/Hubitat "Switch Level" device capability.
//			  It inherits from the st::Executor class.
//
//			  Create an instance of this class in your sketch's global variable section
//			  For Example:  st::EX_Servo executor1(F("servo1"), PIN_SERVO, INITIAL_ANGLE, false, 1000);
//
//			  st::EX_Servo() constructor requires the following arguments
//				- String &name - REQUIRED - the name of the object - must match the Groovy ST_Anything DeviceType tile name
//				- byte pin_pwm - REQUIRED - the Arduino Pin to be used as a pwm output
//				- int startingAngle - OPTIONAL - the value desired for the initial angle of the servo motor (defaults to 90)
//              - bool detachAfterMove - OPTIONAL - determines if servo motor is powered down after move using following timeout (defaults to false) 
//              - int servoMoveTime - OPTIONAL - determines how long after the servo is moved that the servo is powered down if the above is true (defaults to 1000ms)
//

Thank you Dan! You're awesome!

1 Like

So my blinds work as a dimmer great. And show up in google home as a light. The dimmer works great. I am able to adjust from fully closed to fully open. How can I setup the on/off to open and close them? I would like to have off set them to 12% (fully closed for me) and on set to 45% (fully open)

That's a good question... Right now, the Child Servo Device Driver only supports Dimming, not on and off. You should be able to modify it to add in the Switch Capability, and then simply handle the on() and off() commands to set the dim level to 45% and 12% respectively.

Are you a groovy programmer? Can you make these changes on your own? Or would you prefer some assistance?

I am not, but willing to try. I will see if I can figure it out.