Display local sensor data on pcf8574

I want to display data from 4X dallas sensors connected locally to my esp8266 running esphome.
I would prefer to get the data in Fahrenheit as well if possible. here is my code minus the wifi info.

‘’’
esphome:
name: paste_ref
platform: ESP8266
board: d1_mini

wifi:
ssid: “CREATION_FAC”
password: “XXX”
manual_ip:
static_ip: 10.25.6.6
gateway: 10.25.6.1
subnet: 255.255.255.240
dns1: 8.8.8.8

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

ap:
ssid: “Paste Ref Fallback Hotspot”
password: “XXX”

captive_portal:

Enable logging

logger:

Enable Home Assistant API

api:
password: “XXX”

ota:
password: “XXX”

dallas:

  • pin: D5

sensor:

  • platform: dallas
    address: 0xE20417C3D476FF28
    name: “Temp1”
  • platform: dallas
    address: 0xEB0417C3FAB5FF28
    name: “Temp2”
  • platform: dallas
    address: 0x8F0417C3D72DFF28
    name: “Temp3”
  • platform: dallas
    address: 0xE00417C3DA97FF28
    name: “Temp4”

i2c:
sda: D2
scl: D1

display:

  • platform: lcd_pcf8574
    dimensions: 18x4
    address: 0x27
    lambda: |-
    it.print(“Hello World!”); ‘’’’’’

It would help you could put your code in code tags in the future (and if possible edit your post).

From the ESPHome documenation: To get temperature in Fahrenheit you can add the following filter to every dallas sensor.

filters:
  - lambda: return x * (9.0/5.0) + 32.0;
unit_of_measurement: "°F"

Then: Each of the four sensors need an id. so just add “id: id_temp1” or something to them.

In the ESPHome Display documenation https://esphome.io/components/display/index.html is an good example how to print a sensor value on the screen.

Should be something like this for you:

display:
    platform: lcd_pcf8574
    dimensions: 18x4
    address: 0x27
    lambda: |-
        it.print(“Temp1: %.1f , Temp 2: %.1f”, id(id_temp1).state, id(id_temp2).state); 

I didn’t test it, but it should work when you define the ids (maybe you have to fix a few mistakes). Together with the filter it will be in Fahrenheit.