diff --git a/gas-kocheg-wemos.yaml b/gas-kocheg-wemos.yaml index bca2bfe..ac58619 100644 --- a/gas-kocheg-wemos.yaml +++ b/gas-kocheg-wemos.yaml @@ -46,5 +46,13 @@ sensor: unit_of_measurement: "ppm" icon: "mdi:meter-gas-outline" + +mqtt: + broker: 192.168.88.4 + username: 'miroca' + password: 'cbvgcjy0' + discovery: False # disable entity discovery + discover_ip: True # enable device discovery + # web_server: # port: 80 \ No newline at end of file diff --git a/kc868-a6.yaml b/kc868-a6.yaml index 0502d38..48ad42a 100644 --- a/kc868-a6.yaml +++ b/kc868-a6.yaml @@ -63,6 +63,7 @@ modbus_controller: - id: modbus_sensor address: 0x01 # device address modbus_id: modbus1 + update_interval: 2s i2c: sda: GPIO4 @@ -89,6 +90,11 @@ binary_sensor: number: 0 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output1 + on_release: + - switch.toggle: switch_output1 + - platform: gpio name: "KC868-A6-IN-2" pin: @@ -96,6 +102,11 @@ binary_sensor: number: 1 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output2 + on_release: + - switch.toggle: switch_output2 + - platform: gpio name: "KC868-A6-IN-3" pin: @@ -103,6 +114,11 @@ binary_sensor: number: 2 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output3 + on_release: + - switch.toggle: switch_output3 + - platform: gpio name: "KC868-A6-IN-4" pin: @@ -110,6 +126,11 @@ binary_sensor: number: 3 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output4 + on_release: + - switch.toggle: switch_output4 + - platform: gpio name: "KC868-A6-IN-5" pin: @@ -117,6 +138,11 @@ binary_sensor: number: 4 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output5 + on_release: + - switch.toggle: switch_output5 + - platform: gpio name: "KC868-A6-IN-6" pin: @@ -124,51 +150,60 @@ binary_sensor: number: 5 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output6 + on_release: + - switch.toggle: switch_output6 switch: - platform: gpio name: "KC868-A6-RELAY-1" - id: relay_1 + id: switch_output1 pin: pcf8574: outputs number: 0 mode: OUTPUT inverted: true + - platform: gpio name: "KC868-A6-RELAY-2" - id: relay_2 + id: switch_output2 pin: pcf8574: outputs number: 1 mode: OUTPUT inverted: true + - platform: gpio name: "KC868-A6-RELAY-3" - id: relay_3 + id: switch_output3 pin: pcf8574: outputs number: 2 mode: OUTPUT inverted: true + - platform: gpio name: "KC868-A6-RELAY-4" - id: relay_4 + id: switch_output4 pin: pcf8574: outputs number: 3 mode: OUTPUT inverted: true + - platform: gpio name: "KC868-A6-RELAY-5" - id: relay_5 + id: switch_output5 pin: pcf8574: outputs number: 4 mode: OUTPUT inverted: true + - platform: gpio name: "KC868-A6-RELAY-6" - id: relay_6 + id: switch_output6 pin: pcf8574: outputs number: 5 diff --git a/kontroller-kocheg-a16.yaml b/kontroller-kocheg-a16.yaml index 125a28c..561a491 100644 --- a/kontroller-kocheg-a16.yaml +++ b/kontroller-kocheg-a16.yaml @@ -50,6 +50,18 @@ uart: rx_pin: GPIO16 baud_rate: 9600 + +# Config Modbus +modbus: + uart_id: uart_modbus + id: modbus1 + +modbus_controller: + - id: modbus_sensor + address: 0x01 # device address + modbus_id: modbus1 + update_interval: 10s + remote_receiver: pin: number: GPIO2 @@ -94,6 +106,7 @@ binary_sensor: pin: number: GPIO33 inverted: true + - platform: gpio name: "KC868-A16-HT3" @@ -108,6 +121,10 @@ binary_sensor: number: 0 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output4 + on_release: + - switch.toggle: switch_output4 - platform: gpio name: "input2_veranda_stolb_krylco" @@ -116,6 +133,10 @@ binary_sensor: number: 1 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output7 + on_release: + - switch.toggle: switch_output7 - platform: gpio name: "input3_veranda_osvechen" @@ -124,22 +145,34 @@ binary_sensor: number: 2 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output6 + on_release: + - switch.toggle: switch_output6 - platform: gpio - name: "input4_krylco_veranda" + name: "input4_krylco_stolb" pin: pcf8574: inputs_1_8 number: 3 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output7 + on_release: + - switch.toggle: switch_output7 - platform: gpio - name: "input5_krylco_stolb" + name: "input5_krylco_podsvetka" pin: pcf8574: inputs_1_8 number: 4 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output6 + on_release: + - switch.toggle: switch_output6 - platform: gpio name: "input6_krylco_osv" @@ -148,6 +181,10 @@ binary_sensor: number: 5 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output4 + on_release: + - switch.toggle: switch_output4 - platform: gpio name: "input7_veranda_rozetka" @@ -164,6 +201,10 @@ binary_sensor: number: 7 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output3 + on_release: + - switch.toggle: switch_output3 - platform: gpio name: "input9_nasos" @@ -172,6 +213,10 @@ binary_sensor: number: 0 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output2 + on_release: + - switch.toggle: switch_output2 - platform: gpio name: "input10_boiler" @@ -180,6 +225,10 @@ binary_sensor: number: 1 mode: INPUT inverted: true + on_press: + - switch.toggle: switch_output1 + on_release: + - switch.toggle: switch_output1 - platform: gpio name: "KC868-A16-X11" @@ -233,7 +282,7 @@ binary_sensor: switch: - platform: gpio name: "Output01_podval_boiler" - id: out_y01 + id: switch_output1 pin: pcf8574: outputs_1_8 number: 0 @@ -242,7 +291,7 @@ switch: - platform: gpio name: "Output02_podval_nasos" - id: out_y02 + id: switch_output2 pin: pcf8574: outputs_1_8 number: 1 @@ -251,7 +300,7 @@ switch: - platform: gpio name: "Output03_podval_svet" - id: out_y03 + id: switch_output3 pin: pcf8574: outputs_1_8 number: 2 @@ -260,7 +309,7 @@ switch: - platform: gpio name: "Output04_veranda_svet" - id: out_y04 + id: switch_output4 pin: pcf8574: outputs_1_8 number: 3 @@ -269,7 +318,7 @@ switch: - platform: gpio name: "Output05_teplica" - id: out_y05 + id: switch_output5 pin: pcf8574: outputs_1_8 number: 4 @@ -278,7 +327,7 @@ switch: - platform: gpio name: "Output06_podsvetka" - id: out_y06 + id: switch_output6 pin: pcf8574: outputs_1_8 number: 5 @@ -287,7 +336,7 @@ switch: - platform: gpio name: "Output07_stolb" - id: out_y07 + id: switch_output7 pin: pcf8574: outputs_1_8 number: 6 @@ -296,7 +345,7 @@ switch: - platform: gpio name: "Output08_rozetka" - id: out_y08 + id: switch_output8 pin: pcf8574: outputs_1_8 number: 7 @@ -305,7 +354,7 @@ switch: - platform: gpio name: "Output09" - id: out_y09 + id: switch_output9 pin: pcf8574: outputs_9_16 number: 0 @@ -314,7 +363,7 @@ switch: - platform: gpio name: "Output10" - id: out_y10 + id: switch_output10 pin: pcf8574: outputs_9_16 number: 1 @@ -323,7 +372,7 @@ switch: - platform: gpio name: "Output11" - id: out_y11 + id: switch_output11 pin: pcf8574: outputs_9_16 number: 2 @@ -332,7 +381,7 @@ switch: - platform: gpio name: "Output12" - id: out_y12 + id: switch_output12 pin: pcf8574: outputs_9_16 number: 3 @@ -341,7 +390,7 @@ switch: - platform: gpio name: "Output13" - id: out_y13 + id: switch_output13 pin: pcf8574: outputs_9_16 number: 4 @@ -350,7 +399,7 @@ switch: - platform: gpio name: "Output14" - id: out_y14 + id: switch_output14 pin: pcf8574: outputs_9_16 number: 5 @@ -359,7 +408,7 @@ switch: - platform: gpio name: "Output15" - id: out_y15 + id: switch_output15 pin: pcf8574: outputs_9_16 number: 6 @@ -368,7 +417,7 @@ switch: - platform: gpio name: "Output16" - id: out_y16 + id: switch_output16 pin: pcf8574: outputs_9_16 number: 7 @@ -379,17 +428,42 @@ switch: # update_interval: 1s sensor: + - platform: modbus_controller + modbus_controller_id: modbus_sensor + name: "Temperature Sensor" + id: temperature_sensor + address: 0x0001 + register_type: read + value_type: U_WORD + unit_of_measurement: "°C" + accuracy_decimals: 1 + filters: + - lambda: if (x < 10000) return x * 0.1; else return -1 * (x - 10000) * 0.1; + + + - platform: modbus_controller + modbus_controller_id: modbus_sensor + name: "Humidity Sensor" + id: humidity_sensor + address: 0x0002 + register_type: read + value_type: U_WORD + unit_of_measurement: "%" + accuracy_decimals: 1 + filters: + - multiply: 0.1 + - platform: dallas_temp one_wire_id: bus32 name: "DS18B20" update_interval: 30s -web_server: - port: 80 - auth: - username: "silver" - password: "cbvgcjy0" +# web_server: +# port: 80 +# auth: +# username: "silver" +# password: "cbvgcjy0" mqtt: broker: 192.168.88.4 diff --git a/kontroller-kocheg-a8.yaml b/kontroller-kocheg-a8.yaml index d9f8a1e..1c7f8a5 100644 --- a/kontroller-kocheg-a8.yaml +++ b/kontroller-kocheg-a8.yaml @@ -202,18 +202,18 @@ sensor: - platform: dallas_temp one_wire_id: bus14 name: "DS18B20_kontroller" - update_interval: 30s + update_interval: 10s - platform: dallas_temp one_wire_id: bus13 name: "DS18B20_server" - update_interval: 30s + update_interval: 10s -# web_server: -# port: 80 -# auth: -# username: "silver" -# password: "cbvgcjy0" +web_server: + port: 80 + auth: + username: "silver" + password: "cbvgcjy0" mqtt: broker: 192.168.88.4 diff --git a/teplica-a8.yaml b/teplica-a8.yaml index de62975..2912385 100644 --- a/teplica-a8.yaml +++ b/teplica-a8.yaml @@ -205,12 +205,12 @@ one_wire: - platform: gpio pin: GPIO14 id: bus14 - + sensor: - platform: dallas_temp one_wire_id: bus14 name: "DS18B20" - update_interval: 30s + update_interval: 2s - platform: adc pin: 34