DrozmotiX / ioBroker.esphome

Control your ESP8266/ESP32 with simple yet powerful configuration files created and managed by ESPHome
MIT License
30 stars 23 forks source link

After Update 0.4.0 Connection with Devices failed #179

Closed patricknitsch closed 11 months ago

patricknitsch commented 11 months ago

After Updating to 0.4.0 all Device connections failed. Reason: incorrect Password.

Before the api password works perfect.

Temporarly solution is api connection without password.

image

#---------------------------------CONFIGURATION---------------------------------#

substitutions:
  device_name: tank
  friendly_name: tank
  device_description: ESP8266
  do_red_led: GPIO4 #D2
  do_blue_led: GPIO0 #D3
  do_green_led: GPIO5 #D1
  do_relais_teich: GPIO2 #D4
  do_relais_pump: GPIO14 #D5
  do_trigger: GPIO13 #D7
  di_echo: GPIO12 #D6

esphome:
  name: ${device_name}
  comment: ${device_description}
  platform: ESP8266
  board: esp8285
  esp8266_restore_from_flash: true
  on_boot:
      - switch.turn_off: switch_pump_tank
      - switch.turn_off: switch_pump_teich

# Enable logging
logger:

# Enable API
api:
  password: "ZHBnoIGSRMwfmsVOVDn8l1//kEBdxLlUwlxzimR4zio="

# Enable over-the-air updates
ota:
  password: "60414035211236a04d0b6c256d26e2ea"

# WiFi connection
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  fast_connect: true
  ap:
    ssid: "Tank Fallback Hotspot"
    password: "urIkP8hgNFD9"
    ap_timeout: 1min
  use_address: ${device_name}
captive_portal:

# Sync time with Home Assistant
time:
  - platform: sntp
    id: homeassistant_time
    servers: de.pool.ntp.org
    update_interval: 30s
    on_time_sync:
      then:
        - logger.log:
            format: "Synchronized system clock"
            level: WARN

# Text sensors with general information
text_sensor: 
  # Version
  - platform: version
    name: Version

  # Wifi
  - platform: wifi_info
    ip_address:
      name: IP Address

   # Uptime formatted
  - platform: template
    name: Uptime
    #update_interval: 30s
    icon: mdi:clock-start
    lambda: |-
      int seconds = (id(Uptime).state);
      int days = seconds / (24 * 3600);
      seconds = seconds % (24 * 3600);
      int hours = seconds / 3600;
      seconds = seconds % 3600;
      int minutes = seconds /  60;
      seconds = seconds % 60;
      if ( days ) {
        return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
      } else if ( hours ) {
        return { (String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
      } else if ( minutes ) {
        return { (String(minutes) +"m "+ String(seconds) +"s").c_str() };
      } else {
        return { (String(seconds) +"s").c_str() };
      } 

# Global Variables
globals:
  - id: maxtime 
    type: int
    restore_value: yes
    initial_value: '600000' 

#---------------------------------CONFIGURATION---------------------------------#    

#-----------------------------------EXECUTION-----------------------------------#

sensor:
  # Uptime sensor
  - platform: uptime
    id: Uptime

  # WiFi Signal sensor
  - platform: wifi_signal
    name: Wifi Signal
    update_interval: 10s

  # Internal Voltage
  - platform: adc
    pin: VCC
    name: Internal Voltage

  # Ultrasensor
  - platform: ultrasonic
    trigger_pin: ${do_trigger}
    echo_pin: ${di_echo}
    name: Ultrasonic Sensor 
    id: ultrasonic_sensor
    unit_of_measurement: "Liter"
    accuracy_decimals: 0
    update_interval: 60s
    filters:
      - lambda: return (1-(x/.82))*1600;
      - filter_out: nan

button:
  # Switch to restart the plug
  - platform: restart
    name: Restart Switch

switch:
  #Switch Pump Tank
  - platform: output
    name: Pumpe Tank
    id: switch_pump_tank
    output: relay_pump
    on_turn_on:
      - if:
          condition:
            sensor.in_range:
              id: ultrasonic_sensor
              below: 250
          then:
            - switch.turn_off: switch_pump_tank
      - switch.turn_on: switch_pump_tank
      - delay: !lambda return id(maxtime);
      - switch.turn_off: switch_pump_tank

  # Switch Pump Teich
  - platform: output
    name: Pumpe Teich 
    id: switch_pump_teich
    output: relay_teich
    on_turn_on:
      - switch.turn_on: switch_pump_teich
      - delay: !lambda return id(maxtime);
      - switch.turn_off: switch_pump_teich

output:
  # Relais Pump
  - id: relay_pump
    platform: gpio
    pin: ${do_relais_pump}
    inverted: true

  # Relais Teich
  - id: relay_teich
    platform: gpio
    pin: ${do_relais_teich}
    inverted: true

  # Red LED
  - platform: esp8266_pwm
    id: output_red
    pin: ${do_red_led}
    max_power: 100%

  # Green LED
  - platform: esp8266_pwm
    id: output_green
    pin: ${do_green_led}
    max_power: 100%

  # Blue LED
  - platform: esp8266_pwm
    id: output_blue
    pin: ${do_blue_led}
    max_power: 100%

light:
  # RGB LED
  - platform: rgb
    name: Teich Light
    id: light_teich
    red: output_red
    green: output_green
    blue: output_blue
    effects:
      # Strobe Effekt
      - strobe:
          name: Strobe Effect
          colors:
            - state: true
              brightness: 100%
              red: 100%
              green: 90%
              blue: 0%
              duration: 500ms
            - state: false
              duration: 250ms
            - state: true
              brightness: 100%
              red: 0%
              green: 100%
              blue: 0%
              duration: 500ms

      # Flicker Effekt
      - flicker:
          name: Flicker Effect 
          alpha: 95%
          intensity: 1.5%

      # Lambda
      - lambda:
          name: Custom Effect
          update_interval: 2s
          lambda: |-
            static int state = 0;
            auto call = id(light_teich).turn_on();
            // Transition of 1000ms = 1s
            call.set_transition_length(1000);
            if (state == 0) {
              call.set_rgb(1.0, 1.0, 1.0);
            } else if (state == 1) {
              call.set_rgb(1.0, 0.0, 0.0);
            } else if (state == 2) {
              call.set_rgb(0.0, 1.0, 0.0);
            } else {
              call.set_rgb(0.0, 0.0, 1.0);
            }
            call.perform();
            state += 1;
            if (state == 4)
              state = 0;

    on_turn_on:
      - delay: !lambda "return id(maxtime);"
      - light.turn_off: light_teich

#-----------------------------------EXECUTION-----------------------------------#
DutchmanNL commented 11 months ago

After Updating to 0.4.0 all Device connections failed. Reason: incorrect Password.

Before the api password works perfect.

Temporarly solution is api connection without password.

WoW that's a major issue thank you reporting, didn't notice that locally will have a look right away

DutchmanNL commented 11 months ago

Is your API password for Esch service the same or dis you set individual passwords ?

Password in Admin instantie config Matches your yaml?

patricknitsch commented 11 months ago

No I have different passwords. Yes the passwords are correct. Before update alle devices were connected in api.

DutchmanNL commented 11 months ago

No I have different passwords. Yes the passwords are correct. Before update alle devices were connected in api.

Thank you that feedback was what I needed and I know exactly what and were to fix

Will make a quick bugfix for that on Sunday

Thank you, this kind of testing/ feedback is what we developers need for issue and quick follow up appreciated !

patricknitsch commented 11 months ago

Sure. If I should test the fix let me know. Thank you for fast fixing.

DutchmanNL commented 11 months ago

bitte 0.4.1-beta.0 von git probieren, sollte mit dieser Änderung gelöst sein: https://github.com/DrozmotiX/ioBroker.esphome/commit/c5989aa3d80af936348d1d74b3f399771b88f69c

patricknitsch commented 11 months ago

Test war erfolgreich. Alle Geräte sind wieder mittels Passwort verbunden. Gute Arbeit!

Hast du gesehen, dass ich deutsch spreche, oder warum antwortest du jetzt auf deutsch :)

DutchmanNL commented 11 months ago

Test war erfolgreich. Alle Geräte sind wieder mittels Passwort verbunden. Gute Arbeit!

perfect danke dan machen ich eine neue NPM release :)

Hast du gesehen, dass ich deutsch spreche, oder warum antwortest du jetzt auf deutsch :)

sorry macht der Gewohnheit, issue in englisch Bearbeiter zudem in EN programmiert und dan aufs issue geantwortet :P Ich schließe hier sobald die release raus ist :)