@Daniel_Dias flashaste o teu esp com tasmota certo?
Se sim só precisas disto:
switch:
- platform: template
switches:
tv_bia:
friendly_name: "Tv Bia"
value_template: "{% if is_state('binary_sensor.sensor_tv_bia', 'on') %}on{% else %}off{% endif %}"
turn_on:
service: broadlink.send
data:
host: 192.168.1.93
packet:
- 'JgCEAFceDh0ODw4ODx0dDg8PDg4PDg8ODw4PDg4PDg8ODw4ODw4dDw4dDg8OAAq7Vx0PHA8ODw4OHh0ODg8PDg4PDg8ODw4PDg4PDg8ODw4PDh0ODxwPDg8ACrtXHQ8cDw4ODw4eHQ4ODw8ODg8ODw4ODw4PDg8ODw4ODw4PHQ4PHA8ODwANBQAAAAA='
turn_off:
service: broadlink.send
data:
host: 192.168.1.93
packet:
- 'JgCEAFceDh0ODw4ODx0dDg8PDg4PDg8ODw4PDg4PDg8ODw4ODw4dDw4dDg8OAAq7Vx0PHA8ODw4OHh0ODg8PDg4PDg8ODw4PDg4PDg8ODw4PDh0ODxwPDg8ACrtXHQ8cDw4ODw4eHQ4ODw8ODg8ODw4ODw4PDg8ODw4ODw4PHQ4PHA8ODwANBQAAAAA='
icon_template: mdi:television
binary_sensor:
- platform: mqtt
name: sensor tv bia
state_topic: "estado/tvbia"
payload_on: "online"
payload_off: "offline"
device_class: connectivity