Hello to all,
I’m trying to use the RFPlayer to control RTS shutters. The integration works well and I can control them.
But in lovelace cards, I can’t call the service linked to the RFPlayer correctly.
So I had the idea to create a generic script to execute commands via the RFPlayer.
So I created the following script:
`alias: Action Volet
sequence:
- service: rfplayer.send_command
data:
command: "{{ command }}"
protocol: "{{ protocol }}"
device_address: "{{ device_address }}"
mode: single
`
And then, in the development tools, in the service tab, I try to call the service as follows:
service: script.action_volet
data:
command: {% OFF %}
protocol: {% RTS %}
device_address: {% A1 %}
But, i always have this type of error :
2022-10-06 16:49:58.487 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Running websocket_api script
2022-10-06 16:49:58.488 INFO (MainThread) [homeassistant.helpers.script.websocket_api_script] websocket_api script: Executing step call service
2022-10-06 16:49:58.507 INFO (MainThread) [homeassistant.components.script.action_volet] Action Volet: Running script sequence
2022-10-06 16:49:58.508 INFO (MainThread) [homeassistant.components.script.action_volet] Action Volet: Executing step call service
2022-10-06 16:49:58.509 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'command' is undefined when rendering '{{ command }}'
2022-10-06 16:49:58.515 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'protocol' is undefined when rendering '{{ protocol }}'
2022-10-06 16:49:58.518 WARNING (MainThread) [homeassistant.helpers.template] Template variable warning: 'device_address' is undefined when rendering '{{ device_address }}'
2022-10-06 16:49:58.524 DEBUG (MainThread) [custom_components.rfplayer] Rfplayer send command for {'command': '', 'protocol': '', 'device_address': '', 'automatic_add': False}
2022-10-06 16:49:58.525 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] writing data: b'ZIA++ \n\r'
2022-10-06 16:49:58.548 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] received data: ZIA--Empty command
2022-10-06 16:49:58.548 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpprotocol] decoded packet: {'node': 'gateway', 'message': 'Empty command'}
2022-10-06 16:49:58.549 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:node,v:gateway
2022-10-06 16:49:58.550 DEBUG (MainThread) [custom_components.rfplayer.rflib.rfpparser] f:message,v:Empty command
Do you have any idea of the reason why my variables are not correctly passed to the service during the service call ?
Thank you for any help.