Example: Switch radio channels on Streaming Player from KNX push buttons, through Logic Machine 2

Task

Assume there are two KNX push-buttons 1/1/1 and 1/1/2. And there are 4 radio channels mapped on Streaming Player to group addresses 9/2/3, 9/2/4, 9/2/5, 9/2/6. We want to make so that when pushing on 1/1/1 the system jumps to the next radio channel, when pushing on 1/1/2 – to the previous one.

Streaming Player radio channel mapping

Streaming Player radio channel control

Streaming Player radio channel control

Event-based script for 1/1/1

Source code    
  1. value = event.getvalue()
  2. up_status = storage.get('upstatus2')
  3.  
  4. if up_status == nil then
  5. storage.set('upstatus2', '9/2/3')
  6. end
  7.  
  8. if up_status == '9/2/3' then
  9. storage.set('upstatus2', '9/2/4')
  10. grp.write('9/2/4', true)
  11. elseif up_status == '9/2/4' then
  12. storage.set('upstatus2', '9/2/5')
  13. grp.write('9/2/5', true)
  14. elseif up_status == '9/2/5' then
  15. storage.set('upstatus2', '9/2/6')
  16. grp.write('9/2/6', true)
  17. elseif up_status == '9/2/6' then
  18. storage.set('upstatus2', '9/2/3')
  19. grp.write('9/2/3', true)
  20. end

Event-based script for 1/1/2

Source code    
  1. value = event.getvalue()
  2. up_status = storage.get('upstatus2')
  3.  
  4. if up_status == nil then
  5. storage.set('upstatus2', '9/2/3')
  6. end
  7.  
  8. if up_status == '9/2/3' then
  9. storage.set('upstatus2', '9/2/6')
  10. grp.write('9/2/6', true)
  11. elseif up_status == '9/2/6' then
  12. storage.set('upstatus2', '9/2/5')
  13. grp.write('9/2/5', true)
  14. elseif up_status == '9/2/5' then
  15. storage.set('upstatus2', '9/2/4')
  16. grp.write('9/2/4', true)
  17. elseif up_status == '9/2/4' then
  18. storage.set('upstatus2', '9/2/3')
  19. grp.write('9/2/3', true)
  20. elseif up_status == '9/2/3' then
  21. storage.set('upstatus2', '9/2/6')
  22. grp.write('9/2/6', true)
  23. end