- Platform information:
- Hardware: AMD64
- OS: Windows 10/10.0 (amd64)
- Java Runtime Environment: Azul Systems, Inc. 11.0.12 (Zulu11.50+19-CA)
- openHAB version: openHAB 3.2.0.M1
I have a rule to playSound via my Chromecast devices. However when the rule is used the audio is truncated.
So if I issue openhab:audio play gun_1618.wav
The full audio is played.
If I do any of the following the audio is truncated:
playSound("chromecast:chromecast:6df7deca73b62299e64480d680f5d95f","gun_1618.wav", new PercentType(100))
playSound("gun_1618.wav", new PercentType(100))
Logs don’t show any issues that I can see:
For my rule:
rule "Test Say"
when
Item Test_Say received command ON
then
//ShellyUNI_Battery_Updated.postUpdate(new DateTimeType())
//playStream("chromecast:chromecast:6df7deca73b62299e64480d680f5d95f","http://10.163.199.252:8080/static/alarm-siren-car-alarm.mp3", new PercentType(100))
playSound("chromecast:chromecast:6df7deca73b62299e64480d680f5d95f","gun_1618.wav", new PercentType(100))
// playSound("gun_1618.wav", new PercentType(100))
//playSound("chromecast:audiogroup:4d51667c-eb10-4484-a5e2-54e93f20b6d7","barking.mp3")
say("UPS Battery critical ", new PercentType(100))
Test_Say.postUpdate(OFF)
end
08:52:00.777 [INFO ] [openhab.event.ItemCommandEvent ] - Item 'Test_Say' received command ON
08:52:00.792 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Test_Say' changed from OFF to ON
08:52:01.048 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 60 to 62
08:52:01.157 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 62 to 63
08:52:01.282 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 63 to 65
08:52:01.407 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 65 to 67
08:52:01.517 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 67 to 69
08:52:01.628 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 69 to 70
08:52:01.737 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 70 to 72
08:52:01.839 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 72 to 73
08:52:01.958 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 73 to 75
08:52:03.002 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 75 to 79
08:52:03.123 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 79 to 80
08:52:03.232 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 80 to 81
08:52:04.754 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 81 to 79
08:52:04.849 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 79 to 77
08:52:05.037 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 77 to 76
08:52:05.146 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 76 to 74
08:52:05.256 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 74 to 72
08:52:05.387 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 72 to 71
08:52:05.500 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 71 to 69
08:52:05.622 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 69 to 67
08:52:05.747 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 67 to 66
08:52:05.858 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 66 to 64
08:52:05.986 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 64 to 62
08:52:06.096 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 62 to 61
08:52:06.205 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 61 to 59
08:52:06.315 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'HomeSpeakerGroup_Volume' changed from 59 to 58
08:52:09.602 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Test_Say' changed from ON to OFF
Any suggestions on why it might not be working?
Based on the command line working (and testing different audio files) it appears to not be the audio file?
Thanks
Mark
EDIT: SOLVED… The say("UPS Battery critical ", new PercentType(100))
is over writing the previous command.
Guess I have to put in a delay to allow the playSound to complete before sending the next command.