# Switchs

## Smart Switches (/switch.php)

Designed for binary state automation, smart relay toggling, lighting, power outlets, and multi-channel hardware controllers with supplemental data attributes.&nbsp;

## Technical Endpoint

- Path: /switch.php
- Protocol: HTTP GET / POST

## Key Query Parameters

- cmd   : Operational instruction
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; • "on"   -&gt; Energize relay / set state to Active
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; • "off"  -&gt; De-energize relay / set state to Inactive
          • "get"  -&gt; Query present device switch state&nbsp;

&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; • "ping" -&gt; Keep-alive heartbeat verification


- data1 : Auxiliary parameter (e.g., Dimmer level 0-100%, Color RGB, Timer)
- data2 : Auxiliary parameter (e.g., Power consumption metrics, Wattage)
- data3 : Auxiliary parameter (e.g., Custom diagnostic or sub-state flag)&nbsp;

## Common Use Cases

- Smart lighting and power outlet controllers.
- Remote HVAC, pump, and electrical contactor triggers.
- Multi-state toggling with operational feedback loops.

