Building a device with CoRe question


#1

Hello-

I’m working on a project putting together a simulated thermostat. Is it possible for me to just create the shell device type and have CoRE provide the functionality of each tile? I made a prototype but CoRe only sues the main device, not the individual tiles in the interface. So it doesn’t seem as though anything other than the basic on/off of the main device is possible. Is there something I’m not seeing or do I need to have a special setting in the creation of the DTH? Or is this just not possible? I tried in both the CoRe and WebCore apps. Forgive my ignorance, this is my first stab at building a project from scratch.

Thank you,
JD


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #2

CoRE can do “anything” (ok, that’s an assumption, but I’d bet I’m not wrong)… There’s a word in computer science for that, and gosh darn if it’s not coming to me right now.

However, for something as specifically contained as a Virtual / Simulated Thermostat, it is worth considering more efficient custom code,… And it’s not particularly complex code relatively.

In fact, there are a few Virtual Thermostats developed by the Community which you can tailor as desired. Do some Forum searches?


#3

Thanks for your reply. I literally have been searching for days. I wrote a whole thing about it in a post last night. and i was kind of at wits end. When I saw no replies, I started thinking and reading some more and that idea came to me. Perhaps I’m searching for the wrong thing. I’m usually pretty good at quickly finding solutions and answers but it’s possible that my question is flawed since I’ve not attempted a project on my own till now.

Since what I’m attempting only requires polling one temperature sensor and sending commands via URL, I don’t know if efficiency or lack thereof would make that huge a difference in this particular case. Please though, if you have any suggestions on where I can at least begin searching for a better idea or an answer to this one, it would really be a huge help because I’m really not sure.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #4

A quick 3 minute search doesn’t yield a conclusive answer, but perhaps a good starting point(s):


This one involves NodeMCU ESP8266, which therefore likely uses a URL / REST-API


This one is a skeleton, but only turns on a Switch … so, you would either change the switch triggering code to call the URL endpoint, or use a Virtual Switch to http call SmartApp (there are a few of those!)


Another DTH skeleton… not sure if better or worse than the previous:


###My Recommendation?
Unless you are super tight on time and don’t want to make a “learning exercise” of this, then a Thermostat is not super difficult DTH to build from the right template.

  1. I’d recommend building a simple Virtual Switch DTH (with synchronizing SmartApp) first, as that basic practice is needed to understand the IDE, syntax, debugging.

  2. Make your Virtual Switch call a URL / REST-API for on() and off() commands. i.e., Study the simple http() commands, not the entire chapter on Web Services / Cloud Device Types: http://docs.smartthings.com/en/latest/ref-docs/device-handler-ref.html#httpget

  3. Then port your knowledge from 1 & 2 to the Thermostat template.


(Nigel Linnett) #5

Are you thinking of Turing Complete?


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #6

That’s it! :bellhop:


#7

I’m not sure whom a "quick “3 minute” search is quoting, nor how that might be inferred from “literally have been searching for days” but what I did mention was that I’d already started work on a DTH and was merely inquiring if perhaps what I was searching might be the problem. I do appreciate the links and I’ll take a look. I didn’t mean to put you out.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #8

I’m sorry; That wasn’t my intended tone, Jerry… :sweat:

It’s my pleasure to try to offer folks a possible starting point, but I feel bad when I can’t find a conclusive answer during a quick response. So that’s why I prefixed my search results describing the limited time I had invested.

So… [quote=“jerrydiaz11, post:7, topic:86356”]
was merely inquiring if perhaps what I was searching might be the problem.
[/quote]

My intent was that by sharing my own search results it might indicate if we’re finding the same dead-ends or maybe I found something to help.

That’s all!
Cheers,
…Terry.


#9

I’m sorry man. I misunderstood. At some point during this exercise my Simple Sync connection got disabled … since last night its Trigger smartapp is only pulling a completely blank interface and I’m pulling my hair out. I’m just frustrated and I took what you said the wrong way. My apologies. Thank you for real though.