Hello I’m a beginner, in my project I use the voice messages using the say command.
I would like to set the message volume using the setMasterVolume command at 8:00 am at 80 and at 20:30 at 20
How can I implement the rule?
OpenHab Version 1.8
hardware platform Raspberry pi
- Create a rule using cron
- Using exec binding, use these commands in your rule
amixer scontrols && amixer sset 'Master' < the volume >
amixer scontrols && amixer sset 'Master' 20%
rule "Set Volume to 80 at 8 am"
Time cron "0 0 8 ? * * *"
executeCommandLine("amixer set PCM -- 80%")
rule "Set Volume to 20 at 8:30 pm"
Time cron "0 30 20 ? * * *"
executeCommandLine("amixer set PCM -- 20%")
but if OpenHab should reboot how the volume behaves?
amixer set PCM -- 20%
. is no Openhab Control … this is a controll of the Raspberry …
In a rule, you can use
logInfo ("test-rule", "Master volume is " + getMasterVolume())
logInfo ("test-rule, "New master volume is " + getMasterVolume())
Which will produce something like
2018-01-27 12:00:03.022 [INFO ] [se.smarthome.model.script.test.rules] - Master volume is 0.2
2018-01-27 12:00:03.022 [INFO ] [se.smarthome.model.script.test.rules] - New master volume is 0.1
This seems to apply the volume to the default audio sink defined in Paper UI. I think this will work for notifications played through Sonos and Squeezebox. I’m not sure about other bindings that support audio sink, or System Speaker.