Need help with a Virtual Switch Rule

Let me start by saying that I didn't think this would be so difficult, I have what I would call a pretty basic understanding of Webcore so it seemed like RM wouldn't be all that different, well for whatever reason I can't seem to get this to work in RM as it was in WebCore. Neverthless I'm sure someone will point out my oversight.

Here's the scenario, I have Sharptools running on a tablet. I've created several virtual switches (but we'll just focus on one for now) to be used as pre-set streaming radio stations to play on my Sonos Player. So if I hit the virtual switch to "on" the streaming track assigned to that button will play on the Sonos, and when the switch is pressed again to "off" the Sonos will stop.

The problem with the rule is the sonos will play the stream but won't turn off when the button is switched to off. What am I doing wrong?! (Note: the Sonos will stop if I go into the device driver and manually press "stop", so I know it's working ok)

stream-rm

I got round this by defining a 'false' stream.
Here is my rule.

Button to toggle a virtual switch on and off.


Virtual Switch on. Valid stream address.

Virtual Switch off. Invalid stream address.

Not perfect but it works for me.

Hmmmm....If I read this correctly, it looks like you have two seperate triggers to control the on/off state of the sonos using a switch. I thought about going this direction but that would require 2 rules for each pre-set and I don't understand why I can't accomplish this with a simple condition? Appreciate the input!

Just put his false stream into your rule in place of the stop action that doesn't work. The problem is with the stop action, not with how your rule is set up.

Thanks! I'll play with this when I get home tonight and see if I can't incorporate the false stream rule and report back.

@destructure00 @bobbles
Are you both saying that the Sonos stop action doesn't work with RM and if so, is the HE team aware of this?
I can test when I get home, but this seems like a significant bug for anyone automating their Sonos devices.

EDIT:
I decided to test this remotely and it appears that the issue is not the stop command. It seems that the false action is not being executed.

I set up a True=play and False=stop, and it only executed the True=play action.
So I reversed the actions, True=stop and False=play, and it only executed the True=stop action.

@bravenel, @mike.maxwell any thoughts as to why false actions on rules that control musicplayer devices are not executing?

No, but I will take a look.

I need to see the app status page of this rule that doesn't work.

Thanks for jumping in @stephack, I thought it was something I was doing something wrong!

I need to see the whole page.

That is the whole page @bravenel.

Can't be. The status page has many more sections than you've shown.

Please click on the image Bruce :wink:

Ah, yes. Well, that's a code break large enough to fit a house in. It does indeed not do false. Will fix forthwith and attempt to get it into upcoming release. Sorry, I screwed that up at some point.

2 Likes

Thanks @bravenel, thought I was going mad trying to figure this out!

@bravenel - Any chance this fix was applied to the 2.0.6 release? I don't see any mention of Sonos in the update notes?

Fixed bug for player commands for false.

This is is the fix in 2.06 that relates to the problem you were having I believe.

Ahhhh.....hope you are right! I was looking for a Sonos specific comment. Can't wait to test it when I get home! Thanks!

Hmmm....not sure if this is fixed.
@bravenel I tried executing the rule I provided in previous posts, but now neither the true or false actions are occuring.

I deleted and recreated the rule with the same results. Please see both screenshots below.

Yep, it's broken. Will be fixed in hot fix release.

1 Like