Input number not a Int

I’m trying to use a input number to dynamically set the number repeats my vacuum do but it doesn’t work, it just makes vacuum go to wrong places.

‘235651221561231’:
alias: 'Vacuum kitchen ’
sequence:

  • service: vacuum.send_command
    data:
    entity_id: vacuum.robby
    command: app_zoned_clean
    params:
      • 26335
      • 27029
      • 29785
      • 28379
      • 3 #{{ states.input_number.vacuum_repeats.state | int }}
  • service: input_boolean.turn_off
    data:
    entity_id: input_boolean.robby_is_empty

Try it like this:

  params:
    - 26335
    - 27029
    - 29785
    - 28379
    - "{{ states.input_number.vacuum_repeats.state | int }}"

All ready did that. No luck.

I thought it might be worth trying but the underlying reason why it fails to work is because the integration doesn’t support it.

Same problem, with no available workaround, reported here:

but you didn’t try it with data_template

service: vacuum.send_command
data_template:
  entity_id: vacuum.robby
  command: app_zoned_clean
  params:
  - 26335
  - 27029
  - 29785
  - 28379
  - "{{ states.input_number.vacuum_repeats.state | int }}"

EDIT:
@123 appears to be onto a totally separate issue with the component. Making data_template less likely to work. But data_template is always required when templating fields inside data.

I missed that one (because reading unformatted YAML is never fun). Use of data: will definitely prevent any template from being evaluated!

FWIW, in the posted link, a solution offered by tom_I used data_template but the suggested template failed to be evaluated correctly. The OP reported the error message showed the params list had all its items in quotes, indicating they had all been converted to strings.

2018-08-11 10:58:12 INFO (MainThread) [homeassistant.core] Bus:Handling <Event call_service[L]: domain=vacuum, service=send_command, service_data=command=app_zoned_clean, entity_id=vacuum.xiaomi_vacuum_cleaner, params=[[‘25850’, ‘26750’, ‘28750’, ‘30550’, ‘1’]]>

1 Like

Amen to that. That’s why I chimed in… but then read your response after. Probably should have reversed that order! My b.

1 Like

What vacuum platform are you using?

If xiaomi_miio then you should use the xiaomi_miio.vacuum_clean_zone service instead.

Thanks, this was the solution.

1 Like

Lateral-thinking Phil strikes again! :wink:

Good job! :+1:

1 Like