Default
Try the configured card with fictional devices.
Scroll to load this example.
A day or month reading and its independently named history popup.
Scroll through the real card’s behaviors using fictional data. Open its details to inspect the real popup. Offscreen examples reset when reloaded.
The documentation theme applies to every example. Use the playground below to edit configuration.
Try the configured card with fictional devices.
Scroll to load this example.
Choose the month summary and history.
Scroll to load this example.
Calculate a cost using an explicit price per kWh.
Scroll to load this example.
Show selected sub-meters with independent names.
Scroll to load this example.
History has an honest empty state.
Scroll to load this example.
Show a readable error when records cannot be loaded.
Scroll to load this example.
Wait for Home Assistant state before showing controls.
Scroll to load this example.
The entity exists but has no known state. Controls remain neutral and disabled.
Scroll to load this example.
The entity is unavailable. No device action is dispatched.
Scroll to load this example.
A removed entity produces an explicit neutral missing-state result.
Scroll to load this example.
Controls refuse actions when Home Assistant is disconnected.
Scroll to load this example.
Try the card below. Select Open playground to choose a behavior or edit settings and YAML. Everything in the preview uses fictional devices. Copy YAML exports the card configuration, without demonstration states or service responses.
Loading preview…
In Home Assistant, choose Edit dashboard → Add card → Manual, then paste the YAML below. Replace fictional entity IDs with your own. You can also find the card in Home Assistant’s card picker and use its native editor.
type: custom:marao-energy-cardentity_id: sensor.energyvariables: period: dayCompatible entity domains: sensor.
The day/month detail uses recorded energy/statistics, not a sum of display samples. Open the card to inspect period history.
Calculated costs are estimates. A configured price overrides the Home Assistant Energy tariff; missing prices remain unavailable.
The table lists the shared catalog fields and this card’s structured options. Not set means the example does not impose a value; Home Assistant and Marao use the entity’s capabilities and the card’s normal behavior. Structured values remain editable as YAML.
| YAML path | Setting | Value type | Catalog default | Behavior |
|---|---|---|---|---|
entity_id |
Entity | entity | Not set | A sensor entity from your Home Assistant. Searchable suggestions are available. |
name |
Name | text | Not set | Optional display name; otherwise use the entity’s friendly name. |
icon |
Icon | icon | Not set | Optional icon name such as mdi:lightbulb-outline. Searchable suggestions are available. |
popup |
Show energy details on dashboard | boolean | Not set | Display the complete period chart on the dashboard instead of the compact summary. |
variables.period |
Period | energy_period | day |
Period for this card. Choices: day, month. |
variables.calculate_cost |
Calculate cost from energy | boolean | Not set | Calculate cost from energy for this card. |
variables.cost_per_kwh |
Price per kWh | number | Not set | Leave empty to use the Home Assistant Energy tariff. Calculated costs are estimates. |
variables.sub_entities |
Energy breakdown | energy_sub_entities | Not set | Energy breakdown for this card. |
variables.popup_hash |
Popup hash | text | Not set | Optional link to an existing external popup hash. Omit it to use this card’s automatic details. |
variables.display_unit |
Display unit | energy_unit | Auto |
Auto keeps the source unit. Selecting a compatible unit converts the reading. Choices: Wh, kWh, MWh, GWh, J, Ws, kJ, MJ, GJ. |
variables.display_precision |
Decimal places | energy_precision | Auto |
Auto trims trailing zeros. Choose 0–6 fixed decimal places. Choices: 0, 1, 2, 3, 4, 5, 6. |
popup_view |
Custom popup view | text | Not set | Optional existing view path used for a Home Assistant managed popup layout. Omit for automatic details. Searchable suggestions are available. |
Select Open playground, then choose a scenario to inspect its configuration and reported device state. Similar numeric or color values do not need separate examples.
| Scenario | What it demonstrates |
|---|---|
| Default | Try the configured card with fictional devices. |
| Month | Choose the month summary and history. |
| Estimated cost | Calculate a cost using an explicit price per kWh. |
| Named breakdown | Show selected sub-meters with independent names. |
| No recorded history | History has an honest empty state. |
| History request failed | Show a readable error when records cannot be loaded. |
| Loading state | Wait for Home Assistant state before showing controls. |
| Unknown state | The entity exists but has no known state. Controls remain neutral and disabled. |
| Unavailable | The entity is unavailable. No device action is dispatched. |
| Missing entity | A removed entity produces an explicit neutral missing-state result. |
| Disconnected | Controls refuse actions when Home Assistant is disconnected. |
Home Assistant owns card sizing, sections and visibility. Marao controls retain their touch targets and capability checks. Unknown, unavailable or disconnected entities use neutral presentation and disable unsafe actions. See layouts and popups and shared interactions.