Simulating a custom device


(Kelvin) #1

I’ve built a simple custom device (arduino based Smart Coffee Maker) and now want to run the device as a simulation without the actual hardware underneath. Is this possible? I would still want access to the extended functions in the device.

Thanks


(Andrew Urman) #2

Hey @kelvin, are you trying to get messages back? The only way to get expected responses back is to use the actual arduino, or to create a custom device type that sets the responses.


(Kelvin) #3

Hi Andrew, no at this point, I don’t need messages from arduino to the ST cloud. I just need the additional functionality of the device (strong and normal) exposed to the ST app so I can develop against the device.


(Andrew Urman) #4

you could create a new device on the device page, add it to your location, hub, give it a fake network ID like “fake”. Then under type, give it your custom device.

If you want to get some good console info I also like to simulate the code in the device handler and select the device. Make sure you use lots of log statements!


(Daniel Consuegra) #5

Hey @kelvin!

Did you succeed in the smart coffee maker?

If so, could you elaborate how you did it?

I have an old nespresso (the one with plastic pods) with 2 buttons, one for power and the other with an led that shows when the machine is hot and starts/stops the water flow…

Being slightly futuristic here, my goal would be to have the coffee pod drop down from its storage into the pod slot in the machine, have the slot close the lid and brew the coffee… and then reopen so the pod falls into the waste container…

Should I go back to dreaming or is this possible at all?


(Kelvin) #6

Hi @danielccm,
We stopped at the level of functionality described above since it was being done for a company demo only. That level of functionality of controlling brew strength and a couple of other features was successful, although if I had to redo it, I would add some feedback to the circuit to ensure that the appropriate control was actually asserted. Especially w.r.t. on/off :slight_smile:

The arduino serial gpio was used to set appropriate signal levels into the control panel. The arduino was accessible on the local lan via the ethernet shield, allowing the device to be controlled from the ST cloud via TCP/IP.

The ST layer is very old and doesn’t reflect the latest API. It was done before much of the API was finalized.
At the ST layer, there is a very simple CoffeeThingShield (https://graph.api.smartthings.com/ide/device/editor/4d08efe6-5fc3-4606-81cc-c0939b2d27b3)
and there is a test smart app which I “think” was used to test this. https://graph.api.smartthings.com/ide/app/editor/1c8fe2c5-df5e-4912-8011-a51fa72af5a2
Sorry, this was done in 2014 so memory fails…
Cheers,
Kelvin

PS, what I really want to build is a robotic drip pourover coffee creator.
PSS, I also have nespresso and find it the best of the pod solutions for espresso!