forked from tasmota/blueprints
-
Notifications
You must be signed in to change notification settings - Fork 0
/
discovery-proscenic-t21.yaml
81 lines (74 loc) · 4.07 KB
/
discovery-proscenic-t21.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
80
81
blueprint:
name: 'Tasmota: Proscenic T21 Discover Entities'
description: |
Set up a Tasmota Proscenic T21 air fryer in Home Assistant. Blog post with [instructions](https://blakadder.com/proscenic-in-home-assistant).
Requires rules configured in Tasmota. See device template page for rules: [Proscenic T21 Air Fryer](https://templates.blakadder.com/proscenic_T21.html)
domain: automation
input:
topic:
name: Tasmota MQTT Topic
description: "Found in Information tab of the webUI. Warning, it is case sensitive!"
selector:
text:
mac_address:
name: Tasmota MAC Address
description: "Found in Tasmota webUI Information tab."
mode: single
max_exceeded: silent
variables:
topic: !input topic
mac_address: !input mac_address
macaddr: '{{- mac_address.split(":") | join -}}'
payload_mode: >-
{{ '{"name":"Cooking Mode","state_topic":"' ~ topic ~ '/mode","value_template":"{%set m=value|int%}{%if m==0%}Ready{%elif m==1%}Delayed Cook{%elif m==2%}Cooking{%elif m==3%}Keep Warm{%elif m==4%}Off{%elif m==5%}Cooking Complete{%else%}Unknown{%endif%}","icon":"mdi:pot-mix","avty_t":"tele/' ~ topic ~'/LWT","pl_avail":"Online","pl_not_avail":"Offline","unique_id":"' ~ macaddr ~ '_cookingmode","device":{"cns":[["mac","' ~ macaddr ~ '"]]}}' }}
payload_cookbook: >-
{{ '{"name":"Cookbook","state_topic":"' ~ topic ~ '/cookbook","value_template":"{%set m=value|int%}{%if m==0%}Default{%elif m==1%}Fries{%elif m==2%}Shrimp{%elif m==3%}Pizza{%elif m==4%}Chicken{%elif m==5%}Fish{%elif m==6%}Steak{%elif m==7%}Cake{%elif m==8%}Bacon{%elif m==9%}Preheat{%elif m==10%}Custom{%else%}Unknown{%endif%}","icon":"mdi:chef-hat","availability_topic":"tele/' ~ topic ~'/LWT","pl_avail":"Online","pl_not_avail":"Offline","unique_id":"' ~ macaddr ~ '_cookbook","device":{"cns":[["mac","' ~ macaddr ~ '"]]}}' }}
payload_cooktime: >-
{{ '{"name":"Cooking Time Set","state_topic":"' ~ topic ~ '/cooktime","command_topic":"cmnd/' ~ topic ~ '/var7","icon":"mdi:av-timer","availability_topic":"tele/' ~ topic ~ '/LWT","pl_avail":"Online","pl_not_avail":"Offline","unique_id":"' ~ macaddr ~ '_cooktime","device":{"cns":[["mac","' ~ macaddr ~ '"]]}}' }}
payload_warmtime: >-
{{ '{"name":"Keep Warm Time Set","state_topic":"' ~ topic ~ '/warmtime","command_topic":"cmnd/' ~ topic ~ '/var5","icon":"mdi:pot-steam","availability_topic":"tele/' ~ topic ~ '/LWT","pl_avail":"Online","pl_not_avail":"Offline","unique_id":"' ~ macaddr ~ '_warmtime","device":{"cns":[["mac","' ~ macaddr ~ '"]]}}' }}
payload_delayedtime: >-
{{ '{"name":"Delayed Cook Time Set","state_topic":"' ~ topic ~ '/delayedtime","command_topic":"cmnd/' ~ topic ~ '/var6","icon":"mdi:calendar-clock","availability_topic":"tele/' ~ topic ~ '/LWT","pl_avail":"Online","pl_not_avail":"Offline","unique_id":"' ~ macaddr ~ '_delayedtime","device":{"cns":[["mac","' ~ macaddr ~ '"]]}}' }}
trigger_variables:
topic: !input topic
trigger:
- platform: homeassistant
event: start
- platform: mqtt
topic: '{{ "tele/" ~ topic ~ "/LWT" }}'
payload: "Online"
action:
- service: mqtt.publish
data:
topic: "homeassistant/sensor/{{ macaddr }}/mode/config"
retain: true
payload: "{{ payload_mode }}"
- service: mqtt.publish
data:
topic: "homeassistant/sensor/{{ macaddr }}/cookbook/config"
retain: true
payload: "{{ payload_cookbook }}"
- service: mqtt.publish
data:
topic: "homeassistant/number/{{ macaddr }}/cooktime/config"
retain: true
payload: "{{ payload_cooktime }}"
- service: mqtt.publish
data:
topic: "homeassistant/number/{{ macaddr }}/warmtime/config"
retain: true
payload: "{{ payload_warmtime }}"
- service: mqtt.publish
data:
topic: "homeassistant/number/{{ macaddr }}/delayedtime/config"
retain: true
payload: "{{ payload_delayedtime }}"
- delay:
hours: 0
minutes: 0
seconds: 5
milliseconds: 0
- service: mqtt.publish
data:
topic: "cmnd/{{ topic }}/tuyasend8"
payload: ""