very excited to see this - did not even know was possible. I use IR blaster to do similar things but not great result - this would be an ideal soloution for sure. many thnaks for getting this underway - look forward to see how things progress.
Try to find some example plugins on code.mios.com. Some good examples that helped me were WOLPlusPing, WPSwitch and RTCOA_Wifi. Download the code and study it bit by bit, google around for keywords, mine the MiCasaVerde wiki, and it will start to take shape.
Break it down into smaller packages of work you need to do/achieve and it should make it easier for you to find answers.[/quote]
Is there a way to test the “chunks” and is there a way to see what the GUI will display?
Thanks for the tips by the way. Stinks being a Newbie to Luup/Lua :-[ . Took BASIC and FORTRAN like 30 years ago and used to program a TI-99/4A in the same time frame!
Is a momentary switch in this case semantically identical to simply calling an action? A persistent or “stateful” switch is represented well enough by the SwitchPower service, but I think you are just looking for calling actions for clean, spot and dock. Maybe I’m missing something, though.
Is a momentary switch in this case semantically identical to simply calling an action? A persistent or “stateful” switch is represented well enough by the SwitchPower service, but I think you are just looking for calling actions for clean, spot and dock. Maybe I’m missing something, though.[/quote]
If I call an action, how do I create the “button (s)” and label it (them)? Still miles off but inching forward. More reading and searching and stumbling over some “dead ends”.
Go into your Vera web UI to Apps → Develop Apps → Luup files and download D_BinaryLight1.json for example. Read through the file and find the “Control” section. You will see the On and Off buttons for lights there. They probably shouldn’t be part of a ControlGroup since they are not acting like on/off radio buttons like you would have for a light switch, but a lot of the rest of it should be helpful in making your own D_Roomba.json file. Download other D_*.json files for lots of other examples.
I downloaded a Lua command-line interpreter for my desktop OS when I was first starting to get comfortable with it. You could end up with a fully functioning Roomba.lua program for testing purposes, and then copy over bits into your I_Roomba.xml file (or make a Lua module and put the code there). Should make for a quicker edit/test loop than uploading new I_Roomba.xml and restarting every time.
One minor note: to be consistent with other things, you probably want to name your files like I_Roomba1.xml, D_Roomba1.json, etc. I keep forgetting about the “1” in the file names, and don’t want to add confusion.
One minor note: to be consistent with other things, you probably want to name your files like I_Roomba1.xml, D_Roomba1.json, etc. I keep forgetting about the “1” in the file names, and don’t want to add confusion. :)[/quote]
Renamed files as suggested. Have not found a good interpreter for Windows 7 yet. Guess I need to look harder. How can I run and preview json files to see the graphics? That would be helpful!
<?xml version="1.0"?>
function init(x) end -- well, not really but roughly
init
urn:chuck-org:serviceId:Roomba1
Clean
luup.inet.wget("http://192.168.1.10/roomba.cgi?button=CLEAN")
urn:chuck-org:serviceId:Roomba1
Spot
luup.inet.wget("http://192.168.1.10/roomba.cgi?button=SPOT")
urn:chuck-org:serviceId:Roomba1
Dock
luup.inet.wget("http://192.168.1.10/roomba.cgi?button=DOCK")
[/code]
You’re getting there! If I were you I would strip away any services you don’t yet need, and add them in after you have the basics working. Do you plan on having just one device represent just one Roomba? If so, you won’t have child devices so change 1 to 0. Also make sure all your file names are 1) of the proper form, and 2) your references to them in other files are correct. Sadly, programming is not enough like horseshoes and hand grenades.
I am pretty sure I will want to add children later (sensors or other indications of operation available from the Roomba API) but for now I “0-ed” it out.
I had noticed after I posted I had other syntax errors to fix. I bet I am looking through a bunch but once I start testing / debugging they will show themselves. Computers are just so binary, LOL.
Now HOW do I write a json file? Don’t I need graphics ???
I am just about to purchase a board and reside in the UK so very very excited to see how you get on. I think I will use it in Vere in lost of ways but most likel to ensure a clean is only activated when the home alarm is not on and for it to take place ASAP after last clean time missed etc. Lots of possibilities outside of just schedulaed clean etc.
Realy excited wityh you and all on this project - just wish i coudl add more help on the codeing side ???