Mon problème
J’ai toujours le même message d’erreur dans mes log : Nextion is not connected !
J’ai essayé avec un autre ecran Nextion - un autre ESP8266 … désinstatallé l’Addons ESP Home …
Rien ne change !
Une idée ?
Ma configuration
System Information
version |
core-2022.9.1 |
installation_type |
Home Assistant OS |
dev |
false |
hassio |
true |
docker |
true |
user |
root |
virtualenv |
false |
python_version |
3.10.5 |
os_name |
Linux |
os_version |
5.15.32-v8 |
arch |
aarch64 |
timezone |
Europe/Brussels |
config_dir |
/config |
Home Assistant Community Store
GitHub API |
ok |
GitHub Content |
ok |
GitHub Web |
ok |
GitHub API Calls Remaining |
4351 |
Installed Version |
1.27.2 |
Stage |
running |
Available Repositories |
1115 |
Downloaded Repositories |
106 |
Home Assistant Cloud
logged_in |
true |
subscription_expiration |
6 septembre 2023 à 02:00 |
relayer_connected |
true |
remote_enabled |
true |
remote_connected |
true |
alexa_enabled |
false |
google_enabled |
true |
remote_server |
eu-central-1-2.ui.nabu.casa |
can_reach_cert_server |
ok |
can_reach_cloud_auth |
ok |
can_reach_cloud |
ok |
Home Assistant Supervisor
host_os |
Home Assistant OS 8.5 |
update_channel |
stable |
supervisor_version |
supervisor-2022.08.6 |
agent_version |
1.2.1 |
docker_version |
20.10.14 |
disk_total |
232.2 GB |
disk_used |
62.2 GB |
healthy |
true |
supported |
true |
board |
rpi4-64 |
supervisor_api |
ok |
version_api |
ok |
installed_addons |
MariaDB (2.5.1), File editor (5.4.1), AirSonos (3.4.1), Node-RED (13.4.0), Studio Code Server (5.4.0), DahuaVTO2MQTT (1.0.2), Samba share (10.0.0), Mosquitto broker (6.1.3), Terminal & SSH (9.6.1), Home Assistant Google Drive Backup (0.108.4), Zigbee2MQTT (1.27.2-1), ESPHome (2022.8.3) |
Dashboards
dashboards |
3 |
resources |
80 |
views |
34 |
mode |
storage |
Recorder
oldest_recorder_run |
9 septembre 2022 à 13:28 |
current_recorder_run |
19 septembre 2022 à 12:44 |
estimated_db_size |
1455.25 MiB |
database_engine |
mysql |
database_version |
10.6.8 |
Spotify
api_endpoint_reachable |
ok |
___
### Mon FICHIER YAML ###
esphome:
name: esp-ecran-lit
platform: ESP8266
board: d1_mini
on_boot:
priority: 250
then:
- lambda: |-
id(nextionD).goto_page("Starting");
id(page_id) = 0;
on_loop:
- if:
condition:
wifi.connected:
then:
- lambda: |-
if(id(page_id) == 0){
id(nextionD).set_component_text("wifi", "Connexion au WiFi Reussi !");
}
- if:
condition:
api.connected:
then:
- lambda: |-
if(id(page_id) == 0){
id(nextionD).set_component_text("hassio", "Connexion à Home Assistant Réussi !");
delay(500);
id(nextionD).goto_page("Accueil");
id(page_id) = 2;
}
# Enable Home Assistant API
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
# Enable fallback hotspot (captive portal) in case wifi connection fails
captive_portal:
logger:
level: DEBUG
api:
services:
- service: toggle
variables:
state: bool
then:
- lambda: |-
if(state){
id(page_id) = 2;
id(nextionD).goto_page("Accueil");
id(nextionD).update();
}else{
id(page_id) = 1;
id(nextionD).goto_page("OFF");
id(nextionD).update();
}
- service: brightness
variables:
brightness: float
then:
- lambda: |-
id(nextionD).set_backlight_brightness(brightness);
ota:
switch:
- platform: restart
id: reboot_esp
globals:
- id: page_id
type: int
initial_value: "99"
sensor:
- platform: homeassistant
id: today_icon
entity_id: sensor.today_icon
- platform: homeassistant
id: alarm_h
entity_id: sensor.alarm_h
- platform: homeassistant
id: alarm_m
entity_id: sensor.alarm_m
- platform: wifi_signal
id: wifi_info
update_interval: 60s
- platform: uptime
id: uptime_esp
filters:
#set to H
- lambda: return x/3600;
unit_of_measurement: "h"
binary_sensor:
- platform: homeassistant
id: timerState
entity_id: automation.reveil
- platform: homeassistant
id: timerAutoState
entity_id: automation.18_reveil_automatique
#**************************************************NEXTION Buttons************************************************
#___________________________________Page 0___________________________________
#___________________________________Page 1___________________________________
#-----------------------------Turn ON ------------------------------
- platform: nextion
page_id: 1
component_id: 0
id: turn_on
on_state:
then:
- homeassistant.service:
service: script.chambre_on
- delay: 1s
- lambda: |-
id(page_id) = 2;
#___________________________________Page 2___________________________________
#-----------------------------Turn OFF -----------------------------
- platform: nextion
page_id: 2
component_id: 2
id: powerOFF
on_state:
then:
- homeassistant.service:
service: script.chambre_off
- lambda: |-
id(page_id) = 1;
id(nextionD).update();
#-----------------------------Timer Page ---------------------------
- platform: nextion
page_id: 2
component_id: 6
id: timerB
on_state:
lambda: |-
id(nextionD).goto_page("Reveil");
id(page_id) = 3;
id(nextionD).update();
id(nextionD).set_component_value("alarmH", id(alarm_h).state);
id(nextionD).set_component_value("alarmM", id(alarm_m).state);
#-----------------------------Settings Page ------------------------
- platform: nextion
page_id: 2
component_id: 17
id: settingsB
on_state:
lambda: |-
id(nextionD).goto_page("Settings");
id(page_id) = 7;
id(nextionD).update();
#-----------------------------Remote Page ------------------------
- platform: nextion
page_id: 2
component_id: 18
id: remoteB
on_state:
lambda: |-
id(nextionD).goto_page("Control");
id(page_id) = 6;
id(nextionD).update();
#-----------------------------Weather Page ----------------------
- platform: nextion
page_id: 2
component_id: 1
id: weatherB
on_state:
lambda: |-
id(nextionD).goto_page("Weather");
id(page_id) = 5;
id(nextionD).update();
#-----------------------------Play Music ---------------------------
- platform: nextion
page_id: 2
component_id: 4
id: toggleMusic
on_press:
then:
- if:
condition:
lambda: return (id(media_player).state == "idle");
then:
- homeassistant.service:
service: script.playlist_matin
else:
- homeassistant.service:
service: media_player.media_play_pause
data:
entity_id: media_player.spotify_xmow
- delay: 200ms
- lambda: id(nextionD).update();
#-----------------------------Next Music ---------------------------
- platform: nextion
page_id: 2
component_id: 3
id: nextMusic
on_press:
then:
- homeassistant.service:
service: media_player.media_next_track
data:
entity_id: media_player.spotify_xmow
#-----------------------------Previous Music -----------------------
- platform: nextion
page_id: 2
component_id: 5
id: previousMusic
on_press:
then:
- homeassistant.service:
service: media_player.media_previous_track
data:
entity_id: media_player.spotify_xmow
#-----------------------------Vol + Chaine -------------------------
- platform: nextion
page_id: 2
component_id: 12
id: chaine_plus
on_press:
then:
- homeassistant.service:
service: switch.turn_on
data:
entity_id: switch.volume_plus
#-----------------------------Vol - Chaine -------------------------
- platform: nextion
page_id: 2
component_id: 10
id: chaine_minus
on_press:
then:
- homeassistant.service:
service: switch.turn_on
data:
entity_id: switch.volume_minus
#-----------------------------Toggle Chaine ------------------------
- platform: nextion
page_id: 2
component_id: 11
id: toggle_chaine
on_press:
then:
- homeassistant.service:
service: switch.turn_on
data:
entity_id: switch.chaine_hi_fi
#___________________________________Page 3___________________________________
#-----------------------------Heure + ------------------------------
- platform: nextion
page_id: 3
component_id: 4
id: hp
on_press:
then:
- homeassistant.service:
service: input_datetime.set_datetime
data:
entity_id: input_datetime.heure_du_reveil
data_template:
time: "{{state_attr('input_datetime.heure_du_reveil', 'hour') + 1}}{{':'}}{{state_attr('input_datetime.heure_du_reveil', 'minute')}}"
- lambda: id(nextionD).update();
#-----------------------------Heure - ------------------------------
- platform: nextion
page_id: 3
component_id: 5
id: hm
on_press:
then:
- homeassistant.service:
service: input_datetime.set_datetime
data:
entity_id: input_datetime.heure_du_reveil
data_template:
time: "{{state_attr('input_datetime.heure_du_reveil', 'hour') - 1}}{{':'}}{{state_attr('input_datetime.heure_du_reveil', 'minute')}}"
- lambda: id(nextionD).update();
#-----------------------------Minute + -----------------------------
- platform: nextion
page_id: 3
component_id: 3
id: mp
on_press:
then:
- homeassistant.service:
service: input_datetime.set_datetime
data:
entity_id: input_datetime.heure_du_reveil
data_template:
time: "{{state_attr('input_datetime.heure_du_reveil', 'hour')}}{{':'}}{{state_attr('input_datetime.heure_du_reveil', 'minute') + 1}}"
- lambda: id(nextionD).update();
#-----------------------------Minute - -----------------------------
- platform: nextion
page_id: 3
component_id: 6
id: mm
on_press:
then:
- homeassistant.service:
service: input_datetime.set_datetime
data:
entity_id: input_datetime.heure_du_reveil
data_template:
time: "{{state_attr('input_datetime.heure_du_reveil', 'hour')}}{{':'}}{{state_attr('input_datetime.heure_du_reveil', 'minute') - 1}}"
- lambda: id(nextionD).update();
#-----------------------------Toggle Timer -------------------------
- platform: nextion
page_id: 3
component_id: 8
id: toggleTimer
on_press:
then:
- homeassistant.service:
service: automation.toggle
data:
entity_id: automation.reveil
- delay: 200ms
- lambda: id(nextionD).update();
#-----------------------------Toggle Auto --------------------------
- platform: nextion
page_id: 3
component_id: 9
id: toggleAuto
on_press:
then:
- homeassistant.service:
service: automation.toggle
data:
entity_id: automation.18_reveil_automatique
- delay: 200ms
- lambda: id(nextionD).update();
#-----------------------------Back Timer Page ----------------------
- platform: nextion
page_id: 3
component_id: 7
id: backTimer
on_state:
lambda: |-
id(page_id) = 2;
id(nextionD).update();
#-----------------------------6h30----------------------------------
- platform: nextion
page_id: 3
component_id: 13
id: alarm6h30
on_press:
then:
- homeassistant.service:
service: input_datetime.set_datetime
data:
entity_id: input_datetime.heure_du_reveil
time: '06:30:00'
- lambda: id(nextionD).update();
#-----------------------------7h00----------------------------------
- platform: nextion
page_id: 3
component_id: 22
id: alarm7h00
on_press:
then:
- homeassistant.service:
service: input_datetime.set_datetime
data:
entity_id: input_datetime.heure_du_reveil
time: '07:00:00'
- lambda: id(nextionD).update();
#-----------------------------8h00----------------------------------
- platform: nextion
page_id: 3
component_id: 23
id: alarm8h00
on_press:
then:
- homeassistant.service:
service: input_datetime.set_datetime
data:
entity_id: input_datetime.heure_du_reveil
time: '08:00:00'
- lambda: id(nextionD).update();
#___________________________________Page 4___________________________________
#-----------------------------go to sleep time----------------------
- platform: nextion
page_id: 4
component_id: 13
id: sleep_time
on_state:
lambda: |-
id(page_id) = 4;
id(nextionD).update();
#-----------------------------return in main page-------------------
- platform: nextion
page_id: 4
component_id: 0
id: back_sleep
on_state:
lambda: |-
id(page_id) = 2;
delay(200);
id(nextionD).goto_page("Acceuil");
#___________________________________Page 5___________________________________
#-----------------------------return in main page-------------------
- platform: nextion
page_id: 5
component_id: 17
id: back_Weather
on_state:
lambda: |-
id(nextionD).goto_page("Acceuil");
id(page_id) = 2;
id(nextionD).update();
#___________________________________Page 6___________________________________
#-----------------------------Cover UP -----------------------------
- platform: nextion
page_id: 6
component_id: 3
id: coverUp
on_press:
then:
- homeassistant.service:
service: cover.open_cover
data:
entity_id: cover.volet_chambre_1
- lambda: id(nextionD).update();
#-----------------------------Volet Down ---------------------------
- platform: nextion
page_id: 6
component_id: 1
id: coverDown
on_press:
then:
- homeassistant.service:
service: cover.close_cover
data:
entity_id: cover.volet_chambre_1
- lambda: id(nextionD).update();
#-----------------------------Volet Stop ---------------------------
- platform: nextion
page_id: 6
component_id: 2
id: coverStop
on_press:
then:
- homeassistant.service:
service: cover.stop_cover
data:
entity_id: cover.volet_chambre_1
- lambda: id(nextionD).update();
#-----------------------------Volet Stop ---------------------------
- platform: nextion
page_id: 6
component_id: 5
id: music_playlist1
on_press:
then:
- homeassistant.service:
service: script.playlist_matin
- platform: nextion
page_id: 6
component_id: 7
id: music_playlist2
on_press:
then:
- homeassistant.service:
service: script.hits_du_moments
#-----------------------------Back Timer Page ----------------------
- platform: nextion
page_id: 6
component_id: 4
id: backControl
on_state:
lambda: |-
id(nextionD).goto_page("Acceuil");
id(page_id) = 2;
id(nextionD).update();
#___________________________________Page 7___________________________________
#-----------------------------Reboot---------------------------------
- platform: nextion
page_id: 7
component_id: 4
id: rebootsw
on_press:
- switch.toggle: reboot_esp
#-----------------------------Back Settings Page --------------------
- platform: nextion
page_id: 7
component_id: 3
id: backSettings
on_state:
lambda: |-
id(page_id) = 2;
id(nextionD).update();
uart:
rx_pin: D1
tx_pin: D2
baud_rate: 115200
text_sensor:
- platform: homeassistant
id: title_music
entity_id: sensor.title_music
- platform: homeassistant
id: str_date
entity_id: sensor.date_simple
- platform: homeassistant
id: str_time
entity_id: sensor.time
- platform: homeassistant
id: actual_temp
entity_id: sensor.actual_temp
- platform: homeassistant
id: max_temp
entity_id: sensor.max_temp
- platform: homeassistant
id: min_temp
entity_id: sensor.min_temp
- platform: homeassistant
id: media_player
entity_id: media_player.spotify
- platform: homeassistant
id: temp_indoor
entity_id: sensor.temperature_indoor
- platform: homeassistant
id: hum_indoor
entity_id: sensor.humidite_chambre_1
- platform: version
id: esphome_v
display:
- platform: nextion
id: nextionD
update_interval: 1s
lambda: |-
ESP_LOGD("main", "Page: %d", id(page_id));
//it.set_wait_for_ack(false);
if(id(page_id) == 2){ //Aceuil
it.send_command_printf("%s.pic=%.0f", "meteoIcon",id(today_icon).state); //Meteo Icon
it.set_component_text("tDate", id(str_date).state.c_str());//Date
it.set_component_text("tTime", id(str_time).state.c_str());//Time
it.set_component_value("timer", id(timerState).state);//Alarm State
//----------Play/Pause Button------------------
if(id(media_player).state == "playing")
it.set_component_value("musicState", 1);
else
it.set_component_value("musicState", 0);
it.set_component_text("musicText", id(title_music).state.c_str());
}
if(id(page_id) == 3){//Reveil
if(id(timerState).state == 1){
it.set_component_value("toggleR", 1);
if(id(timerAutoState).state == 1){//Auto
it.set_component_value("toggleAuto", 1);
it.set_component_text("strMsg", "Auto");
}
else{
it.set_component_value("toggleAuto", 0);
}
}
else{
it.set_component_value("toggleR", 0);
it.set_component_text("strMsg", "OFF");
}
//it.set_component_text("strTimer", id(timer).state.c_str());
}
if(id(page_id) == 4){ //Sleep Time
it.send_command_printf("%s.pic=%.0f", "meteoIcon",id(today_icon).state); //Meteo Icon
it.set_component_text("tDate", id(str_date).state.c_str());//Date
it.set_component_text("tTime", id(str_time).state.c_str());//Time
it.set_component_text("tempVal", id(temp_indoor).state.c_str());
it.set_component_text("humVal", id(hum_indoor).state.c_str());
it.set_component_text("nowTempOutside", id(actual_temp).state.c_str());
}
if(id(page_id) == 5){//Meteo
it.send_command_printf("%s.pic=%.0f", "meteoIcon",id(today_icon).state); //Meteo Icon
it.set_component_text("nowTempOutside", id(actual_temp).state.c_str());
it.set_component_text("maxTempOutside", id(max_temp).state.c_str());
it.set_component_text("minTempOutside", id(min_temp).state.c_str());
it.set_component_text("tempVal", id(temp_indoor).state.c_str());
it.set_component_text("humVal", id(hum_indoor).state.c_str());
}
if(id(page_id) == 6){//Control
}
if(id(page_id) == 7){//Settings
if(id(wifi_info).state < -87){
it.send_command_printf("wifiIcon.pic=60");
}
else if(id(wifi_info).state < -80){
it.send_command_printf("wifiIcon.pic=61");
}
else if(id(wifi_info).state < -70){
it.send_command_printf("wifiIcon.pic=62");
}
else if(id(wifi_info).state > -70){
it.send_command_printf("wifiIcon.pic=63");
}else{
it.send_command_printf("wifiIcon.pic=59");
}
it.set_component_text("version", id(esphome_v).state.c_str());
it.set_component_text_printf("uptime", "%.1f h", id(uptime_esp).state);
}