revised basic_mini views

Posted on
Mon Oct 27, 2008 10:56 pm
seaofclouds offline
Posts: 32
Joined: Dec 11, 2007

(No subject)

jashaffner wrote:
If you have not added back the actions/variables sections, I can go in and add them back.


That would be fantastic! you can contribute through github. just fork my code, make changes on your local machine, do "git push", and send me a pull request. it's a great way to collaborate on code.

if that's too much of a hassle, you can just download the .zip, and contribute as you did before.

Posted on
Mon Oct 27, 2008 11:27 pm
jashaffner offline
Posts: 59
Joined: Jan 14, 2007

(No subject)

Just figured out how to use github and sent you a pull request to merge my changes. Great stuff!

Cheers,
j

Posted on
Tue Oct 28, 2008 2:25 am
seaofclouds offline
Posts: 32
Joined: Dec 11, 2007

(No subject)

thepainter wrote:
Just want to say 'Thanks' it looks GREAT and works really well with my 'Touch'. Thanks again for all the hard work to everyone involved.


thanks for the kind words. just updated again so head to http://github.com/seaofclouds/indigo-mini-view-plugin for the latest!

Posted on
Sat Nov 08, 2008 10:10 pm
jashaffner offline
Posts: 59
Joined: Jan 14, 2007

(No subject)

I am attempting to have this plugin taken to next level, using ajax so that the entire page does not have to be refreshed.

I have managed to duplicate a good bunch of code from IWS and I think I am almost there. I see that controlpages make use of GetControlPageStatus(..). How can plugins make use of this function? I get "requested control page does not exist" in log when I use plugin with the code (functions, xml files, js files) duplicated.

Thanks,
j

ps: since I did not write any new code, how do I ensure that perceptive automation gets the credit for the code I borrow? any license issue here?

Posted on
Tue Nov 11, 2008 11:45 am
matt (support) offline
Site Admin
User avatar
Posts: 21416
Joined: Jan 27, 2003
Location: Texas

(No subject)

jashaffner wrote:
I see that controlpages make use of GetControlPageStatus(..). How can plugins make use of this function? I get "requested control page does not exist" in log when I use plugin with the code (functions, xml files, js files) duplicated.

I believe that error means that a Control Page name was passed to GetControlPageStatus() that does not exist in your Control Page list inside Indigo. Note there isn't a Control Page defined for the mini page, which includes all of the Devices and Action Groups. I think it will be non-trivial to Ajax-ify the Mini page.
jashaffner wrote:
ps: since I did not write any new code, how do I ensure that perceptive automation gets the credit for the code I borrow? any license issue here?

I need to flush out the exact license for the source code still. As long as the code is used for Indigo purposes (versus using the code to create/support a non-Indigo solution), we don't mind you duplicating the code.

Image

Posted on
Wed Nov 12, 2008 5:49 pm
iPhoneDeveloper offline
Posts: 20
Joined: Nov 10, 2008

SeaOFClouds Plugin with sliders for dimmers

Image

Hi SeaOfClouds,

Not sure if you would be interested since your plugin works great already using buttons to dim. But I took your latest and greatest and went into a couple of your main html pages inside the plugin ("m" folder), commented the dimmer buttons, replace them with some DIVS and added a new css and a couple of javascript files and replaced the buttons with a slider dimmer. Again your buttons work great already so not sure if you or anyone would find value to this but I thought I'd post and offer in the spirit of sharing.

I kept to your principle of it has to load fast and be very light. I was concious of this when I designed the addition. On a "normal" browser that supports dragging, it works like you expect. You can drag the slider and change the values. On the iPhone though, you just click anywhere on the rails to get a value between 0 and 100. The knob would then move and refresh the page very much how your buttons work now.

In any case, I use your plugin everyday so thanks! Let me know if you want me to send it to you or whatever.

Ronnie

Posted on
Thu Nov 13, 2008 2:14 am
seaofclouds offline
Posts: 32
Joined: Dec 11, 2007

Re: SeaOFClouds Plugin with sliders for dimmers

hey ronnie -

thanks for your contribution! i love the idea of the slider, and it's definitely something i would like to provide an option for in this plugin.

my first priority is getting these mini views working without reloading the page. jashaffner has begun the endeavor. naturally, i'd want to keep the code as light as possible. i've worked with javascript frameworks, and love jquery, but might opt for something even lighter or more prorietary to make this happen - afterall, we should be able to dim our lights on edge, right? :)

the best way to contribute is with git on github. i realize that's something new to learn if you're not on the git bandwagon already, but it makes developing shared code much more fun! otherwise, you can send me a message through github or here with a link to a zipped archive with your changes.

Cheers!


iPhoneDeveloper wrote:
... replaced the buttons with a slider dimmer. ....

In any case, I use your plugin everyday so thanks! Let me know if you want me to send it to you or whatever.

Ronnie

Posted on
Thu Nov 13, 2008 12:12 pm
iPhoneDeveloper offline
Posts: 20
Joined: Nov 10, 2008

(No subject)

Thanks for the update. I don't want to overlap what jashaffner is working on but let me know how I can help. The way I've done it before to avoid reloading the page is to use an iframe to send the commands then I would just use javascripting to update the main screen. LOL! I just read jashaffner's post closely and will be using Ajax, which is essencially how I would do it. I agree requirement should be edge acceptable. Well, the slider option is independent of this so I could send you that. Let me clean it up fist.

On another note, what do you think about this idea which I can contribute if you want. If we name our devices with a prefix of the zone like "Kitchen - Counter Lights", "Kitchen - Main Lights" then I could modify the page to group them in DIVS so that like your Variable section, it will display a list of zones like "Kitchen", then clicking it will expand and show just the devices in that zone but display the list without the prefix anymore.

This was gonna be my next enhancement when I have down time. What do you think? I will check out github.

Ronnie

Posted on
Thu Nov 13, 2008 1:10 pm
iPhoneDeveloper offline
Posts: 20
Joined: Nov 10, 2008

Re: SeaOFClouds Plugin with sliders for dimmers

seaofclouds wrote:
hey ronnie -
my first priority is getting these mini views working without reloading the page.


Since this was your first priority, I figured I'll take a shot at it. Im not at my development environment right now but I can't wait to try it at home. Playtime is after I get home, after I spend time with the family after my kid sleeps so after 10PM...

Basically, I think all we need to do is:

In the index.html page, insert an iframe right before the end of the BODY tag:

<iframe name="ifAction" style=""display:none"></iframe>

Then on my javascript where I fire the event to send the insteon command which is right now this---

document.location = "setbrightness?device=" + devname + "&level=" + devval

I will then replace with this:

window.ifAction.src = "setbrightness?device=" + devname + "&level=" + devval

Which will then fire off this command on the hidden iframe and the main page will not be reloaded.

The only thing left is to add another line of code to update the red/green button to display the current value and set the dimmer value.

That's about it I think.

In your current case in the _devicelist.html where you have the buttons for dimmers with a link:
In this example the 100% button

<a>100%</a>

you would just replace this with the button firing a javascript instead so it would look something like:

<a>100%</a>

Then create a function at the top which will esentially do this:

function myfunction(a,b)
window.ifAction.src = "setbrightness?device=" + a + "&level=" + b

Something like this....

I should have a working version by tonight when i get home if that's all this is and I'm not over simplifying it.

Ronnie

Posted on
Thu Nov 13, 2008 2:52 pm
seaofclouds offline
Posts: 32
Joined: Dec 11, 2007

Re: SeaOFClouds Plugin with sliders for dimmers

Awesome!


iPhoneDeveloper wrote:
...
Since this was your first priority, I figured I'll take a shot at it.
...
I should have a working version by tonight when i get home if that's all this is and I'm not over simplifying it.

Posted on
Thu Nov 13, 2008 5:24 pm
seaofclouds offline
Posts: 32
Joined: Dec 11, 2007

(No subject)

i like the idea of grouping based on zones if we can list devices as well as actions within each zone grouping. for example, all related actions for kitchen are listed alongside devices. this would be huge, since i like to control itunes via actions, and use one zone most often.

that reminds me - zones should be toggleable, and cookied. i have been meaning to add cookie support to the variable list toggle. could implement that here too...

do you think we should create a separate view (possibly pass a param through the url) to enable javascript? i like that we have a static version, but also want a more robust (albeit minimal) solution like the one we are discussing. thoughts?

iPhoneDeveloper wrote:
On another note, what do you think about this idea which I can contribute if you want. If we name our devices with a prefix of the zone like "Kitchen - Counter Lights", "Kitchen - Main Lights" then I could modify the page to group them in DIVS so that like your Variable section, it will display a list of zones like "Kitchen", then clicking it will expand and show just the devices in that zone but display the list without the prefix anymore.

This was gonna be my next enhancement when I have down time. What do you think? I will check out github.

Posted on
Thu Nov 13, 2008 6:45 pm
iPhoneDeveloper offline
Posts: 20
Joined: Nov 10, 2008

(No subject)

seaofclouds wrote:
i like the idea of grouping based on zones if we can list devices as well as actions within each zone grouping. for example, all related actions for kitchen are listed alongside devices. this would be huge, since i like to control itunes via actions, and use one zone most often.

that reminds me - zones should be toggleable, and cookied. i have been meaning to add cookie support to the variable list toggle. could implement that here too...

do you think we should create a separate view (possibly pass a param through the url) to enable javascript? i like that we have a static version, but also want a more robust (albeit minimal) solution like the one we are discussing. thoughts?

iPhoneDeveloper wrote:
On another note, what do you think about this idea which I can contribute if you want. If we name our devices with a prefix of the zone like "Kitchen - Counter Lights", "Kitchen - Main Lights" then I could modify the page to group them in DIVS so that like your Variable section, it will display a list of zones like "Kitchen", then clicking it will expand and show just the devices in that zone but display the list without the prefix anymore.

This was gonna be my next enhancement when I have down time. What do you think? I will check out github.


Hi SeaOfClouds,

I think we are in sync with the zoning idea. Toggle and cookies, yes yes Phase 2 - which is soon...

I think you are right in giving the most choices. If you want ultra light, you should have a choice to keep it light with no graphics/javascripting.

HOWEVER, I couldn't wait so I got my macbook pro from the car ansd started coding. It was more intensive than I thought since not only do I have to send the command without the reload of the page, I have to tell the class of the anchor to be "Button on or off", then I had to replace the innerText (value) of the button, then I had to change the HREF of the anchor to be calling a javascript so the buttons themselves do not force a reload.

I JUST FINISHED!!!!!!!!!!!!! Took me about 1 hour. I have to go home now but I think you will be thrilled with the results as I am. You will se how fast it is and NO reloads ever of=n the sliders and buttons. They fully refresh via dynamic html techniques - not a lot of overhead..... I will test tonight then send you a zipped file.

We need to organize how to do the choice as you said. Look over my code when I send it and we can talk more about creating choices. There is something nice about your buttons so I'd consider taking out the sliders but do try it out first. Expect it late tonight.

Thanks,

Ronnie

Posted on
Thu Nov 13, 2008 9:09 pm
iPhoneDeveloper offline
Posts: 20
Joined: Nov 10, 2008

Here you go!

Ok SeaOfClouds,

I made you 2 zipped files.

1 is as your original buttons but no reload anymore! Extremely light and just a couple of client side javascript which you already use and no additional files or anything. It is FAST and as light as original.

The other file is work in progress with sliders for dimmers. Check it out. It is also very light. The only addition really is additional CSS and some client side javascript.

I will check your site now and figure out how to get it to you. Possibly email?

Cheers,
Ronnie Silos

Posted on
Thu Nov 13, 2008 9:18 pm
iPhoneDeveloper offline
Posts: 20
Joined: Nov 10, 2008

(No subject)

I emailed it to info@seaofclouds.com. I hope that's right. let me know.
Ronnie

Posted on
Fri Nov 14, 2008 12:16 pm
iPhoneDeveloper offline
Posts: 20
Joined: Nov 10, 2008

(No subject)

Just an FYI, with the version I sent, you cannot have any devices with apostrophe on them. Spaces are ok. I'm using the device name as the ID and when I pass the id into the javascript function, it does not like the single quotes. That's all I've found so far with this modification.

Also, just a reminder that even though the page does not refresh/reload anymore and appears lightning fast, in the background, it still needs to send the commands so expect the same response like it used to be when pressing the buttons.

Ronnie

Who is online

Users browsing this forum: No registered users and 3 guests

cron