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

II got my windowshade.cpp to compile and created an sketch that uses it...However It will not create a Child Device as it says there is no handler

I have loaded the Child Window Shade driver from your github
and I've tried

static st::IS_ShadeControl sensor1(F("windowShade1"), PIN_TOPSWITCH,55000,0,47000, true, true, PIN_MOTOR_OPEN,PIN_MOTOR_CLOSE, PIN_MOTOR_ENABLE, 1000, open, false);

static st::IS_ShadeControl sensor1(F("window1"), PIN_TOPSWITCH,55000,0,47000, true, true, PIN_MOTOR_OPEN,PIN_MOTOR_CLOSE, PIN_MOTOR_ENABLE, 1000, open, false);

and several other names .

What is the magic link between the name in the object creation and whats in the Driver code ?

Also, side q, I tried adding a serial print in the constructor and I never saw it...is that not possible?
Thanks

arg....somehow its showing up now..... with windowShade1

I guess I would still like to understand the link....do I look at a capability, lower case the first word and remove spaces??

Look near the bottom of the Parent Driver code, and you’ll find a section of code ( createChildDevice() ) that uses the device names found in the sketch to figure out which child driver to use.

thank you !!

1 Like

Are you using a stepper motor for your shade or a servo?

Do you mind sharing your code?

simple DC motor and cheap motor controller L298N and mechanical switches
I'm happy to share my code...but give me a day or so...working out the bugs
Here is the schematic
image

Ok no rush.

What causes multiple child devices to be created when there is in fact only 1 ?

It appears you named it three different things.

windowShade1
windowShade11
windowShade12

Look and the child devices’ device network IDs.

Figured out the multiple shades and got things working correctly. Was thinking it would be nice to be able to use preferences to set the up time limit and down time limit.

Is there a way that you can have 2 way communication on preferences....for example the arduino code set the uptime to 55 seconds and that is seen in preferences on groovy, but if I change preferences uptime value to 45 it would be sent to the arduino....There is things for Set Position which I cannot figure out where that comes from as I dont see in the groovy code...but is that 2 way communications?

2nd q, if I wanted the arduino to send up the elapsed time to go up on the devices page like the shade status how do I do that ?

sorry for so many questions...but complete amateur.

does anyone know how to get rid of some of the command boxes (they are coming somehow from adding
capabilities window shade;

for example Set Position and Start Position Change ?

Those are added automatically by the Hubitat platform. There is no way to remove them when using standard capabilities.

making progress but a few more q's
i dont think refresh() is getting called in the arduino code even though

so I could have some information for the device ( in yellow)

but if I refresh the browser those go away
image

is that right? is that a function of refresh() not running?

thanks for all the help

Looks like you have created some custom attributes, but did not declare them as such in your custom driver. If not declared, they are temporary. Also, they will not be visible in RM as a custom attribute.

The ST_Anything’s internal refresh happens automatically, unless disabled in constants.h as you have shown above.

For things like “timeouts” that I assume you want sent to the microcontroller, you should probably implement them as a user setting, rather than as an attribute.

Ah...i had them as attributes but had the wrong spelling....so I put the right names
image
what I didn't expect is that I had to add windowDCShade also for it to be persistent

my goal was to be able to set the value BUT also get feedback from the arduino that it was changed ....

my next issue is that on the dashboard... it used to show a very cool shade and when open it would show a sunshine and then when I closed it ...the shade showed it closing

but now it shows
image

I have picked the shade template in the dashboard and the device has "window shade" capabiity...
so not sure what exactly ties it together

You’ll need to make sure your device driver updates the Window Shade capability’s attributes. If they are blank, then the dashboard won’t have any data to display.

OMG, thanks so much .......your experience and knowledge knows no bounds!
Yaaaa, I now have the cool icon of the shades now and everything seems to work.

Now that my shade "fits your architecture", I can now add the light sensor and motion sensor.....
Thanks sooooo much.

1 Like

Completely different topic : )
Thinking of making a water sensor..with a D1 mini.. if I want it to be wall powered this is very simple..... use a contact sensor and done

If I want to make it battery powered....there is sleep modes ....a few questions
to save power can I turn off wifi until I want to talk to hub -my thought is only

  1. once an hour to report in (maybe less) -
  2. when transition to web
  3. when transition to dry

Can I just make this value as high as I need for
" Max time w/o HubDuino update before setting presence to 'not present'"

Would a "contact" made up of 2 wires with a gap with water spanning the gap, be able to bring the chip out of sleep mode?

If so, you could make a water sensor for $5 excluding the battery

thanks
Tim

On a side note, did Samsung get out of the sensor business? You can't buy their water sensor or anything else

Aeotec makes the old Samsung sensors and hub these days.

https://www.amazon.com/Aeotec-SmartThings-Battery-Powered-Compatible/dp/B095TR9NYR

That setting only affect whether the Parent device shows as “present” or “not present”. If you don’t use this attribute for anything, then you can safely ignore it. For a device that uses Deep Sleep, I wouldn’t think the Parent’s presence status would be all that useful.

Yes, possibly. You’d have to test it.

If you try using the ESP8266’s Deep Sleep mode, you’ll basically only need to configure the “setup()” routine in the sketch. The loop() routine will never get a chance to be called, as the last statement in your setup() routine will be to put the device into deep sleep.

1 Like