SqueezeboxSpeak saying a String from items file

I have Squeezbox setup successfully, in that I can hear it say things I put in quotation marks. Is there a way to have it say things that are set in the items file (right now I am trying the Astro zodiac as an example)

String Zodiac_Sign “Current zodiac [%s]” {astro=“planet=sun, type=zodiac, property=sign”}

In the rules file I have this:
squeezeboxSpeak(“squeezebox”, Zodiac_Sign.state, 100, false)

I have also tried just Zodiac_Sign . I get an error in the log ; Error during the execution of rule “office motion”: Could not invoke method:org.openhab.action.squeezebox.internal.Squeezebox.squeezeboxSpeak(java.lang.String,java.lang.String,int,java.lang.Boolean) on instance:null

It works when I put something into quotation marks instead, like this:
squeezeboxSpeak(“squeezebox”, “Now it works”, 100, false)

The documentation I found online doesn’t seem to cover this particular situation… Anybody with expertise?

Set a variable first based on the state? Then use that variable in the squeezeboxSpeak?

Did not test, but if Zodiac_Sign is set to some string, you would have to use

squeezeboxSpeak("squeezebox", Zodiac_Sign.state.toString, 100, false)

If Zodiac_Sign is uninitialized, this would fail, to omit this error, you could use

if(Zodiac_Sign.state != NULL)
1 Like


squeezeboxSpeak(“squeezebox”, Zodiac_Sign.state.toString, 100, false)

this worked perfectly thank you!

1 Like