[Solved] Rules trying to learn

Try this:

rule "Sonos plays"

when
Item sonos_CONNECT_RINCON_000E58AACE2201400_control changed
then
    if(sonos_CONNECT_RINCON_000E58AACE2201400_control.state == PLAY){
        marantz_power.sendCommand(ON) 
        marantz_input.sendCommand("CD") 
}
end
1 Like

you nailed itā€¦

works now.

:+1:

Glad itā€™s working, do you understand why it now works?

honestly not sure but very eager to learn .

Rules will make a big difference so really really need to learn

The rule is actually simple the problem was the correct item name. Once you posted the log I was able to get the correct info for the rule to work. I originally thought the sonos item was a channel due to the length, :upside_down_face: but I guessed wrong. :grin: Going forward make sure your using the correct item names and types. :wink:

There are copious amounts of rule examples on the forum you just need to search a bit to find one thatā€™s similar to what you need then modify it. BTW, I posted another rule example on your other topic for the pir sensor.

@BDE

I guess you have enabled ā€œSimple Modeā€ in PaperUI --> Configuration --> System --> ā€œItem Linkingā€.

Your sonos item looks like an autocreated item:

 sonos_CONNECT_RINCON_000E58AACE2201400_control

And your sonos items in .items file have probably linked wrong channels.

@Celaeno1 Spot on

You better should correct or delete them (in .items file), otherwise you later will experience some nasty surprisesā€¦

just didā€¦thx for the input

hi all

Althought rule work ,i have spent some time finetunig it.

It looks like this now.

rule "Sonos plays"
when
Item Sonos_stue_Controller changed
then
    if(Sonos_stue_Controller.state == PLAY){
       marantz_power.sendCommand(ON) 
       createTimer(now.plusSeconds(10)) [| marantz_input.sendCommand("CD")  ]      
       createTimer(now.plusSeconds(10))  [|marantz_volume.sendCommand(35) ]
       createTimer(now.plusSeconds(10))  [|Sonos_stue_Controller.sendCommand(PLAY) ]
           }
end

My issue is IFReciever is already ON and on another input when activating Sonos ,rule doesnt seem to work.
Any suggestions ?

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.