hasp?
This commit is contained in:
@@ -338,33 +338,262 @@ in
|
|||||||
|
|
||||||
openhasp = {
|
openhasp = {
|
||||||
plate = {
|
plate = {
|
||||||
|
nodes = [
|
||||||
|
"plate"
|
||||||
|
];
|
||||||
|
pages_jsonl = [
|
||||||
|
"pages.jsonl"
|
||||||
|
"page1.jsonl"
|
||||||
|
"page2.jsonl"
|
||||||
|
];
|
||||||
objects = [
|
objects = [
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------
|
||||||
|
# PAGE 1 LIGHTS
|
||||||
|
# -----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# -- Living Room Lights ---
|
||||||
{
|
{
|
||||||
obj = "p0b1"; # temperature label on all pages
|
obj = "p1b11"; # Toggle button
|
||||||
properties = {
|
properties = {
|
||||||
"text" = ''{{ states("sensor.thermostat_current_temperature") }}°F'';
|
val = '''{{ 1 if is_state("light.living_room_lights", "on") else 0 }}'';
|
||||||
};
|
text = '''{{ "\uE6E8" if is_state("light.living_room_lights", "on") else "\uE335" | e }}'';
|
||||||
}
|
text_color = '''{{ "#FFD700" if is_state("light.living_room_lights", "on") else "#666666" }}'';
|
||||||
{
|
|
||||||
obj = "p1b2"; # light-switch toggle button
|
|
||||||
properties = {
|
|
||||||
"val" = ''{{ 1 if states("light.living_room_lights") == "on" else 0 }}'';
|
|
||||||
"text" = ''{{ "\uE6E8" if is_state("light.living_room_lights", "on") else "\uE335" | e }}'';
|
|
||||||
};
|
};
|
||||||
event = {
|
event = {
|
||||||
"up" = {
|
down = {
|
||||||
service = "homeassistant.toggle";
|
action = "homeassistant.toggle";
|
||||||
entity_id = "light.living_room_lights";
|
target = {
|
||||||
|
entity_id = "light.living_room_lights";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
obj = "p1b3"; # dropdown
|
obj = "p1b12"; # Brightness slider
|
||||||
|
properties = {
|
||||||
|
val = ''
|
||||||
|
{{ state_attr('light.living_room_lights', 'brightness') | int(default=0)
|
||||||
|
if state_attr('light.living_room_lights', 'brightness') != None else 0 }}'';
|
||||||
|
click = '''{{ 'false' if is_state('light.living_room_lights', 'off') else 'true' }}'';
|
||||||
|
};
|
||||||
event = {
|
event = {
|
||||||
"changed" = {
|
changed = {
|
||||||
service = "persistent_notification.create";
|
action = "light.turn_on";
|
||||||
data = {
|
data = {
|
||||||
message = "I like {{ text }}";
|
brightness = "{{ val }}";
|
||||||
|
};
|
||||||
|
target = {
|
||||||
|
entity_id = "light.living_room_lights";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
up = {
|
||||||
|
action = "light.turn_on";
|
||||||
|
data = {
|
||||||
|
brightness = "{{ val }}";
|
||||||
|
};
|
||||||
|
target = {
|
||||||
|
entity_id = "light.living_room_lights";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
# -- Bedroom Lights ---
|
||||||
|
{
|
||||||
|
obj = "p1b21"; # Toggle button
|
||||||
|
properties = {
|
||||||
|
val = ''{{ 1 if is_state("light.bedroom_lights", "on") else 0 }}'';
|
||||||
|
text = ''{{ "\uE6E8" if is_state("light.bedroom_lights", "on") else "\uE335" | e }}'';
|
||||||
|
text_color = ''{{ "#FFD700" if is_state("light.bedroom_lights", "on") else "#666666" }}'';
|
||||||
|
};
|
||||||
|
event = {
|
||||||
|
down = {
|
||||||
|
action = "homeassistant.toggle";
|
||||||
|
target = {
|
||||||
|
entity_id = "light.bedroom_lights";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
obj = "p1b22"; # Brightness slider
|
||||||
|
properties = {
|
||||||
|
val = ''
|
||||||
|
{{ state_attr('light.bedroom_lights', 'brightness') | int(default=0)
|
||||||
|
if state_attr('light.bedroom_lights', 'brightness') != None else 0 }}'';
|
||||||
|
click = ''{{ 'false' if is_state('light.bedroom_lights', 'off') else 'true' }}'';
|
||||||
|
};
|
||||||
|
event = {
|
||||||
|
changed = {
|
||||||
|
action = "light.turn_on";
|
||||||
|
data = {
|
||||||
|
brightness= "{{ val }}";
|
||||||
|
};
|
||||||
|
target = {
|
||||||
|
entity_id = "light.bedroom_lights";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
up = {
|
||||||
|
action = "light.turn_on";
|
||||||
|
data = {
|
||||||
|
brightness = "{{ val }}";
|
||||||
|
};
|
||||||
|
target = {
|
||||||
|
entity_id = "light.bedroom_lights";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
# -- Front Closet Lights ---
|
||||||
|
{
|
||||||
|
obj = "p1b31"; # Toggle button
|
||||||
|
properties = {
|
||||||
|
val = ''{{ 1 if is_state("light.front_closet_lights", "on") else 0 }}'';
|
||||||
|
text = ''{{ "\uE6E8" if is_state("light.front_closet_lights", "on") else "\uE335" | e }}'';
|
||||||
|
text_color = ''{{ "#FFD700" if is_state("light.front_closet_lights", "on") else "#666666" }}'';
|
||||||
|
};
|
||||||
|
event = {
|
||||||
|
down = {
|
||||||
|
action = "homeassistant.toggle";
|
||||||
|
target = {
|
||||||
|
entity_id = "light.front_closet_lights";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
# -----------------------------------------------------------------------
|
||||||
|
# PAGE 2 FANS
|
||||||
|
# -----------------------------------------------------------------------
|
||||||
|
|
||||||
|
# -- Bedroom Fan (preset mode = auto/low/medium/high) ---
|
||||||
|
{
|
||||||
|
obj = "p2b11"; # Toggle button
|
||||||
|
properties = {
|
||||||
|
val = ''{{ 1 if is_state("fan.bedroom_fan", "on") else 0 }}'';
|
||||||
|
text = ''{{ "\uE210" if is_state("fan.bedroom_fan", "on") else "\uE210" | e }}'';
|
||||||
|
text_color = ''{{ "#4FC3F7" if is_state("fan.bedroom_fan", "on") else "#666666" }}'';
|
||||||
|
};
|
||||||
|
event = {
|
||||||
|
down = {
|
||||||
|
action = "fan.toggle";
|
||||||
|
target = {
|
||||||
|
entity_id = "fan.bedroom_fan";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
obj = "p2b13"; # Preset mode dropdown (auto/low/medium/high)
|
||||||
|
properties = {
|
||||||
|
val = ''
|
||||||
|
{% set modes = ['auto', 'low', 'medium', 'high'] %}
|
||||||
|
{% set current = state_attr('fan.bedroom_fan', 'preset_mode') %}
|
||||||
|
{{ modes.index(current) if current in modes else 0 }}'';
|
||||||
|
click = ''{{ 'false' if is_state('fan.bedroom_fan', 'off') else 'true' }}'';
|
||||||
|
};
|
||||||
|
event = {
|
||||||
|
changed = {
|
||||||
|
action = "fan.set_preset_mode";
|
||||||
|
data = {
|
||||||
|
preset_mode= "{{ text }}";
|
||||||
|
};
|
||||||
|
target = {
|
||||||
|
entity_id = "fan.bedroom_fan";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
# -- Bedroom Air Purifier ---
|
||||||
|
{
|
||||||
|
obj = "p2b21"; # Toggle button
|
||||||
|
properties = {
|
||||||
|
val = ''{{ 1 if is_state("fan.bedroom_air_purifier", "on") else 0 }}'';
|
||||||
|
text = ''{{ "\uE210" | e }}'';
|
||||||
|
text_color = ''{{ "#4FC3F7" if is_state("fan.bedroom_air_purifier", "on") else "#666666" }}'';
|
||||||
|
};
|
||||||
|
event = {
|
||||||
|
down = {
|
||||||
|
action = "fan.toggle";
|
||||||
|
target = {
|
||||||
|
entity_id = "fan.bedroom_air_purifier";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
obj = "p2b22"; # Speed slider (0-100%)
|
||||||
|
properties = {
|
||||||
|
val = ''
|
||||||
|
{{ state_attr('fan.bedroom_air_purifier', 'percentage') | int(default=0)
|
||||||
|
if state_attr('fan.bedroom_air_purifier', 'percentage') != None else 0 }}'';
|
||||||
|
click = ''{{ 'false' if is_state('fan.bedroom_air_purifier', 'off') else 'true' }}'';
|
||||||
|
};
|
||||||
|
event = {
|
||||||
|
changed = {
|
||||||
|
action = "fan.set_percentage";
|
||||||
|
data = {
|
||||||
|
percentage = "{{ val }}";
|
||||||
|
};
|
||||||
|
target = {
|
||||||
|
entity_id = "fan.bedroom_air_purifier";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
up = {
|
||||||
|
action = "fan.set_percentage";
|
||||||
|
data = {
|
||||||
|
percentage = "{{ val }}";
|
||||||
|
};
|
||||||
|
target = {
|
||||||
|
entity_id = "fan.bedroom_air_purifier";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
# -- Living Room Air Purifier ---
|
||||||
|
{
|
||||||
|
obj = "p2b31"; # Toggle button
|
||||||
|
properties = {
|
||||||
|
val = ''{{ 1 if is_state("fan.living_room_air_purifier", "on") else 0 }}'';
|
||||||
|
text = ''{{ "\uE210" | e }}'';
|
||||||
|
text_color = ''{{ "#4FC3F7" if is_state("fan.living_room_air_purifier", "on") else "#666666" }}'';
|
||||||
|
};
|
||||||
|
event = {
|
||||||
|
down = {
|
||||||
|
action = "fan.toggle";
|
||||||
|
target = {
|
||||||
|
entity_id = "fan.living_room_air_purifier";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
{
|
||||||
|
obj = "p2b32"; # Speed slider (0-100%)
|
||||||
|
properties = {
|
||||||
|
val = ''
|
||||||
|
{{ state_attr('fan.living_room_air_purifier', 'percentage') | int(default=0)
|
||||||
|
if state_attr('fan.living_room_air_purifier', 'percentage') != None else 0 }}'';
|
||||||
|
click = ''{{ 'false' if is_state('fan.living_room_air_purifier', 'off') else 'true' }}'';
|
||||||
|
};
|
||||||
|
event = {
|
||||||
|
changed = {
|
||||||
|
action = "fan.set_percentage";
|
||||||
|
data = {
|
||||||
|
percentage = "{{ val }}";
|
||||||
|
};
|
||||||
|
target = {
|
||||||
|
entity_id = "fan.living_room_air_purifier";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
up = {
|
||||||
|
action = "fan.set_percentage";
|
||||||
|
data = {
|
||||||
|
percentage = "{{ val }}";
|
||||||
|
};
|
||||||
|
target = {
|
||||||
|
entity_id = "fan.living_room_air_purifier";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|||||||
2503
session-ses_3409.md
Normal file
2503
session-ses_3409.md
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user