Author Topic: squeezedVera and squeezedVeraScenes  (Read 8235 times)

m_gustafsson

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +0/-0
squeezedVera and squeezedVeraScenes
« on: May 01, 2009, 12:02:39 pm »
I have written two applications that uses Vera: squeezedVera and squeezedVeraScenes.
squeezedVera is a plugin for the Logitech Squeezebox, and it gives you the possibility to run scripts in different ways that can control your z-wave devices through Vera.
squeezedVeraScenes will run the same scripts as squeezedVera but here you define conditions for when they shall run in a configuration file, e.g at sunset on Mondays and Tuesdays. You can also define different scenes with different behaviour.
There is also an interface between squeezedVera and squeezedVeraScenes, that e.g. lets you switch scene through the Squeezebox.
http://www.mats-gustafsson.se/sqv_sqvs/

/M
« Last Edit: May 01, 2009, 12:04:30 pm by m_gustafsson »

325xi

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1101
  • Karma: +0/-0
  • V1, V2, still V2...
Re: squeezedVera and squeezedVeraScenes
« Reply #1 on: May 02, 2009, 01:56:10 pm »
How do you control SB? Unless you own Duet, I find it easier to run to my PC then to operate it with remote...

m_gustafsson

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +0/-0
Re: squeezedVera and squeezedVeraScenes
« Reply #2 on: May 03, 2009, 12:26:53 am »
How do you control SB? Unless you own Duet, I find it easier to run to my PC then to operate it with remote...
In the Squeezebox (SB) I just navigate to "Extras"->"Vera" and from there I can switch on and off my devices. For example I have setup my squeezedVeraScenes to switch off all lights inside my house at 1145 in the evening, but if we go to bed before that I just run the script "all lights off" from my Squeezebox and the house goes dark.
I don't have any PC with a web browser up and running all the time, so for me it is easier to use the Squeezebox (which always is on) and control things from there.
I also have squeezedVera to switch on the loudspeakers connected to my Squeezebox automatically when I press play or when an alarm goes off in the morning (don't know how to do that in any other way).

Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: squeezedVera and squeezedVeraScenes
« Reply #3 on: April 05, 2010, 01:24:19 pm »
Thanks again for your great Squeezebox plugin!

Have you ever thought about making Vera's scenes (or even Vera's dashboard) available from within your plugin?

Some ideas for scenes:

Extras -> Vera -> Global   -> Scene 1
                           -> Scene 2
                           -> Scene ...
               -> Room 1   -> Scene 1
                           -> Scene 2
                           -> Scene ...
               -> Room 2   -> ...


One could request http://ipaddress:49451/data_request?id=user_data2 to get Vera's complete configuration and extract the scenes (and devices and the corresponding services) from the response (json or XML) (http://wiki.micasaverde.com/index.php/Luup_Requests).

Or one could use Vera's Luup Lua Extensions (http://wiki.micasaverde.com/index.php/Luup_Lua_extensions) to iterate through the scenes:

for k,v in pairs(luup.scenes) do
 luup.log(k) -- SceneNum
 luup.log(v.room_num)
 luup.log(v.hidden)
-- luup.log(v.remote)
-- luup.log(v.page)
 luup.log(v.description)
end


The name of the room is available from luup.rooms (http://wiki.micasaverde.com/index.php/Luup_Lua_extensions#variable:_rooms).

A scene can be activated by requesting http://Vera_IP_adress:49451/data_request?id=lu_action&output_format=xml&serviceId=urn:micasaverde-com:serviceId:HomeAutomationGateway1&action=RunScene&SceneNum=<SceneNum>

Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: squeezedVera and squeezedVeraScenes
« Reply #4 on: April 06, 2010, 07:12:17 am »
Basically, I am asking for a replacement UI for control which supports line-oriented devices like Squeezeboxes or Braille terminals ...

Some information about designing your own UI is available at http://wiki.micasaverde.com/index.php/UI_Notes_Replacement (severley outdated!).

m_gustafsson

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +0/-0
Re: squeezedVera and squeezedVeraScenes
« Reply #5 on: April 06, 2010, 10:17:33 pm »
Ap15e,

I am glad that someone is using the plugin  :)

No I have not considered to make the Vera's scenes available within the plugin (at least not until yesterday).
I wanted to have the possibility to make Vera behave differently depending on if for example I am at home or if I am away, so that is why I wrote squeezedVeraScenes in which you can pick different scenes like that. At least in the beginning it was not possible to do that within Vera.
Then I wanted to use my Squeexebox as a convinient UI for controlling which scene should be active. Through the Squeezebox I also wanted to be able to trigger different scenarios, like turn off all lights in my home when I go to bed.

What additional benefits do you think that using Vera's scenes in the plugin would bring, compared to using scripts like it is done today?




Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: squeezedVera and squeezedVeraScenes
« Reply #6 on: April 07, 2010, 12:57:41 am »
Benefits are:

  • Vera as one point of configuration: easier maintenance of scenes
  • SqueezedVera would (optionally) be plug and play (and could be used by non-programmers)
  • a hierarchical view (Global/Rooms->Scenes) is more user-friendly for complex scenarios

BTW: in principle, it should be possible to remotely execute Lua scripts on Vera
(via UPnP service 'RunLua', see http://wiki.micasaverde.com/index.php/Luup_UPNP_Files).

m_gustafsson

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +0/-0
Re: squeezedVera and squeezedVeraScenes
« Reply #7 on: April 07, 2010, 01:04:56 am »
Benefits are:

  • Vera as one point of configuration: easier maintenance of scenes
  • SqueezedVera would (optionally) be plug and play (and could be used by non-programmers)
  • a hierarchical view (Global/Rooms->Scenes) is more user-friendly for complex scenarios

You are right.
I will make a note in my todo list about this, but unfortunately I don't think that I will have time in the near future to do this modification. Maybe you'd like to give it a try?

Ap15e

  • Beta Testers
  • Sr. Hero Member
  • *****
  • Posts: 2000
  • Karma: +11/-0
Re: squeezedVera and squeezedVeraScenes
« Reply #8 on: April 07, 2010, 01:57:16 am »
I am quite familiar with Lua, but would have to dive into Perl ... My time is limited, too. :-)

How would you implement it?

  • Requesting Vera's configuration file from Squeezebox Server (SBS) and parsing it on SBS (does SBS come with a JSON parser?)
  • Remotely running a Lua script on Vera from SBS and transferring the result to SBS (what would be the best/easiest way to transfer the result of the Lua script to SBS?)

m_gustafsson

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +0/-0
Re: squeezedVera and squeezedVeraScenes
« Reply #9 on: April 07, 2010, 03:21:09 am »
Quote
I am quite familiar with Lua, but would have to dive into Perl ... My time is limited, too. :-)
Time is a problem today...  ;)
Quote
How would you implement it?

  • Requesting Vera's configuration file from Squeezebox Server (SBS) and parsing it on SBS (does SBS come with a JSON parser?)
  • Remotely running a Lua script on Vera from SBS and transferring the result to SBS (what would be the best/easiest way to transfer the result of the Lua script to SBS?)
In my case I know nothing about Lua, so I would go for your first alternative. I don't know if a JSON parser is included in the SBS, but I don't believe so.


trouty00

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
Re: squeezedVera and squeezedVeraScenes
« Reply #10 on: January 12, 2012, 12:47:04 am »
Just wondering who is looking after this plugin now as it seems both of you guys have done some development on it.

Is it ui5 ready? Just about to dip my toes in t the world of Vera?

Ta
Stu

m_gustafsson

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +0/-0
Re: squeezedVera and squeezedVeraScenes
« Reply #11 on: January 12, 2012, 05:49:54 am »
Hi Stu,

I am looking after it, but not doing much. Only verifying that SqueezedVera works for new releases of the squeezebox server.
http://www.mats-gustafsson.se/sqv_sqvs/squeezedvera/index.html
This is the only part of it that I am using today, i.e. for switching on and off things in Vera with the Squeezebox.

/M

trouty00

  • Jr. Member
  • **
  • Posts: 98
  • Karma: +0/-0
Re: squeezedVera and squeezedVeraScenes
« Reply #12 on: January 12, 2012, 06:07:34 am »
does either solution have the option to trigger an event in vera if a player starts playing, basically i want it to turn on an amp using an appliance module once squeezebox is playing.

m_gustafsson

  • Jr. Member
  • **
  • Posts: 82
  • Karma: +0/-0
Re: squeezedVera and squeezedVeraScenes
« Reply #13 on: January 12, 2012, 07:40:06 am »
SqueezedVera is able to execute scripts when you turn on or off your squeezebox or if you press play on it. So, if you can write a script that turns on your amp (there are script examples), then you should be able to do what you are looking for.
I must admit that I have only verified this on Linux servers though.

/M
« Last Edit: January 12, 2012, 08:07:02 am by m_gustafsson »

arich57

  • Sr. Newbie
  • *
  • Posts: 29
  • Karma: +0/-0
Re: squeezedVera and squeezedVeraScenes
« Reply #14 on: October 13, 2012, 03:51:39 pm »
I'm looking at tieing my SQ and Vera together more.

The end goal I'm trying to get to is having my heat turn on (Vera controlled) 30 minutes before my alarm goes off (SB controlled). It seemed like this plugin might let me do that but I can seem to download it. Is there anyone that can help me get a copy of the plugin and configure it to do the above control?

What I would really love is to have my SB poll my google calendar and schedule the alarm based off the first event. I know that is outside this forums scope, but if either of you have any suggestions/experience with SB, I would appreciate it. I'm only using my in the very basic way but have a mythtv box that I'm planning on running a SB server on.

Thanks.