bt_pct_val is a variable and doesn’t belong to the trigger.
Did you not get any error under Configuration -> Logs Do you even see the automation under Developer Tools -> States.
Also for this use case, an input_select with the 4 different options is the better choice instead of having multiple input_booleans, as the options are mutually exclusive.
Configuration logs was quite untill I stop and start hass(I was using pm2 restart hass till now).
Now I do see following error:
2|hass | 2021-01-12 09:33:53 ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: not a valid value for dictionary value @ data['action'][3]['entity_id']. Got None. (See /data/data/com.termux/files/home/.homeassistant/configuration.yaml, line 11).
Yikes, I’m sorry.
I did change it, but result is still same.
Logger: homeassistant.config
Source: config.py:415
First occurred: 9:48:50 AM (1 occurrences)
Last logged: 9:48:50 AM
Invalid config for [automation]: not a valid value for dictionary value @ data['action'][3]['entity_id']. Got None. (See /data/data/com.termux/files/home/.homeassistant/configuration.yaml, line 11).
2|hass | 2021-01-12 10:07:31 ERROR (MainThread) [homeassistant.components.automation.update_the_location_based_on_st] Update the location based on ST: Error executing script. Invalid data for call_service at pos 3: not a valid value for dictionary value @ data['entity_id']
2|hass | 2021-01-12 10:07:31 ERROR (MainThread) [homeassistant.components.automation.update_the_location_based_on_st] While executing automation automation.update_the_location_based_on_st
2|hass | Traceback (most recent call last):
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/homeassistant/components/automation/__init__.py", line 404, in async_trigger
2|hass | await self.action_script.async_run(
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 1026, in async_run
2|hass | await asyncio.shield(run.async_run())
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 242, in async_run
2|hass | await self._async_step(log_exceptions=False)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 250, in _async_step
2|hass | await getattr(
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 457, in _async_call_service_step
2|hass | await service_task
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/homeassistant/core.py", line 1399, in async_call
2|hass | processed_data = handler.schema(service_data)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/validators.py", line 218, in __call__
2|hass | return self._exec((Schema(val) for val in self.validators), v)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/validators.py", line 340, in _exec
2|hass | raise e if self.msg is None else AllInvalid(self.msg, path=path)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/validators.py", line 336, in _exec
2|hass | v = func(v)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 272, in __call__
2|hass | return self._compiled([], data)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
2|hass | return schema(data)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 272, in __call__
2|hass | return self._compiled([], data)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
2|hass | return base_validate(path, iteritems(data), out)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
2|hass | raise er.MultipleInvalid(errors)
2|hass | voluptuous.error.MultipleInvalid: not a valid value for dictionary value @ data['entity_id']
I can see automation in developer tools -> state now.
automation.update_the_location_based_on_st on last_triggered: 2021-01-12T15:07:31.687826+00:00
mode: single
current: 0
id: LocationSync
friendly_name: Update the location based on ST
However, there is one exception to the rule and that’s the commonly-used entity_id option when it contains no template. Consider it to be a ‘shortcut’ purely for convenience.
@123
Thank you. I have updated the automation as per your suggestion. It loads fine, no error but shows error while execution.
To execute/test this trigger, I’m manually changing virtual_security_dimmer value in ST app, which triggers and executes this automation. but it gives following error.
2|hass | 2021-01-12 10:25:45 ERROR (MainThread) [homeassistant.components.automation.update_the_location_based_on_st] Update the location based on ST: Error executing script. Invalid data for call_service at pos 3: not a valid value for dictionary value @ data['entity_id']
2|hass | 2021-01-12 10:25:45 ERROR (MainThread) [homeassistant.components.automation.update_the_location_based_on_st] While executing automation automation.update_the_location_based_on_st
2|hass | Traceback (most recent call last):
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/homeassistant/components/automation/__init__.py", line 404, in async_trigger
2|hass | await self.action_script.async_run(
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 1026, in async_run
2|hass | await asyncio.shield(run.async_run())
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 242, in async_run
2|hass | await self._async_step(log_exceptions=False)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 250, in _async_step
2|hass | await getattr(
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/homeassistant/helpers/script.py", line 457, in _async_call_service_step
2|hass | await service_task
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/homeassistant/core.py", line 1399, in async_call
2|hass | processed_data = handler.schema(service_data)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/validators.py", line 218, in __call__
2|hass | return self._exec((Schema(val) for val in self.validators), v)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/validators.py", line 340, in _exec
2|hass | raise e if self.msg is None else AllInvalid(self.msg, path=path)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/validators.py", line 336, in _exec
2|hass | v = func(v)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 272, in __call__
2|hass | return self._compiled([], data)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable
2|hass | return schema(data)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 272, in __call__
2|hass | return self._compiled([], data)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict
2|hass | return base_validate(path, iteritems(data), out)
2|hass | File "/data/data/com.termux/files/usr/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping
2|hass | raise er.MultipleInvalid(errors)
2|hass | voluptuous.error.MultipleInvalid: **not a valid value for dictionary value @ data['entity_id']**
@Burningstone: Yes sir, I did both.
But found the issue.
the last service: turn_on call has only one entity_id based on if_else logic, so I don’t need to put - in front of that entity id name.
When I changed it, it started working. Tested few times and working fine.
Running on older Android phone with termux. Running Node-red and mosquitto as well.
Integrated ST with HA as first step of migrating away(still using zwave and zigbee radios from ST and probably continue using until i’m moving my HA on raspberry pi).
I was pasting it as I was copying, I’m not sure why it’s not showing on code snippet. I apologize for wasting your time. You guys would have spotted the issue way sooner.
A cardinal rule when requesting assistance is to provide accurate information. If you show us one thing but use something else, we are left to work with faulty information.
Yes, we would have noticed the superfluous hyphen immediately.