I have the following script in scripts.yaml:
'1577067372308':
alias: 'CAMERA: Motion Detection Kitchen'
sequence:
- entity_id: image_processing.kitchen_ds
service: image_processing.scan
Sometimes when I call it from the command line using curl:
curl -k -X POST -H “Authorization: Bearer redacted” -H “Content-Type: application/json” https://192.168.0.144:8123/api/services/script/1577067372308
I get the right output:
[{“attributes”: {“friendly_name”: “kitchen_ds”, “last_person_detection”: “2019-12-27_23:00:02”, “summary”: {“chair”: 1}, “unit_of_measurement”: “person”}, “context”: {“id”: “959b1fc0da6c410c80678042902dbfd2”, “parent_id”: null, “user_id”: “b7c8ec6ab59642caa45cadfacab1d6d4”}, “entity_id”: “image_processing.kitchen_ds”, “last_changed”: “2019-12-28T06:02:36.016624+00:00”, “last_updated”: “2019-12-28T06:16:19.619061+00:00”, “state”: “0”}, {“attributes”: {“friendly_name”: “CAMERA: Motion Detection Kitchen”, “last_triggered”: “2019-12-28T06:16:17.072536+00:00”}, “context”: {“id”: “959b1fc0da6c410c80678042902dbfd2”, “parent_id”: null, “user_id”: “b7c8ec6ab59642caa45cadfacab1d6d4”}, “entity_id”: “script.1577067372308”, “last_changed”: “2019-12-28T05:56:06.878527+00:00”, “last_updated”: “2019-12-28T06:16:19.619977+00:00”, “state”: “off”}]
Sometimes I get an extra output related to another entity (in this example, my garage door):
[{“attributes”: {“device_class”: “garage”, “distance_sensor”: 178, “door_state”: “closed”, “friendly_name”: “Garage Door”, “supported_features”: 3, “wifi_signal”: -76}, “context”: {“id”: “cebbaa7e4e824479bb220574b817bdf6”, “parent_id”: null, “user_id”: null}, “entity_id”: “cover.garage_door”, “last_changed”: “2019-12-28T05:54:22.225283+00:00”, “last_updated”: “2019-12-28T06:09:05.113525+00:00”, “state”: “closed”}, {“attributes”: {“friendly_name”: “kitchen_ds”, “last_person_detection”: “2019-12-27_23:00:02”, “summary”: {“chair”: 2}, “unit_of_measurement”: “person”}, “context”: {“id”: “a99e5c2c2d1043cbaa1c9834092cd033”, “parent_id”: null, “user_id”: “b7c8ec6ab59642caa45cadfacab1d6d4”}, “entity_id”: “image_processing.kitchen_ds”, “last_changed”: “2019-12-28T06:02:36.016624+00:00”, “last_updated”: “2019-12-28T06:09:06.250223+00:00”, “state”: “0”}, {“attributes”: {“friendly_name”: “CAMERA: Motion Detection Kitchen”, “last_triggered”: “2019-12-28T06:09:03.672742+00:00”}, “context”: {“id”: “a99e5c2c2d1043cbaa1c9834092cd033”, “parent_id”: null, “user_id”: “b7c8ec6ab59642caa45cadfacab1d6d4”}, “entity_id”: “script.1577067372308”, “last_changed”: “2019-12-28T05:56:06.878527+00:00”, “last_updated”: “2019-12-28T06:09:06.251055+00:00”, “state”: “off”}]
Any idea why? Using 0.103.4.