Call Service node reporting API call error when populating Entity field if using Logbook/Log domain/service call.
See original GitHub issueProblem/Motivation
API error on ‘Call Service’ node when calling ‘logbook/log’ domain/service. If ‘Entity’ field is populated the call to the API is unsuccessful and reports ‘Call-service error’ If ‘Entity’ field is left blank it the call is successful. ‘Call service’ node works fine when using the ‘switch’ domain.
Expected behavior
Keep the behavior as in the previous versions. Previously, I was able to use the ‘Entity’ field pass it to the log service to be correctly populated in the log entry.
Actual behavior
If the entity field is used when using ‘call service’ node with ‘logbook’ domain, the API call fails.
Steps to reproduce
Create a ‘call service’ node to add a log entry by using the ‘logbook’ domain and the ‘log’ service and populate the ‘entity’ field with any valid entity in your system. Use an inject node to activate the service all and you will get a ‘call-service’ error. I added a 2-node sequence below.
Proposed changes
- Allow the entity field to be used for logging purposes.
- I have managed to work around this issue by leaving the ‘entity’ field blank and passing ‘entity_id’ via a message variable.
[{"id":"3411bfc6f0a7330f","type":"api-call-service","z":"f1b6eb10f8042de9","name":"Logging","server":"1680b843.4f7308","version":4,"debugenabled":false,"domain":"logbook","service":"log","target":{"areaId":[],"deviceId":[],"entityId":["switch.power_switch_02"]},"data":"{ \"name\": \"{{data_log.name}}\", \"message\": \"{{data_log.message}} [Node-RED_{{data_log.id}}]\", \"domain\": \"{{data_log.domain}}\", \"entity_id\": \"{{data_log.entity_id}}\" }","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1140,"y":860,"wires":[[]]},{"id":"cee9084140327534","type":"inject","z":"f1b6eb10f8042de9","name":"","props":[{"p":"data_log.message","v":"has been turned ON or OFF by Node-RED automation","vt":"str"},{"p":"data_log.entity_id","v":"switch.power_switch_02","vt":"str"},{"p":"data_log.domain","v":"switch","vt":"str"},{"p":"data_log.name","v":"friendly_name","vt":"str"},{"p":"data_log.id","v":"your_own_ID_for_reference","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","x":950,"y":860,"wires":[["3411bfc6f0a7330f"]]},{"id":"1680b843.4f7308","type":"server","name":"Home Assistant","version":2,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":30}]
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (2 by maintainers)

Top Related StackOverflow Question
Understood. I will do that. Thank you!
Bug has been opened under the Home Assistant Websocket Node project: https://github.com/zachowj/node-red-contrib-home-assistant-websocket/issues/590