A modular plugin for N.I.N.A. (Nighttime Imaging 'N' Astronomy) that integrates smart home switches into your astrophotography workflow.
The Smart Switch Manager allows you to control power relays and IoT switches as native N.I.N.A. equipment. This enables manual control via the Equipment tab and automated power management within the Advanced Sequencer.
| Provider | Hardware Generations | API Type | Status | Hardware Timer |
|---|---|---|---|---|
| Shelly | Gen 2 / 3 (Plus, Pro) | RPC | Lab & Field Tested | Yes |
| Shelly | Gen 1 | HTTP | Lab Tested | Yes |
| Tasmota | All (ESP8266/ESP32) | HTTP | Lab Tested | No |
| Home Assistant | Entities / Scripts / Timers | REST | Lab & Field Tested | Yes (via Scripts) |
| ESPHome | web_server components |
REST | Lab Tested | No* |
- Shelly: Supports Basic/Digest auth. Hardware timers are ideal for PC shutdown or cooling workflows.
- Tasmota: Reliable sequential request enforcement. See the Tasmota Documentation for important hardware/template tips.
- Home Assistant: Integration via the standard REST API (Entities) or a dedicated Script/Timer backend. The latter uses a blueprint to handle autonomous delays directly on the HA instance. Requires a Long-Lived Access Token (LLAT).
- ESPHome: Native hardware timers are currently not implemented in the plugin. However, autonomous behavior can be achieved by tailoring the device's internal YAML logic (e.g.,
delayed_off).
The Toggle SmartSwitch instruction in the Advanced Sequencer has a built-in safety check:
- Normal Toggle (Delay = 0s): NINA will wait (up to 10s) until the device physically confirms the state change before moving to the next instruction.
- Hardware Timer (Delay > 0s): NINA will continue immediately once the device acknowledges the command, while the timer runs autonomously on the hardware.
- Equipment Integration: Appears in the Equipment → Switch tab.
- Entity Discovery: Scanners for Shelly and Tasmota to identify available switch entities (channels) at a specified IP address.
- Sequencer Instructions:
- Smart Switch Set: Integration into the N.I.N.A. Advanced Sequencer.
- Architecture: Decoupled backend-provider structure with attribute-based capability discovery.
The Smart Switch Manager is available in the official N.I.N.A. plugin repository!
- Open N.I.N.A.
- Go to Plugins → Available and search for Smart Switch Manager.
- Click Install in the top right corner.
- Restart N.I.N.A.
- Download the latest release ZIP from the GitHub Releases page.
- Extract the contents into your N.I.N.A. plugins directory:
%localappdata%\NINA\3\Plugins\SmartSwitchManager. - Restart N.I.N.A.
- Configuration:
- Go to Plugins → Installed → Smart Switch Manager.
- Select your provider (e.g., Shelly).
- Use the Device Scanner or Add Switch Manually to configure your devices.
- Set custom names (e.g., "Mount Power", "Dew Heater") and credentials if required.
- Manual Control:
- Go to Equipment → Switch, select Smart Switch Manager and click Connect.
- Toggle your switches directly from the Switch panel or the Imaging tab (Smart Switches window).
- Automation:
- In the Advanced Sequencer, search for the Smart Switch Set instruction.
- Drag it into your sequence and select the desired switch and state.
If you want to add support for a new smart switch ecosystem (like Tasmota or Home Assistant), please refer to the ADD_NEW_PROVIDER.md guide.
Requires .NET 8.0 SDK.
dotnet build NINA.Plugin.SmartSwitchManager.sln -c ReleaseLicensed under the MPL-2.0 License.
This software is provided "as is", without warranty of any kind, express or implied. The author and contributors are not responsible for any damage to equipment or data resulting from its use. Use at your own risk.
