I tried to make another example of what I want to do:
I am experementing and have built a very simple sensors with two ir beams that is placed in a row near a door. When I walk through from one side it registers a variable+=1 and when I walk the other way it registers - =1. My plan is to use something similar to be able to register if a room is occupied and also the number of persons in that room.
If I already have the sensor how do I integrate that functionality into domoticz? I guess the occupied/unoccupied part could be solved by the sensor itself by acting like a switch and report "on" or similar when number of occupants in the room is greater than zero. But it would be nicer if it was also possible to get the actual number of persons and maybe something other than a on/off switch - icon.
And if I have a room with multiple doorways it will not work very well as I need to be able to have multiple sensors that can modify the same variable.
Is there some way that I can add a custom variable in domoticz called for example "livingroom" and have sensors that update the same variable on change. Like : sensor 1-> livingroom +=1, Trigger some switch to livingroom occupied then sensor 2-> livingroom -=1, triggers the same switch to unoccupied.
Is this possible? And how would I register those sensors to domoticz and what do I send to be able to modify the domoticz custom variable?