Sitemap page change trigger sliders refresh

Hi, does anyone know of a way to start an event when you enter a new sitemap sub-page. I have an Audio Amp to control the speakers throughout the house and I can control the volume and other features through sliders and selection buttons but I want to set the sliders and buttons to the existing volume level an features. but I need to send an status request command to get current values before I present the sliders and buttons on the new page.

I know of no way to do this with sitemaps. I think it might be possible with HABPanel though.

Then is there a trigger that can be detected or set up when the arrow to go to the second frame is pressed

Why are the sliders/selection buttons not showing the actual setting in the first place?

The devices are being controlled via async commands. I can get values back by sending status request commands and then putting those values into the items so that any change in the sliders and buttons would then trigger commands that affect the actual values in the device. but I need to know when the frame with the sliders and buttons is accessed so I can request the values before any commands are entered. I also think I need to to a status request upon system start to load initial values.

That sounds like you would be better of by tweaking the device to send its actual state regularly. Are you able to do such?

NO, its a Denon PRO Amplifier that is not not supported by the Denon binding, so the only interaction is through the serial port.

So you could do some gentle polling? Once every five minutes say, if no openHAB commands had been used.

Kind of newbie…how would I set that up? would it be a rule with cron.

Heres the code for changing the volume level rule and item:

//  Control for  Zone 1 Master Volume
rule "Zone 1 Master Volume"
    Item Zone1Master  received command
    val x1 = Zone1Master.state as Number
    val int z1 = x1.intValue - 20
    var xcmd = "@0PXOT1LV" + z1 + "\r"
    logInfo("Z1-Master", "volume value: " + xcmd + '\n')
    sendCommand( DenonAmp, xcmd)

String DenonAmp "DenonSerial"  { serial="COM1@38400" }
//  Set Zone Master Volume
Number   Zone1Master
Number   Zone2Master
Number   Zone3Master
Number   Zone4Master
Number   Zone5Master

Yes, use a Cron-statement as trigger and in the main body (after the “then”) poll the device for its state and postUpdate the recalculated state for Zone1Master.

1 Like

How are you doing this part?