Smartgateways P1 ESPHome Edition not visible in ESPHome Builder

Hello all,

I’m very new to HA and ESPHome.
I have allready a selfmade project with ESP32 in ESPHome Builder, and that runs perfectly.

I bought myself a Smartgateways P1 Reader ESPHome edition.
After doing the standard setup for this device, it was found as a new device, adding it to Home Assistant went perfectly. Device also visible in ESPHome integration.
How ever the device did not appear in ESPHome Builder.

I’ve tried to add it in different ways, but without succes.

Erasing the device and installing it as brand new in ESPHome Builder, showed the device in the Builder and the device was online. Able to change yaml wirelessly.
However when I load the original yaml-file of P1 reader, I can no longer reach the device via ESPHome builder (offline) but when I take a look at my router the device gets a (fixed) ip whenever I reboot it.

Reflashing the device with original bin gets device only in the ESPHome Integration.

Is there anyone who has experience in adding this device to ESPHome Builder ?
Or is there advice to where it could have gone wrong ?

Greetings,
Bart

In case they don’t show up, post your yaml. If you are lucky, some forum member can help you.

esphome builder uses mdns to connect with and show device status.

If you have confirmed the device is connected to your network, have it currently running with esphome firmware, and know the IP address you may add use_address to the .yaml file you are trying to upload to device to bypass mdns.

Waht is your install method for HA and esphome?

This the factory code of the P1 reader :

esphome:

  name: smart-gateways-dsmr

  comment: Smart Gateways Smart Meter

  friendly_name: Smart Gateways Smart Meter

  name_add_mac_suffix: True

  project:

    name: Smart Gateways.Smart Meter

    version: "1.0"


preferences:

    flash_write_interval: 1min


substitutions:

  device_name: smart_gateways_smart_meter

  device_description: "Smart Gateways Smart Meter Gateway"


esp32:

  board: esp32dev

  framework:

    type: arduino


improv_serial:


# Enable logging

logger:

  baud_rate: 115200

  level: INFO


debug:

  update_interval: 60s


# Enable Home Assistant API

api:


#  encryption:

#    key: "xxx"


ota:

  - platform: esphome

#    password: "xxx"


wifi:

#  ssid: !secret wifi_ssid

#  password: !secret wifi_password

  power_save_mode: none

# Enable fallback hotspot (captive portal) in case wifi connection fails

  ap:

    ssid: "Smart Gateways Smart Meter"

    password: "smartgateways"


captive_portal:


web_server:

  port: 80


uart:

  baud_rate: 115200

  rx_pin:

    number: GPIO18

    inverted: true

  rx_buffer_size: 3000

  data_bits: 8

  parity: NONE

  stop_bits: 1

# enable the next lines if you want to debug

#  debug:

#    direction: RX

#    after:

#      delimiter: "\r\n"

#    sequence:

#      - lambda: UARTDebug::log_string(direction, bytes);


dsmr:

  max_telegram_length: 3000

  id: dsmr_instance

  receive_timeout: 500ms


# enable the next line if you encounter crc checksum mismatch errors (for some swedish and lithuanian meters)

#  crc_check: false


output:

  - platform: gpio

    id: led_wifi_connected

    pin: 2


interval:

  - interval: 2s

    then:

      if:

        condition:

          wifi.connected:

        then:

          - if:

              condition:

                api.connected:

              then:

                - output.turn_on: led_wifi_connected

                - delay: 200ms

                - output.turn_off: led_wifi_connected

                - delay: 200ms

              else:

                - output.turn_on: led_wifi_connected

                - delay: 500ms

                - output.turn_off: led_wifi_connected

                - delay: 500ms

        else:

          - output.turn_off: led_wifi_connected


sensor:

  - platform: dsmr

    energy_delivered_tariff1:

      name: "Energy Consumed Tariff 1"

    energy_delivered_tariff2:

      name: "Energy Consumed Tariff 2"

    energy_returned_tariff1:

      name: "Energy Produced Tariff 1"

    energy_returned_tariff2:

      name: "Energy Produced Tariff 2"

    power_delivered:

      name: "Power Consumed"

      accuracy_decimals: 3

    power_returned:

      name: "Power Produced"

      accuracy_decimals: 3

    electricity_failures:

      name: "Electricity Failures"

      icon: mdi:alert

    electricity_long_failures:

      name: "Long Electricity Failures"

      icon: mdi:alert

    voltage_l1:

      name: "Voltage Phase 1"

    voltage_l2:

      name: "Voltage Phase 2"

    voltage_l3:

      name: "Voltage Phase 3"

    current_l1:

      name: "Current Phase 1"

    current_l2:

      name: "Current Phase 2"

    current_l3:

      name: "Current Phase 3"

    power_delivered_l1:

      name: "Power Consumed Phase 1"

      accuracy_decimals: 3

    power_delivered_l2:

      name: "Power Consumed Phase 2"

      accuracy_decimals: 3

    power_delivered_l3:

      name: "Power Consumed Phase 3"

      accuracy_decimals: 3

    power_returned_l1:

      name: "Power Produced Phase 1"

      accuracy_decimals: 3

    power_returned_l2:

      name: "Power Produced Phase 2"

      accuracy_decimals: 3

    power_returned_l3:

      name: "Power Produced Phase 3"

      accuracy_decimals: 3

    gas_delivered:

      name: "Gas Consumed"

  - platform: uptime

    name: "SmartMeter Uptime"

  - platform: wifi_signal

    name: "SmartMeter Wi-Fi Signal"

    update_interval: 60s


text_sensor:

  - platform: dsmr

    identification:

      name: "DSMR Identification"

    p1_version:

      name: "DSMR Version"

  - platform: wifi_info

    ip_address:

      name: "Smart Gateways SmartMeter IP Address"

    ssid:

      name: "Smart Gateways SmartMeter Wi-Fi SSID"

    bssid:

      name: "Smart Gateways SmartMeter Wi-Fi BSSID"

  - platform: version

    name: "ESPHome Version"

    hide_timestamp: false

  - platform: debug

    reset_reason:

      name: "ESP Reset Reason"

      icon: mdi:anchor

      disabled_by_default: False


time:

  - platform: sntp

    id: time_now


button:

  - platform: restart

    icon: mdi:power-cycle

    name: "ESP Reboot"

    entity_category: diagnostic

  - platform: factory_reset

    name: Factory Reset

    disabled_by_default: False

    icon: mdi:heart-broken

    entity_category: diagnostic

You are only configuring the Access Point (AP) mode, not normal Wi-Fi client mode.

This is the code that was on the ESP out of the box.
When powered on the fallback hotspot comes active, and when surfing to the ip that esp32 gives, you can change the wifi setting and the device appers in ESPHome.
If I try to add it in the ESPHome Builder and I remove the # (uncomment) ssid and password, the device is no loger reachable.

I don’t know your device. Can’t you just flash it with “uncommented code” through USB?

connect to it using USB
flash code with your SSID/Password and I usually add API key and OTA password.

api:
  id: api_server
  encryption:
    key: !secret api_key #will need key when connect with HA. 

ota:
  - platform: esphome
    id: ota_esphome
    password: !secret ota_password

you can add wifi/ota/api in secrets in Device Builder

wifi_secure: "yourSSID"
wifipass_secure: "yourPassword"

ota_password: "somelongstringoftextandnumbers"
api_key: "anotherlongstringoftextandnumbers"