There is a mechanism by which you can solidify some of the scheduling issues in SmartThings, the ones involving repeating schedules, such as polling. The mechanism is to give your system an external time source.
My setup happens to have an Arduino / ThingShield, for my Lutron integration. It was trivial in the Arduino sketch, and the ThingShield device handler, to put in a once a minute message from the Arduino. This is not clock resolution timing, for sure; but it is heartbeat timing that is rock solid. I would not recommend running something like this faster that once a minute.
I have mine set to toggle a virtual switch. I can use that for other purposes, in Rules.
You could build this out of any Arduino / ThingShield pair, including Uno, Mega, etc. It costs $80 +/-.
Oh, I see, this is how SmartThings is going to make money. The $99 hub cannot keep time, so you have to buy a $35 ThingShield and an Arduino to complement it.
3 Likes
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
3
Indeedā¦ probably much less; $35 for the shield, $10 for a clone Unoā¦
For a little more, you can add an āvery accurateā RTC (Real Time Clock chip) with a battery (there are semi-accurate ones, and very accurate ones). And, Iām typing this quick so too lazy to look, but Iād bet a ācronā library is available.
So hereās a very feasible project:
A āCRON Device Typeā (based on Arduino with RTC , a cron or similar scheduling library, and a ThingShield to receive schedules and send schedule triggered event calls.)
Alternatively build using a small Linux instance on rPi or PC type and use REST-API and Service Manager SmartApp to receive the calls. Then you could run real Linux CRON.
And 3rd alternative is to use a cheap hosting service (< $1.00 month) to do the second option.
SmartThings wonāt be too happy if we āpound itā with incoming Events ā¦ but, heck, the Power Usage Events from the ZigBee Centralite / SmartThings Power Outlet are super frequent anyway.
Hmmmmā¦
Iād better a dozen readers of this could whip this up in a couple days, with a couple weeks of tuning and features to make an MVP.
Yep. This isnāt very hard to do, and as you say, if you want a real clock, thatās not hard either. Then, someone could write a simple scheduler app on the Arduino, as you suggest, and just move this challenging-to-ST task from the cloud to a $25 computer.
This is all funny, of course, but in all honesty, I feel sorry for SmartThings engineers who seem to have no pride in what they do for a living. How difficult is it to write a virtual RTC device that runs locally on the hub? I bet it would take me less than two days.
Of course it knows the time. Itās running Linux kernel after all. Thatās why it would be extremely easy to do.
2 Likes
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
16
Itās my contention that at least most of the āengineersā are competent and proud of what they have accomplished as a wholeā¦ But they are constrained by management and/or legacy architecture defenders. Itās a dysfunctional organization.
Sure, but donāt you think those who willingly work for a ādifunctional organizationā are prostituting their profession?
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
18
Oh itās all relative. I think I might have greater reservations working for a Bank or military contractorā¦ Or not. Ya gotta make a living and folks are pretty good at ācontainerizingā the scope of their responsibilities. Itās healthy.
[quote=ābravenel, post:1, topic:38398ā]
You could build this out of any Arduino / ThingShield pair,
[/quote]I bought the Uno and the ThingShield when I bought my hub, but I never found a use for them so this works out perfectly.