You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit eef226f
Browse filesBrowse the repository at this point in the historyBrowse files
fix(service): take --entity, name a missing target, and say the right form for the usual wrong guesses
With 0.0.4 an Agent turned a light yellow in three steps, then needed five
to turn it off: --entity_id=..., --entity-id=..., hass-cli light.turn_off
and a call with no target (a bare HTTP 400) all failed first.
- service call takes --entity (repeatable or comma-separated), and reads
--entity_id / --entity-id as it.
- A call with no entity, device, area, floor, label or target fails locally
when the live service catalog says the service takes a target, naming the
flag and how to find the entity.
- An unknown flag on service call names the three ways to pass a target and
data; a domain.service used as a command names service call; other
unknown commands keep their close matches.
- Errors print in full: FriendlyMessage printed only the inner HTTP error,
so the hint 0.0.4 added to a 400 never reached the terminal.
- ha-lighting and ha-shared quick control use --entity.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
callCmd.Flags().StringVar(&dataJSON, "data", "", "Service data as a JSON object (or @file.json)")
93
101
callCmd.Flags().StringArrayVar(&arguments, "arguments", nil, "key=value pairs (repeatable; one flag may also hold several, comma-separated). Values may be numbers, true/false or JSON lists")
102
+
callCmd.Flags().StringSliceVar(&entities, "entity", nil, "Target entity id(s), repeatable or comma-separated; the same as --arguments entity_id=...")
103
+
// --entity_id and --entity-id are what an agent guesses first; take them for --entity.
returnfmt.Errorf("%w\nservice call takes the target and data as: --entity light.kitchen, --arguments key=value, or --data '{\"entity_id\":\"light.kitchen\",...}'", err)
Copy file name to clipboardExpand all lines: skills/ha-lighting/SKILL.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: ha-lighting
3
-
version: 0.3.1
3
+
version: 0.3.2
4
4
description: "Turn lights, switches and fans on or off, dim them, set colour or colour temperature, set fan speed. The skill for 'turn on the light' or 'turn off the fan'."
5
5
metadata:
6
6
requires:
@@ -22,10 +22,10 @@ skills, run `service describe`, or check the state afterwards.
22
22
hass-cli state list --domain light --search kitchen
23
23
24
24
# 2. Call the service on the entity_id from step 1
25
-
hass-cli service call light.turn_on --arguments entity_id=light.kitchen
26
-
hass-cli service call light.turn_off --arguments entity_id=light.kitchen
27
-
hass-cli service call switch.turn_off --arguments entity_id=switch.porch
28
-
hass-cli service call fan.turn_on --arguments entity_id=fan.bedroom
25
+
hass-cli service call light.turn_on --entity light.kitchen
26
+
hass-cli service call light.turn_off --entity light.kitchen
27
+
hass-cli service call switch.turn_off --entity switch.porch
28
+
hass-cli service call fan.turn_on --entity fan.bedroom
29
29
30
30
# Colour, brightness, warmth: one light.turn_on, which also switches it on
31
31
hass-cli service call light.turn_on --data '{"entity_id":"light.kitchen","color_name":"yellow"}'
Copy file name to clipboardExpand all lines: skills/ha-shared/SKILL.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
---
2
2
name: ha-shared
3
-
version: 0.3.1
3
+
version: 0.3.2
4
4
description: "Connecting hass-cli to Home Assistant (profile or token), output formats, raw REST and WebSocket access, and auth-error recovery. Load when a command cannot connect or authenticate; device control is in the domain skills."
5
5
metadata:
6
6
requires:
@@ -26,11 +26,11 @@ hass-cli state list --domain light --search kitchen
26
26
hass-cli state list --search 客厅
27
27
28
28
# 2. Call the service on the entity_id from step 1
29
-
hass-cli service call light.turn_on --arguments entity_id=light.kitchen
29
+
hass-cli service call light.turn_on --entity light.kitchen
30
30
hass-cli service call light.turn_on --data '{"entity_id":"light.kitchen","brightness_pct":30}'
31
-
hass-cli service call switch.turn_off --arguments entity_id=switch.porch
31
+
hass-cli service call switch.turn_off --entity switch.porch
32
32
hass-cli service call climate.set_temperature --data '{"entity_id":"climate.living","temperature":21}'
33
-
hass-cli service call cover.close_cover --arguments entity_id=cover.bedroom
33
+
hass-cli service call cover.close_cover --entity cover.bedroom
34
34
```
35
35
36
36
- The call prints the entities it changed: that is the confirmation. `No entity
0 commit comments