Do you have a link to the impulse water meter you're considering getting?
If the water meter is basically just a switch (with 2 wires), then you could connect one wire to GND, and the other wire to any free data pin on Puck.js.
Then it's just a matter of:
var meterPin = D1; // or whatever pin
pinMode(meterPin,"input_pullup"); // this makes the pin a `1` unless the switch is on
setWatch(function() {
console.log("Impulse!");
}, meterPin, {repeat:true,edge:"falling"});
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Ahh, by Magnetventil, you mean 'solenoid valve'?
You'd probably find that this is exactly what you're after: https://makezine.com/projects/use-puck-js-automate-your-gardening-tasks/
Do you have a link to the impulse water meter you're considering getting?
If the water meter is basically just a switch (with 2 wires), then you could connect one wire to GND, and the other wire to any free data pin on Puck.js.
Then it's just a matter of: