Is there a user wiki? If not could there be? example entry, "Schedule"

I've been using my Cx since mid 2018. I'm not a programmer by trade so everything I write I rely on examples and help from the community and ST classic documentation.

Being a noob at writing Hubitat App and Drivers (notice "App" is singular) I have a noob outlook on all things groovy/Hubitat. In addition, the coding I did learn was pre Object Oriented Programming, so I needed a shift in mind set.

What I learn by doing, reading and following I create notes for. By necessity these notes are more detailed that what is currently available. See an example below, yes I added some embellishment so others could understand it, and there maybe mistakes. However I feel if there was a User wiki I could add this explanation which I feel would be very helpful to the community. At least until the official documentation gets updating, or some writes a book " Advanced Hubitat for Dummy's"

Would others like such a resource? Is it practical for the Hubitat folks?


For instance I learned about creating a schedule
V1.0 (if found useful I expect there will be changes/corrections)

Goal:
I wanted to verify my automated valve was still communicating with Hubitat. I wanted to check this once a day. I found the schedule function was a good choice.

Schedule simply creates a kind of alarm in the Hubitat database. Each time the "alarm" goes off the referenced method will be run. In this example the schedule will run my "connectCheck" method.

The code to create a schedule is simply one line:

  def updated(){
      schedule("0 0 6 * * ?", connectCheck)	// once every day at 6 AM
    log.info  "schedule created for checking valve"
  }

The schedule command i.e. schedule("0 0 6 * * ?", connectCheck) needs to be run only once. It can be put anywhere you like as long as it runs to set the "alarms"

To remove a schedule simply use:
unschedule(connectCheck)

Method to be run in this example:

void connectCheck(){
	// updates lastactivity so App "Device Activity Check App" will know its still communicating.
    sendToDevice(zwave.basicV1.basicGet().format())
}

syntax:

   schedule ( time as a cron constant, method to be run)
  • time as a cron constant. cron is a carryover timing format form UNIX. It's rough format is:
    seconds (space) minutes (space) hours ....etc
    There are a number of web pages that will convert whatever timing you wish to a cron string. Just google Cron String or cron timing etc.

  • method to be run simply the name of the method that you want to run at the cron intervals.

3 Likes

This has been proposed a few times in the past and nothing has really come of it, but I know lots of us think it would be great. (To be clear, I don't blame Hubitat staff for prioritizing their own development on the platform--things that will help the majority of end users in the long run, not a minority of their uses who happen to use its development capabilities at the moment. I am just doing some wishful thinking.)

I don't really care what format it's in, and I don't really care who hosts it (it would be great if Hubitat could host their own ReadTheDocs or something, though a wiki like their existing Mediawiki would be fine too except that I'm not sure most are really meant to flow in a good way for this kind of thing)--but obviously Hubitat hosting it would be better than the community paying to host it somewhere on their own. I'd probably contribute what I could, but I'm not sure I feel like starting or hosting something on my own--as much as I like the platform, I don't work for them and this would feel a lot like that. :rofl:

I envision something like the "classic" ST docs that have small starting points and explanation of basic apps and drivers and then "advanced" documentation for app, driver, and common methods and whatnot--the latter of which is basically already what their docs wiki has, albeit not fully documented. Even a mini "getting started" app or driver tutorial would probably be good enough, and bits of pieces of that might even be able to done in a wiki forum post or few (not sure if we can set our own posts to wiki mode, but staff can--but I'm still not sure a forum post has the best "flow" for this kind of thing, where a page to page flow with small chunks would probably be best).

But that's just what I'm thinking...not sure what anyone else who's proposed this had in mind. :smiley:

4 Likes

Thank you for you comments. I understand that saying something and doing something are worlds apart.

How about a new community category. After saying that I'm not sure how it would work as well. Perhaps I have too high and expectation the such a category won't get flooded with other posts.

Don't know. But I do see folks like yourself who have probably answered the same question a number of times. Each time the knowledge is buried in a sea of other questions.

I'll keep thinking................ :zzz:

2 Likes

I've had the same thoughts at different times, and so completely agree with your comment about saying and doing....

It can be difficult to trawl through various threads, some quite old, to get the current consensus on different recommendations or how-to's. Distilling these down to a single or handful of methods for doing something, opinions on products, etc would be incredibly useful, not just for new users. There is so much you can do in HA, it can take a while to get around to some things that some have been doing for years and captured in long-running threads.

Perhaps the approach to adopt is "build it and they will come"? Pick a platform or way to capture articles and if it is the right way and valuable people will adopt it or suggest an alternative and it can be adapted.

In terms of working with what we already have, I have tried to document as much of my setup as I can in threads on the Community for others to benefit from, at least the more complicated or interesting aspects. That is at least a good start. And including references in your posts to other threads is also a good way to help people find out about previous conversations and ideas.

While I'm probably not the best one to offer up a suggestion around the best platform or place to host a wiki, I would be happy to contribute in some small way.

Simon

3 Likes