From 17690d43499e927898a738b9cee53fa9c1bc05bc Mon Sep 17 00:00:00 2001 From: StumblingGamer <33354711+StumblingGamer@users.noreply.github.com> Date: Tue, 23 Jun 2026 11:12:00 -0400 Subject: [PATCH] Proposing changes to documentation and JSON Schema Added proposed documentation section explaining Numeric data object and also updated JSON schema to match changes. I tested the numeric example with tap_action.data in the documented web editor. The current schema did not appear to reject the field, likely because numeric tap_action does not currently forbid additional properties at that nested level. I still added data explicitly to the numeric schema so it is documented, discoverable, and type-checked as an object. --- config.schema.json | 5 +++++ examples/Numeric.md | 30 ++++++++++++++++++++++++++++++ 2 files changed, 35 insertions(+) diff --git a/config.schema.json b/config.schema.json index 1ad8e64..01f701c 100644 --- a/config.schema.json +++ b/config.schema.json @@ -256,6 +256,11 @@ "action": { "$ref": "#/$defs/action" }, + "data": { + "type": "object", + "title": "Additional action data", + "description": "Fixed Home Assistant service data. The selected picker value is merged into this object using the picker's data_attribute. Service-specific fields cannot be schema checked here." + }, "picker": { "type": "object", "title": "Number picker configuration", diff --git a/examples/Numeric.md b/examples/Numeric.md index 878b442..97af375 100644 --- a/examples/Numeric.md +++ b/examples/Numeric.md @@ -39,6 +39,36 @@ Field | Purpose It may well be the case that often `attribute` and `data_attribute` are the same attribute, as with this example. +## Additional Action Data + +The `tap_action` object may also include a `data` object for fixed service call parameters. When the picker value is selected, the application merges the picker value into this `data` object using `data_attribute`. + +For example, a light brightness picker can request a HomeAssistant transition while still using the picker value for `brightness`. + +```json +{ + "name": "Lounge Brightness", + "content": "{{ ((state_attr('light.lounge','brightness') | int(0) / 255) * 100) | round(0) }}%", + "type": "numeric", + "entity": "light.lounge", + "tap_action": { + "action": "light.turn_on", + "data": { + "transition": 2 + }, + "picker": { + "step": 5, + "min": 0, + "max": 255, + "attribute": "brightness", + "data_attribute": "brightness" + } + } +} +``` + +The resulting action data sent to HomeAssistant contains both the fixed `transition` value and the selected `brightness` value. + ## Helper You might define a "helper" entity as follows in HomeAssistant: