Thanks @ghayne I get your principle to do the math. But I have problem adding the numbers in a function. How do I read the gpio status (and add) all 8 all at once? .
The effect is that whenever an input changes, then 0.1 second later (to give any other changed inputs time to arrive) it will send a message with all 8 values in the payload, identified by their pin numbers. You might need to play with the delay.