Let Home Assistant automations switch Auto standby per screen, and teach the skill (0.2.48)
App 0.2.48 / firmware 0.2.41: - Both boards expose the switch "Auto standby", the same standby_enabled setting as the checkbox in ESP Screens. Off wakes a dimmed screen and keeps it on; on counts the standby time from that moment. The change is saved on the screen and reported through esphome.screen_setting, so ESP Screens stores it too. No action runs at boot (restore_mode DISABLED). - The Claude skill gains "Standby and brightness": the switch, Standby after and the three brightness numbers, with an example automation that keeps screens awake while someone is home and a light is on or a window is open. - EASY_SETUP and the README describe the entities and the automation. Tested through Home Assistant's API on both bench boards (CYD: dimmed -> off wakes in 1.1 s, stays bright past the standby time, on dims again after 61 s); see docs/TEST_RESULTS_0248.md, which also records a CYD rollback after the first OTA that points to memory headroom, not to this change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,3 +1,11 @@
|
||||
## 0.2.48 (firmware 0.2.41)
|
||||
|
||||
Keep a screen awake from a Home Assistant automation.
|
||||
|
||||
- **Auto standby in Home Assistant.** Every screen gets the switch **Auto standby**, the same setting as the checkbox in ESP Screens. Turn it off and a dimmed screen wakes at once and stays on; turn it on and the screen dims again after its standby time, counted from that moment. So an automation can keep the screens on while someone is home and the lights are on or a window is open. A change shows in ESP Screens too and is kept after a restart.
|
||||
- **The Claude skill knows it.** The skill under Settings → Claude now also covers standby and brightness: the Auto standby switch, Standby after and the three brightness numbers, with an example automation. Install it again from the Settings page to get the new version.
|
||||
- Firmware 0.2.41 for both boards; the app offers the update.
|
||||
|
||||
## 0.2.47 (firmware 0.2.40)
|
||||
|
||||
The new climate card comes to the Guition, with fan and swing right on the card.
|
||||
|
||||
@@ -13,12 +13,13 @@ import zipfile
|
||||
|
||||
import tile_icons
|
||||
from core import (ALERT_ENDINGS, ALERT_EVENT, ALERT_FALLBACK_ICON, ALERT_FIELDS, ALERT_LIMITS, ALERT_MAX_TIMEOUT,
|
||||
ALERT_MIN_FIRMWARE, ALERT_SUGGESTED_ICONS, BROADCAST_DISMISS, BROADCAST_SHOW, TILE_BACKGROUNDS)
|
||||
ALERT_MIN_FIRMWARE, ALERT_SUGGESTED_ICONS, AUTO_STANDBY_MIN_FIRMWARE, BROADCAST_DISMISS, BROADCAST_SHOW,
|
||||
TILE_BACKGROUNDS)
|
||||
|
||||
NAME = 'esp-screens'
|
||||
# claude.ai accepts at most 200 characters; Claude Code picks the skill by this sentence.
|
||||
DESCRIPTION = ('Show alerts or notifications on ESP Screens (CYD and Guition touchscreens run from Home Assistant): '
|
||||
'all screens or one, now or in an automation, with the icons and colors they support.')
|
||||
DESCRIPTION = ('Alerts and standby on ESP Screens (CYD and Guition touchscreens run from Home Assistant): alerts on '
|
||||
'all screens or one with the icons they support, and an automation that keeps screens awake.')
|
||||
TYPES = {'string': 'text', 'int': 'number', 'bool': 'on/off'}
|
||||
|
||||
def skill_dir(config=None):
|
||||
@@ -31,7 +32,8 @@ def _limit(name, kind):
|
||||
return f'0 to {ALERT_MAX_TIMEOUT} s' if kind == 'int' else ''
|
||||
|
||||
def text():
|
||||
"""SKILL.md: when to use it, the event for every screen, the per-screen action, fields, colors and icons."""
|
||||
"""SKILL.md: when to use it, the event for every screen, the per-screen action, fields, colors and icons,
|
||||
then the standby and brightness entities every screen has in Home Assistant."""
|
||||
fields = '\n'.join(f'| `{name}` | {TYPES[kind]} | {help_} | {_limit(name, kind)} |' for name, kind, _, help_, _ in ALERT_FIELDS)
|
||||
colors = ', '.join(f"`{name}` ({item['label']})" for name, item in TILE_BACKGROUNDS.items() if item['color'])
|
||||
suggested = ', '.join(f'`{name}`' for name in ALERT_SUGGESTED_ICONS)
|
||||
@@ -43,10 +45,12 @@ name: {NAME}
|
||||
description: {DESCRIPTION}
|
||||
---
|
||||
|
||||
# Alerts on ESP Screens
|
||||
# Alerts and standby on ESP Screens
|
||||
|
||||
Made by ESP Screen Manager (ESP Screens → Settings → Claude). Installing it again from there replaces this file, so changes made here get lost.
|
||||
|
||||
Two things Home Assistant can do with the screens: show an alert (below), and keep a screen awake or let it dim ([Standby and brightness](#standby-and-brightness)).
|
||||
|
||||
An alert is a card over the whole screen with an icon, a title, a subtitle and one button. It wakes the screen and stays until someone presses the button or the timeout runs out. A new alert replaces the one showing.
|
||||
|
||||
## All screens: fire an event
|
||||
@@ -160,6 +164,56 @@ actions:
|
||||
sequence:
|
||||
- event: {BROADCAST_DISMISS}
|
||||
```
|
||||
|
||||
## Standby and brightness
|
||||
|
||||
Every screen has these entities in Home Assistant, on its ESPHome device. `<screen>` stands for the start Home Assistant gave the screen's entity IDs, the same as in `text.<screen>_tile_settings`; look them up rather than guessing.
|
||||
|
||||
| Entity | What it does |
|
||||
|---|---|
|
||||
| `switch.<screen>_auto_standby` | On: the screen dims after the standby time without a touch. Off: the screen wakes up and stays on. Firmware {AUTO_STANDBY_MIN_FIRMWARE} or newer. |
|
||||
| `number.<screen>_standby_after` | Seconds without a touch before standby, 60 to 86400. |
|
||||
| `number.<screen>_normal_brightness` | Brightness while in use, 5 to 100 %. |
|
||||
| `number.<screen>_standby_brightness` | Brightness in standby, 0 to 100 %, at most the normal brightness. |
|
||||
| `number.<screen>_night_brightness` | Brightness in standby during the night hours set in ESP Screens, 0 to 100 %. |
|
||||
|
||||
These are the same settings as in ESP Screens: a change made from Home Assistant shows there too and stays after a restart. Turning Auto standby on again counts the standby time from that moment. Every change is saved on the screen, so switch on changes that happen a few times a day (someone comes home, a light goes on, a window opens), never on every motion.
|
||||
|
||||
To keep screens on while something is going on at home, turn Auto standby off when the situation starts and on when it ends, all from one automation. Example with placeholders for the user's own entities:
|
||||
|
||||
```yaml
|
||||
alias: Keep the screens awake
|
||||
mode: restart
|
||||
triggers:
|
||||
- trigger: state
|
||||
entity_id:
|
||||
- person.alex
|
||||
- light.living_room
|
||||
- binary_sensor.bedroom_window
|
||||
actions:
|
||||
- if:
|
||||
- condition: state
|
||||
entity_id: person.alex
|
||||
state: home
|
||||
- condition: or
|
||||
conditions:
|
||||
- condition: state
|
||||
entity_id: light.living_room
|
||||
state: "on"
|
||||
- condition: state
|
||||
entity_id: binary_sensor.bedroom_window
|
||||
state: "on"
|
||||
then:
|
||||
- action: switch.turn_off
|
||||
target:
|
||||
entity_id: switch.kitchen_screen_auto_standby
|
||||
else:
|
||||
- action: switch.turn_on
|
||||
target:
|
||||
entity_id: switch.kitchen_screen_auto_standby
|
||||
```
|
||||
|
||||
Replace the person, light, window and screen with the real entity IDs (ask which screens when there are several), and leave out conditions the user did not ask for.
|
||||
'''
|
||||
|
||||
def status(directory):
|
||||
|
||||
@@ -17,7 +17,9 @@ WEEKDAYS = ['Mo', 'Tu', 'We', 'Th', 'Fr', 'Sa', 'Su']
|
||||
REPO = 'https://github.com/MaxGramser/homeassistant_espscreen'
|
||||
REFS = {'cyd': 'main', 'guition': 'main'}
|
||||
# Firmware shipped with this app release; screens below it get an update offer.
|
||||
FIRMWARE_VERSION = '0.2.40'
|
||||
FIRMWARE_VERSION = '0.2.41'
|
||||
# The Auto standby switch a screen offers Home Assistant automations.
|
||||
AUTO_STANDBY_MIN_FIRMWARE = '0.2.41'
|
||||
ATTRS = frozenset('brightness percentage current_position current_temperature temperature current_humidity min_temp max_temp target_temp_step supported_color_modes hvac_modes hvac_action hs_color color_temp_kelvin min_color_temp_kelvin max_color_temp_kelvin fan_speed_list unit_of_measurement battery_level fan_speed volume_level is_volume_muted media_title options min max step temperature_unit supported_features device_class next_rising next_setting finishes_at duration remaining humidity wind_speed wind_speed_unit apparent_temperature fan_modes swing_modes fan_mode swing_mode'.split())
|
||||
# Attributes whose boolean value the screen needs; every other bool stays behind.
|
||||
BOOL_ATTRS = frozenset(['is_volume_muted'])
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
name: ESP Screen Manager
|
||||
version: "0.2.47"
|
||||
version: "0.2.48"
|
||||
slug: esp_screen_manager
|
||||
description: Choose tiles for your CYD and Guition touchscreen, without reflashing.
|
||||
url: https://github.com/MaxGramser/homeassistant_espscreen
|
||||
|
||||
Reference in New Issue
Block a user