| Author |
Message |
|
macpro
Joined: Dec 29, 2005 Posts: 585 Location: Third byte on the right
|
morps wrote:1. How do you initiate and call your script from within Indigo? 2. What variables do you have setup in Indigo? 3. I have two Squeezeboxes... do you setup your indigo variables as "SlimStatus<SqueezeboxNickname>1" and "SlimStatus<SqueezeboxNickname>2"? 4. What else should I be asking you that I am not bright enough to know I should be asking 
I still use my own script with some enhancements from nsosnicki regarding error trapping and connect timeout.
So the answers to 1 and 2 can be found in topic you refered to.
As I only have 1 SLIMP3, I do not use nicknames hence I do not use "SlimStatus<SqueezeboxNickname>1" and "SlimStatus<SqueezeboxNickname>2" but "SlimStatus1" and "SlimStatus2".
You might try to add a couple of - Code: Select all
log "Slim Power: I'm here in the code doing this"
statements so you can find out at what point it is generating the error messages.
_________________ "I tawt I taw a puddy tat!" Tweety
|
| Sat Nov 25, 2006 9:12 am |
|
 |
|
nsosnicki
Joined: Nov 14, 2004 Posts: 155 Location: Boston, MA, US
|
morps wrote:Any pointers on how to unravel my mess are greatly appreciated 
In the revised script (v1.2), all status variables and functions must include the device's nick name.
So, for your example, the following should work:
- Code: Select all
if value of variable "SlimPower" = "on" then SlimServerGetStatus("FamilyRoom") else set value of variable "SlimStatusFamilyRoom1" to "" set value of variable "SlimStatusFamilyRoom2" to "" end if
Obviously, you could do the same with your device named "Garage"
The variable "SlimPower" is not part of the original script, so you would have to modify your scripts if you wanted a separate power variable for each device.
|
| Sat Nov 25, 2006 9:35 am |
|
 |
|
nsosnicki
Joined: Nov 14, 2004 Posts: 155 Location: Boston, MA, US
|
morps wrote:3. I have two Squeezeboxes... do you setup your indigo variables as "SlimStatus<SqueezeboxNickname>1" and "SlimStatus<SqueezeboxNickname>2"? .
In the new script version, these variables are created as needed on the fly. So when you call a function for a particular device, it should create the two status vars needed for that device.
In your case "SlimStatusFamilyRoom1", "SlimStatusFamilyRoom2", "SlimStatusGarage1", "SlimStatusGarage2".
If you are upgrading from a previous script version, "SlimStatus1" and "SlimStatus2" will no longer be updated by the script. If you refer to these variables in any of your Indigo scripts, triggers, etc., you should change them to use the new variables. Then you can delete "SlimStatus1" and "SlimStatus2".
|
| Sat Nov 25, 2006 9:44 am |
|
 |
|
morps
Joined: Nov 01, 2003 Posts: 117
|
nsosnicki wrote:In your case "SlimStatusFamilyRoom1", "SlimStatusFamilyRoom2", "SlimStatusGarage1", "SlimStatusGarage2".
If you are upgrading from a previous script version, "SlimStatus1" and "SlimStatus2" will no longer be updated by the script. If you refer to these variables in any of your Indigo scripts, triggers, etc., you should change them to use the new variables. Then you can delete "SlimStatus1" and "SlimStatus2".
Thanks a bunch to nsosnicki and macpro, I am up and running again with the latest/greatest script. And now I can have both my Squeezeboxes returning their own values too! Now to go build out the UI for it.  Thanks again folks!
|
| Sat Nov 25, 2006 12:47 pm |
|
 |
|
matt (support)
Site Admin
Joined: Jan 27, 2003 Posts: 11689 Location: Texas
|
I've fixed a couple of buglets in the script and posted a new version (1.2.1) on the HA Wiki:
http://automation.highearthorbit.com/wi ... box_Script
The script will also be included in the disabled attachments folder for the next 2.0 build. Thanks everyone for the contributions on this one!
Regards,
Matt
|
| Mon Jan 01, 2007 4:50 pm |
|
 |
|
twynne
Joined: May 24, 2007 Posts: 36
|
Sorry to resurrect what's now quite an old thread, but I've been using the final script above for several months now and there's one slight annoyance that I though someone might know the answer to. The SlimServerPower command actually just seems to be a toggle. In other words, if you send it an 'off' when it's already off it toggles the device on.
Does anyone know how to send discrete 'on' and 'off' commands? How would you modify the script?
Thanks guys,
Tom
|
| Wed Oct 07, 2009 9:58 am |
|
 |
|
nsosnicki
Joined: Nov 14, 2004 Posts: 155 Location: Boston, MA, US
|
I'm not sure what version of the script you're running, but in the last version I had used, this behavior could be seen by using something other than the valid values (0 or 1) when calling the power function.
Make sure you're not using an oh instead of a zero.
|
| Wed Oct 07, 2009 5:57 pm |
|
 |
|
twynne
Joined: May 24, 2007 Posts: 36
|
nsosnicki wrote:I'm not sure what version of the script you're running, but in the last version I had used, this behavior could be seen by using something other than the valid values (0 or 1) when calling the power function.
Make sure you're not using an oh instead of a zero.
Hi,
It looks like it's your script, v1.2. I'm definitely putting a zero in the first parameter. It doesn't need to be in quotes does it?
Thanks,
Tom
|
| Thu Oct 08, 2009 4:29 am |
|
 |
|
twynne
Joined: May 24, 2007 Posts: 36
|
Putting the zero into quotes has resolved it. This wasn't at all obvious from the instructions in the script. Might be worth clarifying in future versions.
In any case thanks for the reply.
|
| Thu Oct 08, 2009 11:38 am |
|
 |
|
twynne
Joined: May 24, 2007 Posts: 36
|
Does anyone know of a way to play a particular radio station via script? In my case I've got the station saved as a favourite, also assigned to a preset. The existing script only seems to have the option to play a single song.
Thanks all,
Tom
|
| Wed Oct 14, 2009 2:53 pm |
|
 |
|
snowjay
Joined: Aug 09, 2006 Posts: 254
|
FYI, since I've been playing with this over the past couple of days, status.txt no longer works (at least in 7.4 not sure when it disappeared) so status of the devices do not get updated. According to the Slim forums the CLI should be used instead.
_________________ Jason
|
| Sun Oct 18, 2009 6:14 am |
|
 |
|
twynne
Joined: May 24, 2007 Posts: 36
|
Very odd as it's all working fine on my 7.4 server.
|
| Mon Oct 19, 2009 5:25 am |
|
 |
|
snowjay
Joined: Aug 09, 2006 Posts: 254
|
twynne wrote:Very odd as it's all working fine on my 7.4 server.
So you are saying your Indigo variables are getting updated with the status of the players?
If you go to http://<slimserver>:9000/status.txt what do you get back?
_________________ Jason
|
| Tue Oct 20, 2009 5:06 am |
|
 |
|
twynne
Joined: May 24, 2007 Posts: 36
|
Apologies - I thought you meant *control* of the devices wasn't working. Control still works fine on mine, but I don't use the status/variable bits. Visiting status.txt returns nothing.
Sorry for the confusion. 
|
| Tue Oct 20, 2009 5:13 am |
|
 |
|
snowjay
Joined: Aug 09, 2006 Posts: 254
|
twynne wrote:Apologies - I thought you meant *control* of the devices wasn't working. Control still works fine on mine, but I don't use the status/variable bits. Visiting status.txt returns nothing. Sorry for the confusion. 
No problem.
Yes, control still works great. I'm not using the statuses either since they aren't there but it would be a nice thing to add to my control pages.
_________________ Jason
|
| Tue Oct 20, 2009 6:00 am |
|
|