'data' or 'service_data' and other changes for remote Harmony commands and channel changing

I was doing simple remote.harmony integration. On/off was working as a charm. But I faced problem with remote.harmony_change_channel
I tried to make it accordingly to HA documentation


Unfortunately with no success and with errors like:
Failed to call service remote/change_channel. Service not found.’

It was the easier one as the error text is more user-friendly, so after some investigations I went to HA Developer Tolls and found that the correct service name is *remote.**harmony_*change_channel

But that was not end of the problems. After correcting service name I did get error
‘Failed to call service remote/harmony_change_channel. required key not provided @ data[‘channel’]’
Less obvious for me, the noob. After much longer searching I did found that it shouldn’t be data: but service_data:.

After these changes, it works.

I spend some time finding the solutions and didn’t find a similar topic, so maybe that will be useful for anybody else.
Secondly, maybe someone will explain where the mentioned differences come from? Historical changes? Different uses in different places?

Were you trying to call that service using an entity button or something similar in Lovelace?
service_data is required for Lovelace cards. That is documented here. Admittedly, it is a little confusing.

As for the docs saying remote.change_channel in the example instead of remote.harmony_change_channel you could submit an edit to the docs correcting that :wink:

1 Like

It was in picture card (which was in horizontal-stack which was in vertical-stack).
Could it be unified or allowed to use interchangeably.

Thanks, that is something I didn’t know. But to be honest, I still do not feel competent enough. Vide this data/service_data case where I am only partially right. As I understand, it is safe to make changes. In fact not changes but suggestion checked by someone more competent. In harmony_change_channel case suggestion done.