XiaomiAirFryer icon indicating copy to clipboard operation
XiaomiAirFryer copied to clipboard

Set Target temperature & Set Target time services - Allow Helpers

Open Biscotte31 opened this issue 2 years ago • 6 comments

Hello,

Here is a missing feature in this integration, concerning both Set Target time and Set Target temperature services.

For both target_time and target_temperature, simple numbers directly written in the automation are allowed. But I can't put any helper instead of it, even an imput_number helper.

In other words : This works `sequence: - service: xiaomi_airfryer.target_temperature data: entity_id: switch.xiaomi_airfryer_mi_smart_air_fryer_3_5l

target_temperature: 200`

But that does not: `sequence: - service: xiaomi_airfryer.target_temperature data: entity_id: switch.xiaomi_airfryer_mi_smart_air_fryer_3.5l

target_temperature: input_number.friteuse_temperature`

We should be able to set up these values directly from Home Assistant UI. This is annoying to go in the automation itself to update them.

Biscotte31 avatar Jul 10 '22 12:07 Biscotte31

How can I set the temperature and time from HA?

boyocska65 avatar Nov 23 '22 12:11 boyocska65

Good suggestion. I was trying to do the same without success

Axydas avatar Feb 07 '23 08:02 Axydas

I am trying to use template but when i save this:

type: custom:mushroom-number-card entity: input_number.mia_temp tap_action: action: call-service service: xiaomi_airfryer.target_temperature target: {} data: target_temperature: {{ states('input_number.mia_temp') | int }} entity_id: switch.xiaomi_airfryer_careli_fryer_maf05a icon_color: red

And if I go in to edit again this was saved:

type: custom:mushroom-number-card entity: input_number.mia_temp tap_action: action: call-service service: xiaomi_airfryer.target_temperature target: {} data: target_temperature: '[object Object]': null entity_id: switch.xiaomi_airfryer_careli_fryer_maf05a icon_color: red

in HAS template developer tool this gives the correct value: {{ states('input_number.mia_temp') | int }}

What am I doing wrong ,please help me here

tangrasmus avatar Feb 04 '24 18:02 tangrasmus

The way it is working for me. create 2 number helpers (1 for temp, 1 for time) create a script to set temp/time as per helpers and to start the air frier alias: Airfrier.set sequence:

  • service: xiaomi_airfryer.target_time data: entity_id: switch.xiaomi_airfryer_xiaomi_smart_air_fryer_pro_4l target_time: "{{ states('input_number.airfrier_time') }}"
  • service: xiaomi_airfryer.target_temperature data: entity_id: switch.xiaomi_airfryer_xiaomi_smart_air_fryer_pro_4l target_temperature: "{{ states('input_number.airfrier_temp') }}"
  • service: xiaomi_airfryer.start data: entity_id: switch.xiaomi_airfryer_xiaomi_smart_air_fryer_pro_4l mode: single

OBS: needs to be done in yaml (not working in UI)

now creatre a buttom to run the script tap action: call service service: script: turn on point to the entity related to your script

it will set temp and time as per current values of helper and start the frier.

Hope that helps

danielgoz avatar Feb 06 '24 11:02 danielgoz

Thanks wery much, it works with small changes in objects and after indention of "data" sections as below. I also putted the conversion to "INT" in the templates. NB!! the problem is here on Github when you save a comment the indention is removed airfryer_set: alias: AirfyerSet sequence:

  • service: xiaomi_airfryer.target_time data: entity_id: switch.xiaomi_airfryer_careli_fryer_maf05a target_time: '{{ states(''input_number.mia_time'')|int}}'
  • service: xiaomi_airfryer.target_temperature data: entity_id: switch.xiaomi_airfryer_careli_fryer_maf05a target_temperature: '{{ states(''input_number.mia_temp'')| int }}'
  • service: xiaomi_airfryer.start data: entity_id: switch.xiaomi_airfryer_careli_fryer_maf05a mode: single

tangrasmus avatar Feb 07 '24 11:02 tangrasmus

Megcsináltam a segéd identitásokat, meg a scriptet, de nem tudom hogyan tovább... segítesz?

boyocska65 avatar Feb 10 '24 09:02 boyocska65