Ultrasonic Sensor D1 Mini not reading

Hi was hoping someone could point me in the right direction, im new to HAS (come from RTI background so less coding) i followed this guide Salt level sensor for water softener in Home Assistant with ESPHome – ADONNO and brought the D1 mini and HCSR04 Sensors set it up as described added in the line allow_other_uses: true so that it would validate and uploaded.

The D1 mini is connected fine but i get no readings from the Sensor, on the ESPHome device page its says level sensor cm NA and percent NA

and if i try and add it to a gauge in home assistant i get Entity is non-numeric: sensor.level_sensor_in_cm

here is my ,yamal


esphome:
name: level-sensor
platform: ESP8266
board: d1_mini

WiFi connection, replace these with values for your WiFi.

wifi:
ssid: “**********”
password: “***********”

Enable logging

logger:

Enable Home Assistant API

api:

Enable over-the-air updates.

ota:
platform: esphome

Enable Web server.

web_server:
port: 80

Sync time with Home Assistant.

time:

  • platform: homeassistant
    id: homeassistant_time

Text sensors with general information.

text_sensor:

Expose ESPHome version as sensor.

  • platform: version
    name: level-sensor ESPHome Version

Expose WiFi information as sensors.

  • platform: wifi_info
    ip_address:
    name: level-sensor IP
    ssid:
    name: level-sensor SSID
    bssid:
    name: level-sensor BSSID

Exposed switches.

Switch to restart the salt_level_sensor.

switch:

  • platform: restart
    name: “level-sensor Restart”

sensor:

Uptime sensor.

  • platform: uptime
    name: level-sensor Uptime

WiFi Signal sensor.

  • platform: wifi_signal
    name: level-sensor WiFi Signal
    update_interval: 60s

  • platform: ultrasonic
    trigger_pin:
    number: D1
    allow_other_uses: true
    echo_pin:
    number: D2
    allow_other_uses: true
    name: “level-sensor in percent”
    update_interval: 24h
    filters:

    Calculate level in percent

    Sensor comes from factory with unit of measurement set in meters

    Storage tank height (sensor to bottom of tank) = 84.7cm, 0.847m

    Subtract measured value from the storage tank height => difference is the salt level = 84.7cm - 44.7cm = 40cm, .847m - .447m = .400

    100 % salt level is the container height minus 0.400 meters since nobody will drawn the sensor at full salt level

    divide salt level through container height minus 0.4000, then multiply result with 100 to achieve percents

    • lambda: return (0.847-x) * (100/0.847);
      unit_of_measurement: “%”
  • platform: ultrasonic
    trigger_pin:
    number: D1
    allow_other_uses: true
    echo_pin:
    number: D2
    allow_other_uses: true
    name: “level-sensor in cm”
    update_interval: 24h
    filters:

    Container height 52.75cm. From the sensor to the top of the water that accumulates in the bin.

    Multiply result by 100 - convert M to CM. Sensor works in meters

    • lambda: return (0.847-x)*100.0;
      unit_of_measurement: “cm”

any help would be appreciated greatly

Please ignore i installed the comfig again it all works now

cheerrs