AI Prompt

Water Tank Fill Pump (SmartI8)

Prompt for a SmartI8 pump that fills a water supply tank using an inverter with start/stop pulses.

Prompt

Go to this wiki https://tb.kouman.eu/wiki/ems.html and study how their scripting language for esp32 boards works. Then please:
- Use '_' prefixed locals inside macro commands to avoid variable collisions across expansions.
- Keep the script including comments under 5000 bytes.

Write an Etheras Microscript for the SmartI8 board (DI=8, DO=8, AI=8, WiFi/Ethernet/LoRaWAN).

The project is a pump that fills a water supply tank.
out(1): command to inverter to start (4 second pulse).
out(2): command to inverter to stop (4 second pulse). While it is 1, the inverter must not start.
out(3): emergency. While it is 1, the inverter must not start.

in(1): level low.
in(2): level high.
in(3): emergency mushroom.
in(4): power fault, force emergency.
in(5): manual on for inverter test.
in(6): manual off for inverter test.