Script and input_slider need help

Hi

i have made following script:

pillstaken:
  alias: pillstaken
  sequence:
    - service: input_slider.select_value
      data_template:
        entity_id: >
          {% if float(now().strftime("%H")) > 15 %}
            input_select.eveningpillstaken
          {% else %}
            input_select.morningpillstaken
          {% endif %}
        value: 1

but nothing happens when run it, i can see that it chooses the right intity_id, but the value is never changed (nothing happens on the gui)?

the log:
2017-06-07 20:23:19 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 2897783792: Received {‘service_data’: {‘entity_id’: ‘script.pillstaken’}, ‘service’: ‘turn_on’, ‘type’: ‘call_service’, ‘id’: 10, ‘domain’: ‘script’}
2017-06-07 20:23:19 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_data=entity_id=script.pillstaken, service_call_id=<<<ID(ignore)>>>-4, service=turn_on, domain=script>
2017-06-07 20:23:19 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_data=None, service_call_id=<<<ID(ignore)>>>-5, service=pillstaken, domain=script>
2017-06-07 20:23:19 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=<<<ID(ignore)>>>-4>
2017-06-07 20:23:19 INFO (MainThread) [homeassistant.helpers.script] Script pillstaken: Running script
2017-06-07 20:23:19 INFO (MainThread) [homeassistant.helpers.script] Script pillstaken: Executing step call service
2017-06-07 20:23:19 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: service_data=value=1, entity_id=input_select.eveningpillstaken, service_call_id=<<<ID(ignore)>>>-6, service=select_value, domain=input_slider>
2017-06-07 20:23:19 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=<<<ID(ignore)>>>-6>
2017-06-07 20:23:19 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 2897783792: Sending {‘success’: True, ‘result’: None, ‘type’: ‘result’, ‘id’: 10}
2017-06-07 20:23:19 INFO (MainThread) [homeassistant.core] Bus:Handling <Event service_executed[L]: service_call_id=<<<ID(ignore)>>>-5>
2017-06-07 20:23:19 INFO (MainThread) [homeassistant.core] Bus:Handling <Event state_changed[L]: old_state=<state script.pillstaken=off; last_triggered=2017-06-07T20:20:02.888888+02:00, friendly_name=pillstaken @ 2017-06-07T20:19:06.169448+02:00>, entity_id=script.pillstaken, new_state=<state script.pillstaken=off; last_triggered=2017-06-07T20:23:19.091903+02:00, friendly_name=pillstaken @ 2017-06-07T20:19:06.169448+02:00>>
2017-06-07 20:23:19 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 2897390224: Sending {‘event’: {‘data’: {‘old_state’: <state script.pillstaken=off; last_triggered=2017-06-07T20:20:02.888888+02:00, friendly_name=pillstaken @ 2017-06-07T20:19:06.169448+02:00>, ‘entity_id’: ‘script.pillstaken’, ‘new_state’: <state script.pillstaken=off; last_triggered=2017-06-07T20:23:19.091903+02:00, friendly_name=pillstaken @ 2017-06-07T20:19:06.169448+02:00>}, ‘origin’: ‘LOCAL’, ‘time_fired’: datetime.datetime(2017, 6, 7, 18, 23, 19, 237649, tzinfo=), ‘event_type’: ‘state_changed’}, ‘type’: ‘event’, ‘id’: 2}
2017-06-07 20:23:19 DEBUG (MainThread) [homeassistant.components.websocket_api] WS 2897783792: Sending {‘event’: {‘data’: {‘old_state’: <state script.pillstaken=off; last_triggered=2017-06-07T20:20:02.888888+02:00, friendly_name=pillstaken @ 2017-06-07T20:19:06.169448+02:00>, ‘entity_id’: ‘script.pillstaken’, ‘new_state’: <state script.pillstaken=off; last_triggered=2017-06-07T20:23:19.091903+02:00, friendly_name=pillstaken @ 2017-06-07T20:19:06.169448+02:00>}, ‘origin’: ‘LOCAL’, ‘time_fired’: datetime.datetime(2017, 6, 7, 18, 23, 19, 237649, tzinfo=), ‘event_type’: ‘state_changed’}, ‘type’: ‘event’, ‘id’: 2}

please help

cheers
c_bb

Your service is calling an input_slider but the entity_id is referencing an input_select. Was that intentional?

1 Like

thank u so much … didn’t see that. Now it works :slight_smile:

cheers
c_bb