Device for domestic or industrial heating boilers or thermic generators, the boiler or generator comprising an input pipe (26, 30) for water to be heated, and a heated-water output pipe (40, 46), a fluid-fuel inlet pipe for heating the water, the device comprising sensors (28, 32) for measuring the water's flow rate and temperature in the input pipe (26, 30). sensors (42, 48) for measuring the water's flow rate and temperature in the output pipe (40, 46). a sensor for measuring the fluid-fuel's flow rate in the fluid-fuel input pipe, an electronic circuit connected to the sensors (22, 28, 32, 42, Z 48) configured to detect the data output thereof, the electronic circuit being configured to calculate from the output data two information or parameters, i.e. the potential energy-contribution of the fluid fuel within a unit of time, and the caloric energy transferred from the boiler to the outgoing water during that unit of time, characterized in that the circuit is interfaced with first means adapted to allow a manual release of the boiler, and second means for imposing a reduction of the working temperature of the boiler; and the circuit is configured to - compare said two information, and - by means of mathematical or logic functions - calculate a deviation thereof to compare it with preset or programmable thresholds, and, if the deviation is greater than a threshold, to activate the second means for reducing the gas flow in order to bring the boiler to a desired condition of minimum operation, and to detect the condition of the first means to verify a user action thereupon, and if the circuit detects a user action, to restore the normal operation of the boiler by inhibiting the second means. an input pipe (26, 30) for water to be heated, and a heated-water output pipe (40, 46), a fluid-fuel inlet pipe for heating the water, the device comprising sensors (28, 32) for measuring the water's flow rate and temperature in the input pipe (26, 30). sensors (42, 48) for measuring the water's flow rate and temperature in the output pipe (40, 46). a sensor for measuring the fluid-fuel's flow rate in the fluid-fuel input pipe, an electronic circuit connected to the sensors (22, 28, 32, 42, Z 48) configured to detect the data output thereof, the electronic circuit being configured to calculate from the output data two information or parameters, i.e. the potential energy-contribution of the fluid fuel within a unit of time, and the caloric energy transferred from the boiler to the outgoing water during that unit of time, characterized in that the circuit is interfaced with first means adapted to allow a manual release of the boiler, and second means for imposing a reduction of the working temperature of the boiler; and the circuit is configured to - compare said two information, and - by means of mathematical or logic functions - calculate a deviation thereof to compare it with preset or programmable thresholds, - compare said two information, and - by means of mathematical or logic functions - calculate a deviation thereof to compare it with preset or programmable thresholds, and, if the deviation is greater than a threshold, to activate the second means for reducing the gas flow in order to bring the boiler to a desired condition of minimum operation, and to detect the condition of the first means to verify a user action thereupon, and if the circuit detects a user action, to restore the normal operation of the boiler by inhibiting the second means.