08-02-2024, 09:12 AM
Thanks for the reply and example yaml.
I wish to use MQTT within Home Assistant. Ideally, I wish to leverage Node-Red as a bridge and use the ESPHome In and Out (recognizes all E16S devices and entities), and MQTT input and output nodes to manage the switches and relays of the E16S boards (there will be 6 when I finish this home automation setup).
The A8S code you shared doesn't reflect the gpio platform code lines for the outputs of the E16S. Should I add as follows;
switch:
- platform: gpio
name: "e16s-output16"
pin:
pcf8574: pcf8574_hub_out_2
number: 7
mode: OUTPUT
inverted: true
unique_id: kc868-e16s-output-16
state_topic: 'KC868_E16S/08F9E08B1F58/STATE'
command_topic: 'KC868_E16S/08F9E08B1F58/SET'
payload_on: '{"output1":{"value":true}}'
payload_off: '{"output1":{"value":false}}'
value_template: '{{ value_json.output1.value }}'
state_on: true
state_off: false
How can I add code for the inputs?
binary_sensor:
- platform: gpio
name: "e16s-input1"
pin:
pcf8574: pcf8574_hub_in_1
number: 0
mode: INPUT
inverted: true
I wish to use MQTT within Home Assistant. Ideally, I wish to leverage Node-Red as a bridge and use the ESPHome In and Out (recognizes all E16S devices and entities), and MQTT input and output nodes to manage the switches and relays of the E16S boards (there will be 6 when I finish this home automation setup).
The A8S code you shared doesn't reflect the gpio platform code lines for the outputs of the E16S. Should I add as follows;
switch:
- platform: gpio
name: "e16s-output16"
pin:
pcf8574: pcf8574_hub_out_2
number: 7
mode: OUTPUT
inverted: true
unique_id: kc868-e16s-output-16
state_topic: 'KC868_E16S/08F9E08B1F58/STATE'
command_topic: 'KC868_E16S/08F9E08B1F58/SET'
payload_on: '{"output1":{"value":true}}'
payload_off: '{"output1":{"value":false}}'
value_template: '{{ value_json.output1.value }}'
state_on: true
state_off: false
How can I add code for the inputs?
binary_sensor:
- platform: gpio
name: "e16s-input1"
pin:
pcf8574: pcf8574_hub_in_1
number: 0
mode: INPUT
inverted: true