Skip to main content
Version: 1.0

Smart Water Valve

Smart water valve is a Powered By Shelly device which automatically regulates water flow by opening, closing, or adjusting the valve to a specific position. It responds to power events — such as closing or reopening the valve after a power outage — and can connect to temperature sensors for enhanced environmental monitoring.

For more information about the original Smart Water Valve consult: https://frankever.com/

The following components are available in Smart Water Valve:

Supported virtual components:

Supported BTHome components:

Virtual Component Configuration

The Smart Water Valve has the following virtual components:

Virtual ComponentTypeAccessDescription
openbuttonwriteOpens the water valve completely.
closebuttonwriteCloses the water valve completely.
positionnumberwriteAdjusts the valve’s position as a percentage (0–100%).
has_powerbooleanreadIndicates whether the device is currently receiving power.

Service Configuration

See the Service Configuration Example section for a full example.

PropertyTypeDescription

on_power_loss

string

Defines the behavior of the valve when the power gets lost:

  • close - Close the valve.
  • open - Open the valve.
  • none - Do nothing.
  • set_position - Set the valve at a certain position.

on_power_restore

string

Defines the behavior of the valve when the power is restored:

  • close - Close the valve.
  • open - Open the valve.
  • none - Do nothing.
  • set_position - Set the valve at a certain position.
  • restore_last - Set the valve to the last saved position.

power_restored_pos

number

Applies when on_power_restore is set to set_position, defining the valve position after power is restored.

power_loss_pos

number

Applies when on_power_loss is set to set_position, defining the valve position when power is lost.

name

string

Valve's configuration name.

Method Examples

How to open the water valve

http://192.168.33.1/rpc/Button.Trigger?owner="service:0"&role="open"&event="single_push"

Response

null

How to close the water valve

http://192.168.33.1/rpc/Button.Trigger?owner="service:0"&role="close"&event="single_push"

Response

null

How to adjust the water valve's position (opened at 25%)

http://192.168.33.1/rpc/Number.Set?owner="service:0"&role="position"&value=25

Response

null

How to check the device's power state

http://192.168.33.1/rpc/Boolean.GetStatus?owner="service:0"&role="has_power"

Response

{
"value": true,
"source": "rpc",
"last_update_ts": 1700864253
}

MQTT Communication

The Smart Water Valve can be controlled and monitored through MQTT.

Command topics

Allow sending open, close commands, as well as numeric position control.

TopicDescription
"valve/0/state"Accepts open or close payloads to fully open or close the valve.
"valve/0/position"Accepts numeric payloads (0–100) to set the target valve position as a percentage.

Status topics

Report information about the current status of the water valve.

TopicDescription
"valve/0/position"Reports current valve position as a JSON object, e.g. { "position": 45 }.
"valve/0/has_power"Reports current power-supply status as a JSON object, e.g. { "hasPower": true }.

Service Configuration Example

http://192.168.33.1/rpc/Service.GetConfig?id=0

Response

{
"on_power_loss": "none",
"on_power_restore": "none",
"power_restored_pos": 0,
"power_loss_pos": 0,
"name": "Water valve",
"id": 0
}