SOLVED : Squeezebox Binding+openhabian1.7 :Playtime conversion to minute and seconds not working

  • Platform information:
    • RPiB 4GB_
    • OS: openhabianv1.7 (Bullseye)
    • Java Runtime Environment:
    • openHAB version: V3.2

Have squeezboxbinding running with textual configuration and used following item:

Number:Time  SqueezeWintergartenCurrPlaytime      "Playing Time [JS(mmss.js):%s]"      

Put the transform script in the …config/transform folder and as nothing happend and Dan Demento recommended maybe right problem i found the following:

transform

So i changed the rights for the 2 files i have created from openhabian:openhab to openhab:openhab

But nothing change; In the Main UI i still see always the Playing time only in seconds.

I am happy to get hints about this

The content of the mmss.js is:

(function(i){ 
    var s = ~~(i%60);
    return (~~(i/60) + ':' + ((s < 10) ? '0' : '') + s);
})(input)

Thanks
Karl

Main UI does not use the Label in this way. Instead, you have to use Metadata

stateDescription=""[pattern="JS(mmss.js):%s"]

this is an additional part in {} , right after channel="...", so it would look like

Number:Time  SqueezeWintergartenCurrPlaytime      "Playing Time" {channel="...", stateDescription=""[pattern="JS(mmss.js):%s"]}

Great Thanks a lot

Testet it in the Main Ui directly
Shows now Minutes:Seconds :grinning:

Karl