Traffic Lights: how to fetch the state of a map

Hey there.

I ordered a traffic light for a desk. It can be controlled by a linux client. I have all mission critical things on a nagvis map. I would like to map the state of the map with the traffic light:

if the specific map is red in the checkmk side bar, the traffic light should turn to red as well. How can I request the overall state of a nagvis map (as the side bar is doing)?

Hint: There is already one traffic light solution, but controlled with GPIOs and based on contact_groups. Ronny did a great job here: Network attached Traffic-Light style status display for CheckMK - Guide

Announcement: if I have a working solution, I post this here. Maybe we can collect different solutions for traffic light installations.

I think the approach is flawed: The NagVis maps merely present monitoring states on a somewhat topological display. The question you really are asking is one for BI. That gives you way better control, and you can easily query the state of an BI through the REST API.