with this firmware voice assistant it blocks after some request do you have the same problem??
Well youkorr, I fixed the quotation marks, but itās still not working so maybe thatās why?
Hey there,
maybe you can help me with the following condition?
- Iām using the implementation of the at581x which came with ESP 2024.4 in my configuration.
- I also have the āradar durationā which shuts off the Display, if no motion will be detected for amount of āxā seconds
at581x:
id: "Radar"
i2c_id: bus_b
binary_sensor:
- platform: gpio
pin:
number: GPIO21
name: "Presence detect"
disabled_by_default: false
publish_initial_state: true
device_class: "occupancy"
filters:
- delayed_off: !lambda return id(radar_delayed_off).state * 1000;
on_release:
then:
- if:
condition:
switch.is_on: mute_when_absent
then:
- switch.turn_on: mute
- light.turn_off: led
on_press:
then:
- if:
condition:
switch.is_on: mute_when_absent
then:
- switch.turn_off: mute
- light.turn_on: led
number:
- platform: template
name: "Presence duration"
id: radar_delayed_off
icon: mdi:account-clock
optimistic: true
restore_value: true
initial_value: 60
min_value: 0
step: 5
max_value: 300
unit_of_measurement: s
entity_category: config
mode: box
switch:
- platform: at581x
at581x_id: "Radar"
name: "Enable Radar"
- platform: template
name: "Mute when absent"
id: mute_when_absent
icon: mdi:account-right-arrow
optimistic: true
entity_category: config
restore_mode: RESTORE_DEFAULT_OFF
now, the at581x comes with an additional switch, with which you can enable / disable the radar sensor at allā¦
So I would like to do the following:
Only if radar is enabled, the device should actually shut the display off when no motion will be detected.
Else, it will shut off - but it does no longer activate itself, because the radar has been disabled.
I think, this should be in the conditions of the binary_sensor?
My preference for the idle screen is to display a large timestamp as opposed to the tiny timestamps on a lot of these examples. I have it like this:
font:
- file:
type: gfonts
family: Orbitron
weight: 500
glyphs: "0123456789:"
id: font_large
# bpp: 4
size: 95
pages:
- id: idle_page
lambda: |-
it.fill(id(idle_color));
it.printf(160, 120, id(font_large), id(listening_color), TextAlign::CENTER, "%s", id(text_time).state.c_str());
where text_time
is a text sensor from HA. I suppose i could use the time component as well. I also have a modification where iāll display a countdown timer if there is a timer going as a visual indicator in our kitchen. Works nicely. I just need to get the wake word to be more sensitive (it seems to have lost sensitivity with the recent updates).
how could I insert it into my compile??
I guess it depends. What does your yaml look like currently? If youāre running the default that esphome recommends, youāll need to do a bit of magic where you override the idle page.
text_sensor:
- id: text_time
platform: homeassistant
entity_id: sensor.local_clock
on_value:
then:
- component.update: s3_box_lcd
# - id: time_remaining
# platform: homeassistant
# entity_id: sensor.remaining_time
# on_value:
# then:
# - component.update: s3_box_lcd
# color:
# - id: countdown_color
# hex: "FFEA00"
display:
- id: !extend s3_box_lcd #<---this is the important part.
pages:
- id: !extend idle_page #<---this is the important part.
lambda: |-
it.fill(id(loading_color));
it.printf(160, 120, id(font_large), id(listening_color), TextAlign::CENTER, "%s", id(text_time).state.c_str());
I have the at581x radar configured, with the following relevant code in my firmware:
at581x:
id: "Radar"
i2c_id: bus_a
switch:
- platform: at581x
at581x_id: "Radar"
name: "Enable Radar"
binary_sensor:
- platform: gpio
pin:
number: GPIO21
name: "Presence detect"
disabled_by_default: false
publish_initial_state: true
device_class: "occupancy"
filters:
- delayed_off: !lambda return id(radar_delayed_off).state * 1000;
(further code here which is not relevant)
However, when I turn the Radar switch on and off I get the following error in my log:
[E][at581x:188]: Failed to write AT581X RF mode
I think this is why Radar is always on even if I turn it off (@CChris, this may be why even when you turn the radar off, the device still shuts off the display when no motion is detected - I presume that if the radar switch worked, and the radar was off, it wouldnāt trigger no presence/motion state).
Does anyone else get this error?
I had to change the radar busā¦
that was a mistake from my side - it is bus_b
at581x:
id: "Radar"
i2c_id: bus_b
with this config, the display goes off, when the ātimeoutā for movement has been reached, but then, it will not turn on again, because the radar has been disabled
Thanks for that. I fixed my repository so that the radar works and the display doesnāt go off if the radar is turned off.
impossible compile
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
font:
- file:
type: gfonts
family: Orbitron
weight: 500
glyphs: ā0123456789:ā
id: font_largebpp: 4
size: 95
text_sensor:
- id: text_time
platform: homeassistant
entity_id: sensor.local_clock
on_value:
then:
- component.update: s3_box_lcd - id: time_remaining
platform: homeassistant
entity_id: sensor.remaining_time
on_value:
then:
- component.update: s3_box_lcd
color:
- id: countdown_color
hex: āFFEA00ā
display:
- id: !extend s3_box_lcd #<āthis is the important part.
pages:- id: !extend idle_page #<āthis is the important part.
lambda: |-
it.fill(id(loading_color));
it.printf(160, 120, id(font_large), id(listening_color), TextAlign::CENTER,
- id: !extend idle_page #<āthis is the important part.
i2c:
-
id: bus_a
sda: GPIO38
scl: GPIO39
scl_pullup_enabled: true
frequency: 50kHz -
id: bus_b
sda: GPIO2
scl: GPIO1
scl_pullup_enabled: true
frequency: 50kHz
sensor:
-
platform: aht10
i2c_id: bus_b
variant: AHT20
temperature:
name: āTemperatureā
id: s3temp
humidity:
name: āHumidityā
update_interval: 60s -
platform: adc
pin: GPIO10
name: āBattery voltageā
id: battery_voltage
unit_of_measurement: āVā
accuracy_decimals: 1
device_class: āvoltageā
entity_category: ādiagnosticā
disabled_by_default: true
update_interval: 30s
attenuation: auto
filters:
- multiply: 4.11 -
platform: copy
id: battery_percent
source_id: battery_voltage
name: āBattery levelā
unit_of_measurement: ā%ā
accuracy_decimals: 0
device_class: ābatteryā
entity_category: ādiagnosticā
filters:- lambda: return (x - 2.7) / (4.2 - 2.7) * 100;
- clamp:
min_value: 0
max_value: 100
number:
- platform: template
name: āPresence durationā
id: radar_delayed_off
icon: mdi:account-clock
optimistic: true
restore_value: true
initial_value: 60
min_value: 0
step: 5
max_value: 300
unit_of_measurement: s
entity_category: config
mode: box
binary_sensor:
- platform: gpio
pin:
number: GPIO21
name: āPresence detectā
disabled_by_default: false
publish_initial_state: true
device_class: āoccupancyā
filters:- delayed_off: !lambda return id(radar_delayed_off).state * 1000;
on_release:
then:- if:
condition:
switch.is_on: mute_when_absent
then:
- switch.turn_on: mute
- light.turn_off: led
on_press:
then: - if:
condition:
switch.is_on: mute_when_absent
then:
- switch.turn_off: mute
- light.turn_on: led
- if:
- delayed_off: !lambda return id(radar_delayed_off).state * 1000;
at581x:
id: āRadarā
i2c_id: bus_b
thanks mate, thatās awsome
Now, I have just to adjust some of the display elements and place them as I want.
Think that donāt seem to work (or maybe, because I made some errors while adopting your changes to my config)
- volume up/down/speaker mute does not work when it is playing media files (f.e. HomeAssistant RadioBrowser)
- when itās playing back media, it is using the āreplyā image, not the āmedia playbackā imageā¦
I wonder also, if it would be possible, to show somehow where the touch areas on the device areā¦
Maybe, some color-gradient in the background?
Place the yaml between three backticks so we can properly see it. See chapter 11 of:
It looks like you arent using the default s3-box3 yaml configuration but someone elses. If you have the entire config in your yaml, you can just add the color, the text_sensor and the font to those existing sections. Youāll need to expose a local_clock text sensor and a timer text sensor from HA. You can create the timer and a template sensor for local_clock (template is just {{ now().timestamp() | timestamp_custom('%-I:%M') }}
) in your helpers section of devices and this is what i have in my configuration.yaml for remaining_time:
template:
- trigger:
- platform: time_pattern
seconds: '/1'
sensor:
name: Remaining Time
unique_id: remaining_time
# availability: >
# {{ state_attr('timer.timer1', 'finishes_at') | has_value }}
state: >
{% set entity_id = state_attr('timer.timer1', 'finishes_at') %}
{% if entity_id != None %}
{{ ((entity_id | as_datetime) - now()).total_seconds() | int | timestamp_custom('%-M:%S', default=0) }}
{% else %}
0:00
{% endif %}
thank you it works
EDIT: Never mind, my fault.
Itās not your adoption of the code. I consider the box3 to be primarily a voice assistant, rather than a media player (given the low quality of the speaker I didnāt think I would use it to listen to anything). As such, I didnāt pay much attention to the media player functions, other than using it as a speaker for the VA, and maybe for short announcements. This is why I used the reply image for playback and why I havenāt implemented the mute and volume functions when it is playing media (the volume up and down and mute do work during playback [the volume changes and mutes] but donāt show on the screen during playback).
I am happy to change the image to a āmedia playbackā one, but I donāt have an image in that style for that purpose. Do you have one?
In my case, I canāt even play anything from the RadioBrowser on it - it fails to play and I am not sure why (it plays local files fine). I may look into making the volume controls graphics work when playing when I have some time, but for my usage it is not really an issue.
With the touch areas, itās a good idea and I am sure it is possible, but I donāt really have time to look into it (too many projects )
Hello all. Well I it seemed to me that my problems were somehow related to either the hardware my HA was installed on or the BOX3 itself. Since I could reflash the origanal espressif demo firmware with no problems I decided to tackle my HA hardware. I set up a NEW HA on a RPI 5 with 8GB ram and a 5 amp Pi power supply. I was sure I was ready to go!
Nope.
I cleaned out the BOX3, the used ESPHome to re-provision it, set the wifi and add it to my HA. All went well. But when I went to adopt it in ESPHome, the installation threw this out thereā¦
INFO ESPHome 2024.5.5
INFO Reading configuration /config/esphome/esp32-s3-box-3-0502c8.yaml...
INFO Updating https://github.com/esphome/esphome.git@pull/5230/head
WARNING GPIO0 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins
INFO Generating C++ source...
INFO Updating https://github.com/jesserockz/esp32-s3-box-3-board.git@main
INFO Updating https://github.com/espressif/[email protected]
INFO Updating submodules (components/esp-sr, components/esp-adf-libs) for https://github.com/espressif/[email protected]
Traceback (most recent call last):
File "/usr/local/bin/esphome", line 33, in <module>
sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/esphome/esphome/__main__.py", line 1065, in main
return run_esphome(sys.argv)
^^^^^^^^^^^^^^^^^^^^^
File "/esphome/esphome/__main__.py", line 1052, in run_esphome
rc = POST_CONFIG_ACTIONS[args.command](args, config)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/esphome/esphome/__main__.py", line 479, in command_run
exit_code = write_cpp(config)
^^^^^^^^^^^^^^^^^
File "/esphome/esphome/__main__.py", line 193, in write_cpp
return write_cpp_file()
^^^^^^^^^^^^^^^^
File "/esphome/esphome/__main__.py", line 211, in write_cpp_file
writer.write_cpp(code_s)
File "/esphome/esphome/writer.py", line 344, in write_cpp
copy_src_tree()
File "/esphome/esphome/writer.py", line 297, in copy_src_tree
copy_files()
File "/esphome/esphome/components/esp32/__init__.py", line 684, in copy_files
repo_dir, _ = git.clone_or_update(
^^^^^^^^^^^^^^^^^^^^
File "/esphome/esphome/git.py", line 111, in clone_or_update
run_git_command(
File "/esphome/esphome/git.py", line 31, in run_git_command
raise cv.Invalid(lines[-1][len("fatal: ") :])
voluptuous.error.Invalid: Unable to find current revision in submodule path 'components/esp-sr'
Anyone care to give me some clues on what is wrong here?
Perhaps my BOX3 is just trashed, even though it is connected to my network and HA and appears to be ready to have the YAML installed.
Iām really stumped.
Clean your build files and try again.
Thank you janstadt. I agree with you and I do a āclean build filesā each time I try to do an install. After everything Iāve tried Iāve concluded that the box3 is defective. My conclusion is based on the fact that under the original espressif demo flash, only the temp/humidity and media player actually work.
I think Iāve exhausted my Box3 patience.
Thank you for replying.
Hello with the project of Lajos who gives me his authorization to modify it and post it to you he did a good job
S3-Box-3-firmware-fork/firmware.yaml at main Ā· youkorr/S3-Box-3-firmware-fork (github.com)