Hi! I am trying to control IOT Link on my pc through mqtt with input selects. There are multiple serious issues with this, namely that I am terrible at programming, not familiar with the syntax of jinja or yaml just impatient in general for any kind of debugging. I have tried to basically copy-paste code i have found on the site but of course it does not work.
This is what it looks like:
Invalid config for [automation]: invalid template (TemplateSyntaxError: expected token â,â, got â:â) for dictionary value @ data[âactionâ][0][âdata_templateâ][âoptionâ]. Got None. (See /config/configuration.yaml, line 48).
Invalid config for [automation]: Entity ID input_select. is an invalid entity id for dictionary value @ data[âtriggerâ][0][âentity_idâ]. Got None
expected str for dictionary value @ data[âidâ]. Got None
string value is None for dictionary value @ data[âaliasâ]. Got None. (See /config/configuration.yaml, line 48).
Line 48 is an enter, with nothing else, line 49 is:
Hereâs one error that stands out, thereâs a missing comma after 'logoff': 'Log Out'
When you use action.topic where is action defined? Maybe you want to use trigger as in trigger.topic ?
MQTT
Template variable
Data
trigger.platform
Hardcoded: mqtt .
trigger.topic
Topic that received payload.
trigger.payload
Payload.
trigger.payload_json
Dictonary of the JSON parsed payload.
trigger.qos
QOS of payload.
EDIT
Now that I look more closely, youâre using a state trigger so trigger.topic wonât work. What exactly are you trying to do in the template? It seems to me you may need to use trigger.to_state.state.
Unfortunately the error message didnât change much.
Invalid config for [automation]: Entity ID input_select. is an invalid entity id for dictionary value @ data[âtriggerâ][0][âentity_idâ]. Got None
expected str for dictionary value @ data[âidâ]. Got None
string value is None for dictionary value @ data[âaliasâ]. Got None. (See /config/configuration.yaml, line 48).
Can it be the input select?
pc_power:
name: PC Power
options:
- "Log Out"
- "Lock"
- "Reset"
To clarify, I originally didnât notice that the trigger is using the State platform. Therefore if you want the input_select's new state, it will be reported by trigger.to_state.state
Just in the topic but you need to restructure it like in petroâs example.
Iâm not familiar with IotLink but your example is odd because it doesnât supply a payload and, instead, uses something called option. What is that?
My intent with it is to use a drop down menu to lock, reboot or log out of my pc. In IOT Link the mqtt topics change instead of their payload. And of course it looks like it was pulled out of thin air. Because I have no idea about how it should look like. As I said, I was just trying to copy parts of code i simply donât understand. I donât even know what i donât know. My bad, I did not mean to upset anyone.
Just checked the docs for IotLink. Apparently leaving payload blank is valid. If left blank it applies to all users logged into the PC. Otherwise, you specify the userâs account name.
no ones upset, just trying to help you. The automation I provided should do what you want, assuming your input_select is build the way I assumed. Can you post your input select?
Invalid config for [automation]: Entity ID input_select. is an invalid entity id for dictionary value @ data[âtriggerâ][0][âentity_idâ]. Got None
expected str for dictionary value @ data[âidâ]. Got None
string value is None for dictionary value @ data[âaliasâ]. Got None. (See /config/configuration.yaml, line 48).
Invalid config for [automation]: Entity ID input_select. is an invalid entity id for dictionary value @ data[âtriggerâ][0][âentity_idâ]. Got None
expected str for dictionary value @ data[âidâ]. Got None
string value is None for dictionary value @ data[âaliasâ]. Got None. (See /config/configuration.yaml, line 48).