dimagoltsman / generic-remote-control-card

Generic Remote control card for HACS
97 stars 22 forks source link

How to call a script instead of remote.send call #36

Open stain3565 opened 1 year ago

stain3565 commented 1 year ago

I am using the remote cards with a ZS06 Zigbee IR remote that requires the publishing of ir_send_code mqtt topics to transmit the ir signals. So I tried to set up the buttons to call a script that then creates and publishes an appropriate mqtt topic.

I have had a few attempts including those below:

pwr: call: script.living_room_ir_button data: button_pressed: '{{ input_text.btyouview_pwr_text }}'

pwr: service: script.living_room_ir_button data: button_pressed: '{{ input_text.btyouview_pwr_text }}'

These have not worked and all the example remotes are using the remote.send method in their calls. Is there any way that the card button call can trigger a script rather than a remote.send command or is there a way of tailoring the remote.send to actually call a script?

lukaszsobala commented 1 year ago

I have a similar question. Is there a way to make it publish a MQTT topic instead of calling the Remote service?

stain3565 commented 10 months ago

I have created a remote for Roku Premiere that does just that. an Mqtt message is published, containing the ir string and, in my case, a zigbeemqtt sonoff ir blaster processes this and sends the ir. I have added it to the github ptoject and guess i am just waiting for this to be accepted and merged. Not sure how long that process will take though. However, whilst waiting for that to happen, I have created a zip file which i will attach here. Hope it helps. A few more details are in the ReadMe file under the title Roku Premiere. Apologies that there are extra folder levels but the code is all there generic-remote-control-card_2.zip