Hello Everybody,
I’m new to Home Assistant and started to learn automations. I want to turn my Projector On by pressing a button on my UI. The projector turns on using a Tasmota IR Blaster. This setup already works in a different scenario using HTTP-Post or using the MQTT Developer Tools in Home Assistant. But getting this running from an automation is killing me. I’m just looking at the action part at the moment.
Thats the part in my automation.yaml which is not working
- id: '1591999113709'
alias: Beamer Off
description: ''
trigger:
- entity_id: input_boolean.tv_on_off
from: 'Off'
platform: state
to: 'On'
condition: []
action:
- data:
payload: '{"Protocol":"NEC","Bits":32,"Data":"0x00FD9A65"}'
topic: cmnd/IR_LR/IRSend
service: mqtt.publish
configuration.yaml looks like this:
# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:
#calendar 27.05.2020
google:
client_id: blablabla.apps.googleusercontent.com
client_secret: notsoimportant
# Text to speech
tts:
- platform: google_translate
#sensors
sensor:
#Fritzbox 28.05.2020
- platform: fritzbox_callmonitor
name: callmon
username: justsomeuser
password: andaverysecretpasswort
phonebook: 1
prefixes:
- '+49'
- '+49123'
- '1234'
variable:
caller_information:
value: 'Unknown'
restore: true
attributes:
icon: mdi:phone-in-talk
name: Anruferinformation
group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
#Themes iOS 30.05.2020
frontend:
themes: !include_dir_merge_named themes
When I run the Automation by clicking “Execution” I get the following error:
Beamer Off: Error executing script. Invalid data for call_service at pos 1: required key not provided @ data[‘topic’]
Can someone explain to me what Key is required? According to the documentation of mqtt.publish all what is needed is the topic and payload?!
Any help is much appreciated.
Thank you very much