A Home Assistant custom integration that exposes entities whose attributes are populated from the response data of Home Assistant services/actions.
This integration creates sensor entities that:
- Call any Home Assistant service at configurable intervals
- Capture the service response data
- Expose the complete response in the sensor's
dataattribute
This is a "service response → attribute bridge" that allows Dashboards and cards (which only work with entity states and attributes) to display data from service responses.
- Display Tibber price data from
tibber.get_price_infoin a dashboard - Show weather forecast data in custom cards
- Access calendar events in Lovelace
- Any service that returns response data with
return_response: true
- This integration is for advanced users who understand YAML and service calls
- Large responses and short polling intervals can impact:
- Home Assistant performance
- Database/Recorder size
- Frontend rendering speed
- The
dataattribute contains the raw service response - format varies by service
Prerequisites: This integration requires HACS (Home Assistant Community Store).
Then:
- Click "Download" to install the integration
- Restart Home Assistant (required after installation)
Configure:
- Name: A friendly name for this sensor (e.g., "Tibber Prices")
- Action Domain: The service domain (e.g.,
tibber) - Action Name: The service name (e.g.,
get_price_info) - Action Data (YAML): Optional YAML data for the service call
Tip: Copy the YAML directly from Developer Tools → Actions
The sensor exposes:
- State:
okorerror - Attributes:
data: The complete service responseservice: The service that was calledlast_update: When the data was last refreshedsuccess: Whether the last call succeedederror_message: Error details (if any)
Example template to access the data:
{{ state_attr('sensor.tibber_prices', 'data') }}| Field | Required | Description |
|---|---|---|
| Name | Yes | Friendly name for the sensor |
| Action Domain | Yes | Domain of the service to call |
| Action Name | Yes | Name of the service to call |
| Action Data (YAML) | No | Optional YAML data for the service |
| Option | Default | Description |
|---|---|---|
| Polling Interval | 300s | How often to call the service (10-86400 seconds) |
Action Domain: tibber
Action Name: get_price_info
Polling Interval: 3600 (1 hour)
The sensor's data attribute will contain the price information returned by Tibber.
To test the integration without requiring external integrations:
Action Domain: homeassistant
Action Name: reload_core_config
Action Data (YAML): (leave empty)
Polling Interval: 300
This will call a built-in Home Assistant service. The sensor state will show ok if successful.
Note: This service doesn't return data, so the
dataattribute will beNone. Use a service that returns data (liketibber.get_price_info) to see actual response data.
Verify the service exists in Developer Tools → Actions.
Check your YAML syntax. The service data must be valid YAML with key: value pairs.
- Verify the service supports
return_response - Check if the service requires specific input data
- Review Home Assistant logs for errors
logger:
default: info
logs:
custom_components.action_result: debugContributions are welcome! Please open an issue or pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
Made with ❤️ by @jpawlowski