SmartHomeShop Docs

Automations and Deadline Schedules

The Energy workspace creates ordinary Home Assistant automations. They remain visible and editable in Home Assistant, while SmartHomeShop provides the configuration flow and calculated timing.

Automation Templates

Open Energy > Settings > Automations. A template marked Needs dynamic prices requires a connected dynamic contract; Needs grid meter requires a P1 meter with Net grid power (CC). Available templates can include:

  • run during the cheapest hours;
  • run while the price is below the daily average;
  • pause a load during expensive peak hours;
  • preheat during cheap hours;
  • use solar surplus for a load or heating;
  • avoid exporting during negative feed-in prices;
  • switch on a diversion load when the feed-in price is negative;
  • choose the cheapest continuous EV charging block, without a ready-by guarantee. For "car ready by 07:00", use a deadline schedule.

The available action depends on the entity you select. Verify whether the target expects a switch, climate setpoint, charging current or another service call.

Curtail Solar Export

Two inverter controls are available under SmartHomeShop.io > Energy > Settings > Automations:

  • Keep solar export near zero reduces production when the home exports more solar power than the configured margin.
  • Avoid negative-price solar export does this only while the live feed-in price is below the configured threshold.

Both controls preserve solar power used directly by the home. They use signed grid power: import is positive and export is negative. Verify this sign convention in your installation before enabling the automation.

Recommended: Writable Output Limit

Prefer a writable number entity for inverter active power or output limit. The automation:

  1. evaluates signed grid power every 30 seconds;
  2. gradually lowers the limit while export remains above the allowed margin;
  3. raises the limit again when the home starts importing from the grid;
  4. restores the normal limit when the price condition clears or required source data is unavailable.

This retains local self-consumption and avoids frequent inverter power cycles. For a percentage entity, the normal limit is usually 100. For a watt-based limit, use the permitted inverter output. The minimum limit is never set below the minimum reported by the Home Assistant entity.

Fallback: Safe Inverter Enable Control

Use a switch or input_boolean only when it invokes the inverter manufacturer's supported enable control. The automation waits for export to persist for the configured delay before switching off. It then:

  • restarts immediately when sufficient grid import is detected;
  • performs a short periodic test start, because a stopped inverter cannot reveal how much solar production is available;
  • switches off again when unwanted export continues after the test;
  • restores the inverter when valid grid telemetry is missing for too long;
  • for price-based control, also restores production when the price recovers or the energy contract disconnects.

A test start can briefly export energy. Never interrupt the inverter AC supply with a smart plug, loose relay or contactor.

Settings

Setting Purpose
Allowed export Export margin permitted before control starts.
Restore above import Grid import required to raise the limit or immediately restart a paused inverter.
Curtail below feed-in price Feed-in price below which price-based control becomes active.
Normal output limit Normal unrestricted inverter target value.
Minimum output limit Lowest safe target value accepted by the inverter.
Adjustment per 30 seconds Step used to adjust a writable limit. Smaller steps regulate more smoothly.
Switch off after How long export must persist before switch-based control turns off.
Test start every Interval between test starts of a stopped inverter.
Test duration Settling time for inverter and grid meter during a test start.
Grid sensor fail-safe Maximum time without valid grid telemetry before the inverter is restored.

Commissioning

  1. Select the correct P1 meter under Energy > Settings > Connection. The controls use its Net grid power (CC) sensor.
  2. Confirm that import is positive and export is negative.
  3. Select the writable output limit or, only when no limit is available, the manufacturer's safe enable entity.
  4. Start with a generous export margin and small adjustment steps.
  5. Run the automation under supervision and inspect its Home Assistant trace.
  6. Test price recovery, grid import, missing grid telemetry and a Home Assistant restart.

The generated controller is an ordinary Home Assistant automation. You can inspect its trace and edit it later. Do not let a vendor schedule or second automation command the same inverter limit at the same time.

Deadline Schedules

A schedule answers: “How many hours must this device run before a deadline?” Create schedules on the Automations tab of your P1MeterKit or WaterP1MeterKit device page, with a dynamic contract connected. Configure:

  • the name of the schedule;
  • the switch or input_boolean to run and the hours needed, from 1 to 24;
  • the Ready by time;
  • an optional Not before time;
  • whether the load must run in one continuous block;
  • the load power, used for the savings estimate and the fuse guard;
  • optional main-fuse protection, which waits for free capacity and can delay or miss the deadline.

The planner picks the cheapest hours that still meet the deadline and creates a binary sensor plus an ordinary automation for the schedule. When no slack is left and prices cover the deadline, the load runs regardless of price.

Commissioning Checklist

  1. Create the automation. It is active right away, so disable it with Disable automation while you check it.
  2. Compare the selected hours with the source price or forecast entities.
  3. Trigger the action manually and confirm the device responds safely.
  4. Test behaviour when a source entity is unavailable.
  5. Enable the automation and review the first completed cycle.

Always keep the appliance's own safety controls active. Home Assistant schedules are not a replacement for thermal protection, charging limits or electrical selectivity.