-
Notifications
You must be signed in to change notification settings - Fork 7
/
proscenic_t21_cookbook.yaml
79 lines (68 loc) · 2.57 KB
/
proscenic_t21_cookbook.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
blueprint:
name: 'Tasmota: Proscenic T21 Cookbook '
description: |
Changes cookbook selection when input_select is changed and updates the input_select if cookbook is changed externally
Create a Dropdown Helper before proceeding!
<details>
![Dropdown Helper](https://raw.githubusercontent.com/blakadder/blog/master/assets/images/proscenic/input_select.jpg)
</details>
Used for [Proscenic T21 Air Fryer](https://templates.blakadder.com/proscenic_T21.html). Blog post with [instructions](https://blakadder.com/proscenic-in-home-assistant).
domain: automation
input:
inputselect:
name: Dropdown helper
selector:
entity:
domain: input_select
cookbook:
name: Cookbook sensor
selector:
entity:
integration: mqtt
domain: sensor
topic:
name: Tasmota MQTT Topic
description: "Found in Information tab of the webUI. Beware, it is case sensitive!"
selector:
text:
mode: single
max_exceeded: silent
variables:
inputselect: !input inputselect
cookbook: !input cookbook
topic: !input topic
trigger:
- platform: state
entity_id: !input inputselect
- platform: state
entity_id: !input cookbook
action:
- choose:
- conditions:
- condition: template
value_template: '{{ trigger.entity_id == cookbook }}'
sequence:
- service: input_select.select_option
target:
entity_id: !input inputselect
data:
option: '{{ trigger.to_state.state }}'
- conditions:
- condition: template
value_template: '{{ trigger.entity_id == inputselect }}'
sequence:
- service: mqtt.publish
data:
topic: cmnd/{{ topic }}/TuyaSend4
payload_template: >-
3,{% if trigger.to_state.state == 'Default' %}0{% elif
trigger.to_state.state == 'Fries' %}1{% elif
trigger.to_state.state == 'Shrimp' %}2{% elif
trigger.to_state.state == 'Pizza' %}3{% elif
trigger.to_state.state == 'Chicken' %}4{% elif
trigger.to_state.state == 'Fish' %}5{% elif
trigger.to_state.state == 'Steak' %}6{% elif
trigger.to_state.state == 'Cake' %}7{% elif
trigger.to_state.state == 'Bacon' %}8{% elif
trigger.to_state.state == 'Preheat' %}9{% elif
trigger.to_state.state == 'Custom' %}10{%endif%}