Weird error in automation

Ive got a couple of simple automation which use dictionaries and dictionaries in both are mirrored.

- alias: Set Central Heating Temporary Mode
    initial_state: on
    trigger:
      - platform: state
        entity_id: input_select.central_heating_temporary_mode
    action:
      - service: automation.turn_off
        entity_id: automation.get_central_heating_temporary_mode
      - service: mqtt.publish
        data_template:
          topic: "ebusd/f47/Hc1SFMode/set"
          payload: >
            {% set tpmode = {
              'None': 'none',
              'Day away': 'onedayholiday',
              'Day in': 'onedaybankholiday',
              'Party': 'party' } %}
            {{ tpmode.get(trigger.to_state.state,'none') }}
      - delay: 00:00:05
      - service: automation.turn_on
        entity_id: automation.get_central_heating_temporary_mode

  - alias: Get Central Heating Temporary Mode
    initial_state: on
    trigger:
      - platform: mqtt
        topic: "ebusd/f47/Hc1SFMode"
    action:
      service: input_select.select_option
      data_template:
        entity_id: input_select.central_heating_temporary_mode
        option: >
          {% set tpmode = {
            'none': 'None',
            'onedayholiday': 'Day away',
            'onedaybankholiday': 'Day in',
            'party': 'Party' } %}
          {{ tpmode.get('trigger.payload','None') }}

Unfortunately, the second one doesnt seem to work and Home Assistant throws out an error:

Logger: homeassistant.components.automation.get_central_heating_temporary_mode
Source: helpers/script.py:1122
Integration: Automation ([documentation](https://www.home-assistant.io/integrations/automation), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+automation%22))
First occurred: November 23, 2020, 8:04:30 PM (313 occurrences)
Last logged: 1:14:05 AM

* Get Central Heating Temporary Mode: Error executing script. Invalid data for call_service at pos 1: string value is None for dictionary value @ data['option']
* Get Central Heating Temporary Mode: Already running
logger: homeassistant.components.automation.get_central_heating_temporary_mode
Source: core.py:1405
Integration: Automation ([documentation](https://www.home-assistant.io/integrations/automation), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+automation%22))
First occurred: November 23, 2020, 8:04:30 PM (311 occurrences)
Last logged: 1:14:05 AM

While executing automation automation.get_central_heating_temporary_mode

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 433, in async_trigger await self.action_script.async_run( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 1010, in async_run await asyncio.shield(run.async_run()) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 245, in async_run await self._async_step(log_exceptions=False) File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 253, in _async_step await getattr( File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 460, in _async_call_service_step await service_task File "/usr/src/homeassistant/homeassistant/core.py", line 1405, in async_call processed_data = handler.schema(service_data) File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 218, in __call__ return self._exec((Schema(val) for val in self.validators), v) File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 340, in _exec raise e if self.msg is None else AllInvalid(self.msg, path=path) File "/usr/local/lib/python3.8/site-packages/voluptuous/validators.py", line 336, in _exec v = func(v) File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 817, in validate_callable return schema(data) File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict return base_validate(path, iteritems(data), out) File "/usr/local/lib/python3.8/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: string value is None for dictionary value @ data['option']

I don’t really get it, why only one errors if both have almost same dictionaries but mirrored.

Probably because ‘none’ is a special state in home assistant. It is literally being interpreted as being a null value. Try a synonym of none in your options instead. E.g. ‘Nil’ or ‘Unspecified’.

Makes sense, but the problem is that my boiler posts “none” to MQTT and there’s not much i can do about it

Sure there is. Insert a service to read the trigger payload and save it. If the saved variable is ‘none’ change it to ‘Notting’, ‘Nil’ or ‘Unspecified’. Then use that saved value to select your input_select option.