Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Netro Sprinklers.indigoPlugin/Contents/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>PluginVersion</key>
<string>2026.1.2</string>
<string>2026.2.0</string>
<key>ServerApiVersion</key>
<string>3.6</string>
<key>IwsApiVersion</key>
Expand Down
40 changes: 40 additions & 0 deletions Netro Sprinklers.indigoPlugin/Contents/Server Plugin/Devices.xml
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,46 @@
<TriggerLabel>Status</TriggerLabel>
<ControlPageLabel>Status</ControlPageLabel>
</State>
<State id="weather_condition">
<ValueType>String</ValueType>
<TriggerLabel>Weather Condition</TriggerLabel>
<ControlPageLabel>Weather Condition</ControlPageLabel>
</State>
<State id="weather_temperature">
<ValueType>Number</ValueType>
<TriggerLabel>Weather Temperature</TriggerLabel>
<ControlPageLabel>Weather Temperature</ControlPageLabel>
</State>
<State id="weather_humidity">
<ValueType>Integer</ValueType>
<TriggerLabel>Weather Humidity (%)</TriggerLabel>
<ControlPageLabel>Weather Humidity (%)</ControlPageLabel>
</State>
<State id="weather_rain">
<ValueType>Number</ValueType>
<TriggerLabel>Weather Precipitation (mm/hr)</TriggerLabel>
<ControlPageLabel>Weather Precipitation (mm/hr)</ControlPageLabel>
</State>
<State id="weather_rain_prob">
<ValueType>Integer</ValueType>
<TriggerLabel>Weather Rain Probability (%)</TriggerLabel>
<ControlPageLabel>Weather Rain Probability (%)</ControlPageLabel>
</State>
<State id="weather_wind_speed">
<ValueType>Number</ValueType>
<TriggerLabel>Weather Wind Speed (m/s)</TriggerLabel>
<ControlPageLabel>Weather Wind Speed (m/s)</ControlPageLabel>
</State>
<State id="weather_pressure">
<ValueType>Number</ValueType>
<TriggerLabel>Weather Pressure (hPa)</TriggerLabel>
<ControlPageLabel>Weather Pressure (hPa)</ControlPageLabel>
</State>
<State id="weather_updated">
<ValueType>String</ValueType>
<TriggerLabel>Weather Last Updated</TriggerLabel>
<ControlPageLabel>Weather Last Updated</ControlPageLabel>
</State>
</States>
</Device>
<Device type="sensor" subType="kSensorDeviceSubType.Humidity, ui=Plant Moisture Sensor" id="Whisperer">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,8 @@
<Name>Update All Status</Name>
<CallbackMethod>updateAllStatus</CallbackMethod>
</MenuItem>
<MenuItem id="refreshWeather">
<Name>Refresh Weather Now</Name>
<CallbackMethod>refreshWeather</CallbackMethod>
</MenuItem>
</MenuItems>
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,42 @@

<Field id="sep4" type="separator"/>

<!-- Tomorrow.io Weather Integration -->
<Field id="weatherLabel" type="label" fontColor="blue">
<Label>Tomorrow.io Weather Integration</Label>
</Field>
<Field id="weatherDescription" type="label" fontSize="small" fontColor="darkgray">
<Label>Automatically fetch weather from Tomorrow.io and report it to your Netro devices. This overrides Netro's built-in weather data for smarter watering schedules. Get a free API key at tomorrow.io.</Label>
</Field>

<Field id="tomorrowEnabled" type="checkbox" defaultValue="false">
<Label>Enable Tomorrow.io weather:</Label>
<Description>Fetch and report weather automatically</Description>
</Field>

<Field id="tomorrowApiKey" type="textfield" defaultValue="" visibleBindingId="tomorrowEnabled" visibleBindingValue="true">
<Label>Tomorrow.io API Key:</Label>
</Field>
<Field id="tomorrowApiKeyLabel" type="label" fontSize="small" fontColor="darkgray" alignWithControl="true" visibleBindingId="tomorrowEnabled" visibleBindingValue="true">
<Label>Your Tomorrow.io API key from your account dashboard.</Label>
</Field>

<Field id="tomorrowLocation" type="textfield" defaultValue="" visibleBindingId="tomorrowEnabled" visibleBindingValue="true">
<Label>Location (lat,lon):</Label>
</Field>
<Field id="tomorrowLocationLabel" type="label" fontSize="small" fontColor="darkgray" alignWithControl="true" visibleBindingId="tomorrowEnabled" visibleBindingValue="true">
<Label>Latitude and longitude, e.g. "42.3478,-71.0466". You can also use a place name like "Boston, MA".</Label>
</Field>

<Field id="weatherUpdateInterval" type="textfield" defaultValue="30" visibleBindingId="tomorrowEnabled" visibleBindingValue="true">
<Label>Weather Update Interval (minutes):</Label>
</Field>
<Field id="weatherIntervalLabel" type="label" fontSize="small" fontColor="darkgray" alignWithControl="true" visibleBindingId="tomorrowEnabled" visibleBindingValue="true">
<Label>How often to fetch weather and report to Netro. Default is 30 minutes. Minimum 10 minutes. Tomorrow.io free tier allows 500 calls/day.</Label>
</Field>

<Field id="sep5" type="separator"/>

<!-- Debug Logging -->
<Field id="showDebugInfo" type="checkbox" defaultValue="false">
<Label>Enable debug logging:</Label>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,15 +128,18 @@
MINIMUM_POLLING_INTERVAL_MINUTES: Final[int] = 3
"""Minimum polling interval in minutes to avoid API rate limits."""

DEFAULT_WEATHER_UPDATE_INTERVAL_MINUTES: Final[int] = 10
"""Default interval for weather updates in minutes."""
DEFAULT_WEATHER_UPDATE_INTERVAL_MINUTES: Final[int] = 30
"""Default interval for weather updates in minutes (matches PluginConfig.xml)."""

THROTTLE_LIMIT_MINUTES: Final[int] = 61
"""Duration to wait after rate limit error before retrying (minutes)."""

FORECAST_UPDATE_INTERVAL_MINUTES: Final[int] = 60
"""Interval between forecast updates in minutes."""

MINIMUM_WEATHER_UPDATE_INTERVAL_MINUTES: Final[int] = 10
"""Minimum interval for Tomorrow.io weather updates in minutes."""

TOKEN_PAUSE_THRESHOLD: Final[int] = 100
"""Token count below which polling should pause proactively."""

Expand Down
Loading
Loading