Service Call Consistency - YAML on dev-service

When writing a new automation, sometimes the more exotic service calls are used.

Testing them is a pain. Loading up dev-service, the service call parameters are written in JSON. Once it’s working, it has to be turned into YAML to be put in an automation. It would make testing much easier if dev-service accepted YAML, because then, once the service call works as expected, I can cut and paste the parameters into the automation.

Wow, that would be SO MUCH easier!

1 Like

YAML is heavily dependent on indentation. And most probably the indentation on the dev-panel won’t match what you require in your actual configuration. Yes, you could copy and paste, but you still would need to take care of proper indentation. And I kind of forsee people complaining that the copied and pasted YAML doesn’t work and instead breaks their configuration because they didn’t make the required adjustments. :thinking:
Also technically JSON is the correct format for what the dev-panel does: it posts JSON data to the API.

I’m not saying the idea is bad, and for sure some might benefit from it. Just wanted to raise awareness about the downsides.

You’re right. Indentation does make it more complicated. And lots of users get indentation wrong even without cutting and pasting.

Alternately, I’d be happy with a “data_json” key available in the service call.

The Services call already saves the last service call. Why doesn’t it also save the last “Service Data” input? Or better yet save the last 10 “Service Data” inputs on a per service basis?