Script Service Template Throws error

Assuming you’ve defined those two scripts, that should work

It demonstrates another way to call a “dummy” service. Create a script that does nothing and then templates can call it whenever they need to provide a service call that does … nothing. :slightly_smiling_face:

Ah ! got it. You are updating the light, so ‘nothing’ ! clever and no extra scripts - Minimal - Me Likey !!!

Sometimes the situation is where the entity_id should be nothing. However, Home Assistant has that one covered and the template can safely provide none as the entity_id. A service call acting on none simply fails gracefully.

Thanks guys

@Mutt : In my case, i have an automation triggering on a sensor input(which updates every 10s), the automation calls a script to do the needed work(control 4 lights, one both on and off), as i am wanting the sensor data accuracy for other functions, but only want the lights to be switched(if at all) every 5 minutes(to avoid a cloud to trigger the lights), and as Automations being re-triggered don’t play well with delays.

So having an Automation, call a script, which in turn calls yet another two script… seems tedious at the least.

The do nothing service is a definite winner though. Just tested it. Works as expected.

2 Likes