The Vera Community forums have moved!

Advanced => Programming => Plugins & Plugin Development => Topic started by: jlutsky on April 15, 2016, 12:16:03 pm

Title: PLUGIN: MySelector
Post by: jlutsky on April 15, 2016, 12:16:03 pm
PLUGIN: MySelector

Create a custom selector device. Configurable with up to 8 custom options per device. Selection change can be used as triggers for scenes. Can also target selection change with scenes. *Tested on UI7 Only

Install the MySelector plugin from the MiOS Marketplace: http://apps.mios.com/plugin.php?id=8661 (http://apps.mios.com/plugin.php?id=8661)
Instructions: http://code.mios.com/trac/mios_myselector (http://code.mios.com/trac/mios_myselector)
Title: Re: PLUGIN: MySelector
Post by: konradwalsh on April 16, 2016, 04:51:43 am
Well done.. 

Sent from my ONE A2003 using Tapatalk

Title: Re: PLUGIN: MySelector
Post by: tomgru on April 16, 2016, 12:13:16 pm
Sorry to be dense... but I looked at the instructions and can't figure out what to use this for? Can you give me a use case scenario?
Title: Re: PLUGIN: MySelector
Post by: jlutsky on April 16, 2016, 01:45:54 pm
It basically creates a device with custom options, that behaves similar to the 'My Modes' feature built into UI7. A single device (or variable container) with a list of pre-defined selections or states, where it makes sense that only one be selected at any given time.

For example, I use two devices in conjunction to switch media sources in my house depending on the room I'm in:

MyLocation: Den,Office,Bedroom
MyInput: DirecTV,DVD,Chromecast

MyLocation is updated as I move around the house. Then, when I change MyInput, depending on the MyLocation value, it changes an HDMI Matrix to switch inputs only in the room I'm in currently.

Feel like there could be many other uses that I haven't thought of yet. As far as I can tell, there is no easy way currently to create a custom device with more than just 2 states (On/Off).

Ultimately, I wrote this in hopes that ImperiHome could implement it in their app. I'd really like a single device with a drop-down list of available selections in their UI. Similar to the way 'My Modes' already shows up as an actuator in their app.
Title: Re: PLUGIN: MySelector
Post by: Freddan101 on April 16, 2016, 02:03:15 pm
Perfect! I hope IH will implement support for this plugin.
Title: Re: PLUGIN: MySelector
Post by: jlutsky on April 16, 2016, 02:06:07 pm
Drop them a message at support@imperihome.com and give them a nudge.  =)
Title: Re: PLUGIN: MySelector
Post by: Jamr on June 03, 2016, 02:28:45 pm
I just got the IH Beta (B411) with this supported.
This add on looks interesting as I am sure I can find some more ways to implement it. Thanks for creating it.
@jlutsky, Please explain how your location get updated?
 
I will get the add on and play with it. in the mean time.
Title: Re: PLUGIN: MySelector
Post by: jlutsky on June 03, 2016, 05:20:12 pm
Thanks @Jamr

Actually, my location isn't automatically updated.... yet.  =) That's something I want to figure out soon. I actually wrote the plugin specially so I could have an easy way to manually update my location via my phone, using the ImperiHome UI. I've got my phone on me most of the time, and also using android touch screens on the wall in each room. Now that I have a MySelector device available in the ImperiHome UI it's just an easy tape to tell my Vera which room I'm in.
Title: Re: PLUGIN: MySelector
Post by: Aaron on June 04, 2016, 09:31:58 am
Just to clarify to make sure I understand it... while this looks similar to the MultiSwitch plugin, where MultSwitch hold 1 to 8 states at a time, this will only hold 1 State at a time?

Title: Re: PLUGIN: MySelector
Post by: Freddan101 on July 06, 2016, 02:03:38 am
Yes, 1 state at a time. In for example ImperiHome you get a drop down box to choose from.
Title: Re: PLUGIN: MySelector
Post by: konradwalsh on July 06, 2016, 08:29:43 am


MyLocation is updated as I move around the house. Then, when I change MyInput, depending on the MyLocation value, it changes an HDMI Matrix to switch inputs only in the room I'm in currently.


what do you use to track you
Title: Re: PLUGIN: MySelector
Post by: jlutsky on July 06, 2016, 02:38:44 pm
I don't actually have a way to track my location automatically yet. Currently, I just have a MySelector device called 'MyLocation'. Has options for various rooms (Den,Bedroom,Office,Livingroom). I just manually switch rooms for now. Pretty quick with ImperiHome. Also, I do have a few other triggers that automatically update my room location. Like when I turn on a certain light in a certain room. Or when IR activity is detected in a certain room.
Title: Re: PLUGIN: MySelector
Post by: OldManse on July 29, 2016, 12:14:52 pm
@jlutsky

Great little plugin. I'm using it to change states throughout the day on my house heating - I have four states (Morning,Daytime,Evening,Night) which I currently change with a series of scenes i.e 7:00am set to Morning, 10:00am set to Daytime, etc.

What I would like to do is be able to toggle through the options, i.e. At (7:00,10:00,18:00,23:00) toggle to next option. I could do this this in code (and there are various ways of doing it) i.e.
   if (option == morning) then {option = daytime}
   else if (option == daytime) then {option = evening}
   else if (option == evening) then {option = night}
   else if (option == night) then {option = morning}
   end
but this would be hard coded - I would rather have the option of being able to add/delete/change the options and still be able to cycle through without having to re-code.

Is there anyway to increment through any number of options?
Title: Re: PLUGIN: MySelector
Post by: jlutsky on July 29, 2016, 12:19:12 pm
Interesting idea. It should be easy enough to build some kind of 'Next/Previous' option function into the plugin. I'm out of town for the next week, but could work on that when I return.
Title: Re: PLUGIN: MySelector
Post by: RichardTSchaefer on July 29, 2016, 12:53:12 pm
You could easily put all of the logic in a PLEG and use the "MySelector" to display the current state.
Although many used of PLEG have end up automating a lot of things, in that case "MultiString" plugins are more memory effiecient.

i.e.   you can do 6 variables in the same memory footprint as 1 "MySelector".
Title: Re: PLUGIN: MySelector
Post by: OldManse on July 29, 2016, 03:36:45 pm
@jlutsky
I look forward to your return to town next week - it sounds just the job.

Richard
Thanks for the tip about Multistring - I'm fairly new to this stuff so had not come across this plugin, but it will do exactly what I want to do with something else. As far as using MySelector, that gets my vote over Multistring as the options are clickable, giving me option of selecting a different time period ahead of time.
Title: Re: PLUGIN: MySelector urn
Post by: save on August 18, 2016, 04:40:39 am
Hello,

I think it?s a very interesting plugin.  Anybody knows how can I access to a "myselector" button throught LUUP?

The equivalent to the "urn:upnp-org:serviceId:SwitchPower1"    in a switch

Regards

Title: Re: PLUGIN: MySelector
Post by: GreenUser on August 19, 2016, 10:45:33 am
Hi,

This plugin works as "my modes"?
I wanted to use the mode "night" and separate "night" + "in bed" and "night" + "standing".
Can I use the plugin for what I want? How should I set up?

Thank you