PDA

View Full Version : Home Automation app



raven77m
30 Jun 2010, 8:56 PM
Hello,
Can anyone help me out with the easiest way to make a button turn my insteon lights on and off?
Or better yet, use a slider to dim them?
Currently I have this

function sk(value)
{
loadBlank();
document.evalformula.formula.value = value; document.evalformula.submit();and I have this to give me current status and turn lights on and off....


<div class="Smenurow"> Kitchen Lights:
<font color="#00ff00"><% case(ph_getinsteonstat("KITCHENLIGHTS") when 2 then 'ON @ ' + string(round(ph_getinsteonlevel("KITCHENLIGHTS")/255*100,0)) + "%" else '<font color="#ff0000">OFF</font>')
%></font>
</div>
<div class="menurow">
<a onclick="sk('ph_rtne( ph_insteon( \'<%"KITCHENLIGHTS"%>\', ioff, 0))')"<div class="OFF"></div></a>
<a onclick="sk('ph_rtne( ph_insteon( \'<%"KITCHENLIGHTS"%>\', ion, int(255*.5)) )')"<div class="FIF"></div></a>
<a onclick="sk('ph_rtne( ph_insteon( \'<%"KITCHENLIGHTS"%>\', ion, int(255*.75)) )')"<div class="SEV"></div></a>
<a onclick="sk('ph_rtne( ph_insteon( \'<%"KITCHENLIGHTS"%>\', ion, int(255)) )')"<div class="ON"></div></a>
</div>I know, I suck at writing code but at least it works!
It would be awesome if I could figure out how to make a slider work my lights, but that seems pretty tricky.
Thanks for any input