No one, from those who saw the post, knows how to do the above?
However, if it can be useful to someone, I solved by creating a small program (1020) that triggers for 1 second the GPIO connected to the relay.
In the modified widget I added the following code to the toggle button action:
var progs = HG.Automation.Programs;
progs.Run(1020, { });
Maybe is apparently useless, but a sensor widget that contains a toggle button, is very useful to control and monitor the status of a light on a traditional electrical system using a single widget.
The light has a wall button connected to a normal two-way relay.
The second way of the relay is a dry contact that is connected to a GPIO configured as INPUT and is used to know the status of LIGHT.
The toggle button, located on the same sensor widget, is used to control an economic Relay Board for Raspberry, that you have to connect in parallel to the two-way relay.
SO, WE CAN NOT KNOW THE STATE OF THE LIGHT THROUGH THE RELAY BOARD, BUT THROUGH THE STATE OF THE TWO-WAY RELAY CONNECTED TO GIPIO CONFIGURED AS INPUT (SENSOR) !!
For clarification, I'm at the disposal.
N.B. Of course if rather than creating a macro for each ignition, there was sooner or later someone so kind to suggest a way to create the parameter in the widget to indicate which GPIO trigger for 1 second would be perfect !!
I thank all those who work to HomeGenie.
I will make soon a small donation, because after trying it for some time with some sensor and relay, I am increasingly convinced that I will use this system to my new home currently under construction !!