06-28-2023, 01:59 PM
I've defined the digital inputs and switches as in the example and also added a DS18B20 temp sensor to the I2C. But as soon as I add in yaml the Dallas configuration, the update_interval toggles the switches on and off at the interval set in the update_interval.
I saw that the I2C port is the same as the Dallas sensor but I don't know how I can connect them in a different way.
esphome:
name: kincony-kc868-e16s
friendly_name: Kincony KC868-E16S
platform: ESP32
board: esp32dev
logger:
captive_portal:
i2c:
sda: 16
scl: 15
scan: true
id: bus_a
pcf8574:
- id: 'pcf8574_hub_out_1' # for output channel 1-8
address: 0x21
- id: 'pcf8574_hub_out_2' # for output channel 9-16
address: 0x25
- id: 'pcf8574_hub_in_1' # for input channel 1-8
address: 0x22
- id: 'pcf8574_hub_in_2' # for input channel 9-16
address: 0x24
switch:
- platform: gpio
name: "e16s-output14"
pin:
pcf8574: pcf8574_hub_out_2
number: 5
mode: OUTPUT
inverted: true
id: output14
- platform: gpio
name: "e16s-output15"
pin:
pcf8574: pcf8574_hub_out_2
number: 6
mode: OUTPUT
inverted: true
id: output15
- platform: gpio
name: "e16s-output16"
pin:
pcf8574: pcf8574_hub_out_2
number: 7
mode: OUTPUT
inverted: true
id: output16
binary_sensor:
- platform: gpio
name: "DI1 - Entrance Left B1"
pin:
pcf8574: pcf8574_hub_in_2
number: 7
mode: INPUT
inverted: true
internal: true
on_press:
then:
- switch.toggle: output14
dallas:
- pin: 16
update_interval: 30s
sensor:
- platform: dallas
address: 0x453c430457d4c928
name: "Livingroom Temperature"
id: livingroom_temperature
- platform: dallas
address: 0x9d3c450457bfc728
name: "Bedroom Temperature"
id: bedroom_temperature
I saw that the I2C port is the same as the Dallas sensor but I don't know how I can connect them in a different way.
esphome:
name: kincony-kc868-e16s
friendly_name: Kincony KC868-E16S
platform: ESP32
board: esp32dev
logger:
captive_portal:
i2c:
sda: 16
scl: 15
scan: true
id: bus_a
pcf8574:
- id: 'pcf8574_hub_out_1' # for output channel 1-8
address: 0x21
- id: 'pcf8574_hub_out_2' # for output channel 9-16
address: 0x25
- id: 'pcf8574_hub_in_1' # for input channel 1-8
address: 0x22
- id: 'pcf8574_hub_in_2' # for input channel 9-16
address: 0x24
switch:
- platform: gpio
name: "e16s-output14"
pin:
pcf8574: pcf8574_hub_out_2
number: 5
mode: OUTPUT
inverted: true
id: output14
- platform: gpio
name: "e16s-output15"
pin:
pcf8574: pcf8574_hub_out_2
number: 6
mode: OUTPUT
inverted: true
id: output15
- platform: gpio
name: "e16s-output16"
pin:
pcf8574: pcf8574_hub_out_2
number: 7
mode: OUTPUT
inverted: true
id: output16
binary_sensor:
- platform: gpio
name: "DI1 - Entrance Left B1"
pin:
pcf8574: pcf8574_hub_in_2
number: 7
mode: INPUT
inverted: true
internal: true
on_press:
then:
- switch.toggle: output14
dallas:
- pin: 16
update_interval: 30s
sensor:
- platform: dallas
address: 0x453c430457d4c928
name: "Livingroom Temperature"
id: livingroom_temperature
- platform: dallas
address: 0x9d3c450457bfc728
name: "Bedroom Temperature"
id: bedroom_temperature