substitutions: device_name: "energymeter_house_1" friendly_name: "Energymeter House 1" project_version: "1.0.0" device_description: "Energymeter to measure energy consumption for rooms and devices" max_current_range1: "16" max_current_range2: "16" max_current_range3: "16" max_current_range4: "16" max_current_range5: "16" max_current_range6: "16" max_current_range7: "16" max_current_range8: "16" max_current_range9: "16" max_current_range10: "16" max_current_range11: "16" max_current_range12: "16" max_current_range13: "16" max_current_range14: "16" max_current_range15: "16" max_current_range16: "16" max_current_range17: "16" max_current_range18: "16" max_current_range19: "16" max_current_range20: "16" max_current_range21: "16" max_current_range22: "16" max_current_range23: "16" max_current_range24: "16" max_current_range25: "16" max_current_range26: "16" max_current_range27: "16" max_current_range28: "16" max_current_range29: "16" max_current_range30: "16" packages: esphome: !include common/device_esphome.yaml api: !include common/device_api.yaml ota: !include common/device_ota.yaml status: !include common/sensor_status.yaml restart: !include common/switch_restart.yaml uptime: !include common/sensor_uptime.yaml esp32: board: esp32dev framework: type: arduino logger: ethernet: type: LAN8720 mdc_pin: GPIO23 mdio_pin: GPIO18 clk_mode: GPIO17_OUT phy_addr: 0 manual_ip: static_ip: 10.0.6.13 gateway: 10.0.6.254 subnet: 255.255.255.0 dns1: !secret wifi_dns1 dns2: !secret wifi_dns2 uart: id: modbus_uart rx_pin: 32 tx_pin: 33 baud_rate: 115200 stop_bits: 1 data_bits: 8 parity: NONE modbus: id: modbus_hub uart_id: modbus_uart modbus_controller: - id: modbus_hub_m30 address: 1 modbus_id: modbus_hub update_interval: 5s sensor: - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 100 register_type: holding name: sensor_1_current_0 id: sensor_1_current_0 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_1_current_0).state; float red = (current - 0.0) / ${max_current_range1}; float green = (${max_current_range1} - current) / ${max_current_range1}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_1_light_0).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_1_light_0).turn_off(); call.perform(); } id(kochfeld_current).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 101 register_type: holding name: sensor_1_current_1 id: sensor_1_current_1 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_1_current_1).state; float red = (current - 0.0) / ${max_current_range2}; float green = (${max_current_range2} - current) / ${max_current_range2}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_1_light_1).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_1_light_1).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 102 register_type: holding name: sensor_1_current_2 id: sensor_1_current_2 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_1_current_2).state; float red = (current - 0.0) / ${max_current_range3}; float green = (${max_current_range3} - current) / ${max_current_range3}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_1_light_2).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_1_light_2).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 103 register_type: holding name: sensor_1_current_3 id: sensor_1_current_3 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_1_current_3).state; float red = (current - 0.0) / ${max_current_range4}; float green = (${max_current_range4} - current) / ${max_current_range4}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_1_light_3).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_1_light_3).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 104 register_type: holding name: sensor_1_current_4 id: sensor_1_current_4 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_1_current_4).state; float red = (current - 0.0) / ${max_current_range5}; float green = (${max_current_range5} - current) / ${max_current_range5}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_1_light_4).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_1_light_4).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 105 register_type: holding name: sensor_1_current_5 id: sensor_1_current_5 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_1_current_5).state; float red = (current - 0.0) / ${max_current_range6}; float green = (${max_current_range6} - current) / ${max_current_range6}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_1_light_5).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_1_light_5).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 106 register_type: holding name: sensor_1_current_6 id: sensor_1_current_6 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_1_current_6).state; float red = (current - 0.0) / ${max_current_range7}; float green = (${max_current_range7} - current) / ${max_current_range7}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_1_light_6).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_1_light_6).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 107 register_type: holding name: sensor_1_current_7 id: sensor_1_current_7 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_1_current_7).state; float red = (current - 0.0) / ${max_current_range8}; float green = (${max_current_range8} - current) / ${max_current_range8}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_1_light_7).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_1_light_7).turn_off(); call.perform(); } id(sauna_current).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 108 register_type: holding name: sensor_1_current_8 id: sensor_1_current_8 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_1_current_8).state; float red = (current - 0.0) / ${max_current_range9}; float green = (${max_current_range9} - current) / ${max_current_range9}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_1_light_8).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_1_light_8).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 109 register_type: holding name: sensor_1_current_9 id: sensor_1_current_9 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_1_current_9).state; float red = (current - 0.0) / ${max_current_range10}; float green = (${max_current_range10} - current) / ${max_current_range10}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_1_light_9).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_1_light_9).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 110 register_type: holding name: sensor_1_voltage id: sensor_1_voltage state_class: measurement device_class: voltage unit_of_measurement: V accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.01 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 111 register_type: holding name: sensor_1_power_0 id: sensor_1_power_0 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 on_value: - then: - lambda: |- id(kochfeld_power).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 112 register_type: holding name: sensor_1_power_1 id: sensor_1_power_1 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 113 register_type: holding name: sensor_1_power_2 id: sensor_1_power_2 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 114 register_type: holding name: sensor_1_power_3 id: sensor_1_power_3 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 115 register_type: holding name: sensor_1_power_4 id: sensor_1_power_4 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 116 register_type: holding name: sensor_1_power_5 id: sensor_1_power_5 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 117 register_type: holding name: sensor_1_power_6 id: sensor_1_power_6 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 118 register_type: holding name: sensor_1_power_7 id: sensor_1_power_7 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 on_value: - then: - lambda: |- id(sauna_power).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 119 register_type: holding name: sensor_1_power_8 id: sensor_1_power_8 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 120 register_type: holding name: sensor_1_power_9 id: sensor_1_power_9 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 121 register_type: holding name: sensor_1_energy_0 id: sensor_1_energy_0 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD on_value: - then: - lambda: |- id(kochfeld_energy).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 122 register_type: holding name: sensor_1_energy_1 id: sensor_1_energy_1 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 123 register_type: holding name: sensor_1_energy_2 id: sensor_1_energy_2 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 124 register_type: holding name: sensor_1_energy_3 id: sensor_1_energy_3 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 125 register_type: holding name: sensor_1_energy_4 id: sensor_1_energy_4 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 126 register_type: holding name: sensor_1_energy_5 id: sensor_1_energy_5 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 127 register_type: holding name: sensor_1_energy_6 id: sensor_1_energy_6 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 128 register_type: holding name: sensor_1_energy_7 id: sensor_1_energy_7 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD on_value: - then: - lambda: |- id(sauna_energy).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 129 register_type: holding name: sensor_1_energy_8 id: sensor_1_energy_8 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 130 register_type: holding name: sensor_1_energy_9 id: sensor_1_energy_9 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 131 register_type: holding name: sensor_1_energy_total id: sensor_1_energy_total state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 132 register_type: holding name: sensor_1_frequency id: sensor_1_frequency state_class: measurement device_class: frequency unit_of_measurement: Hz accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.01 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 133 register_type: holding name: sensor_1_temperature_1 id: sensor_1_temperature_1 state_class: measurement device_class: temperature unit_of_measurement: °C accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 # - platform: modbus_controller # modbus_controller_id: modbus_hub_m30 # address: 134 # register_type: holding # name: sensor_1_temperature_2 # id: sensor_1_temperature_2 # state_class: measurement # device_class: temperature # unit_of_measurement: °C # accuracy_decimals: 1 # value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 200 register_type: holding name: sensor_2_current_0 id: sensor_2_current_0 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_2_current_0).state; float red = (current - 0.0) / ${max_current_range11}; float green = (${max_current_range11} - current) / ${max_current_range11}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_2_light_0).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_2_light_0).turn_off(); call.perform(); } id(kochfeld_current).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 201 register_type: holding name: sensor_2_current_1 id: sensor_2_current_1 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_2_current_1).state; float red = (current - 0.0) / ${max_current_range12}; float green = (${max_current_range12} - current) / ${max_current_range12}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_2_light_1).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_2_light_1).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 202 register_type: holding name: sensor_2_current_2 id: sensor_2_current_2 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_2_current_2).state; float red = (current - 0.0) / ${max_current_range13}; float green = (${max_current_range13} - current) / ${max_current_range13}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_2_light_2).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_2_light_2).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 203 register_type: holding name: sensor_2_current_3 id: sensor_2_current_3 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_2_current_3).state; float red = (current - 0.0) / ${max_current_range14}; float green = (${max_current_range14} - current) / ${max_current_range14}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_2_light_3).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_2_light_3).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 204 register_type: holding name: sensor_2_current_4 id: sensor_2_current_4 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_2_current_4).state; float red = (current - 0.0) / ${max_current_range15}; float green = (${max_current_range15} - current) / ${max_current_range15}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_2_light_4).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_2_light_4).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 205 register_type: holding name: sensor_2_current_5 id: sensor_2_current_5 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_2_current_5).state; float red = (current - 0.0) / ${max_current_range16}; float green = (${max_current_range16} - current) / ${max_current_range16}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_2_light_5).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_2_light_5).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 206 register_type: holding name: sensor_2_current_6 id: sensor_2_current_6 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_2_current_6).state; float red = (current - 0.0) / ${max_current_range17}; float green = (${max_current_range17} - current) / ${max_current_range17}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_2_light_6).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_2_light_6).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 207 register_type: holding name: sensor_2_current_7 id: sensor_2_current_7 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_2_current_7).state; float red = (current - 0.0) / ${max_current_range18}; float green = (${max_current_range18} - current) / ${max_current_range18}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_2_light_7).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_2_light_7).turn_off(); call.perform(); } id(sauna_current).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 208 register_type: holding name: sensor_2_current_8 id: sensor_2_current_8 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_2_current_8).state; float red = (current - 0.0) / ${max_current_range19}; float green = (${max_current_range19} - current) / ${max_current_range19}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_2_light_8).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_2_light_8).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 209 register_type: holding name: sensor_2_current_9 id: sensor_2_current_9 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_2_current_9).state; float red = (current - 0.0) / ${max_current_range20}; float green = (${max_current_range20} - current) / ${max_current_range20}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_2_light_9).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_2_light_9).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 210 register_type: holding name: sensor_2_voltage id: sensor_2_voltage state_class: measurement device_class: voltage unit_of_measurement: V accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.01 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 211 register_type: holding name: sensor_2_power_0 id: sensor_2_power_0 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 on_value: - then: - lambda: |- id(kochfeld_power).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 212 register_type: holding name: sensor_2_power_1 id: sensor_2_power_1 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 213 register_type: holding name: sensor_2_power_2 id: sensor_2_power_2 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 214 register_type: holding name: sensor_2_power_3 id: sensor_2_power_3 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 215 register_type: holding name: sensor_2_power_4 id: sensor_2_power_4 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 216 register_type: holding name: sensor_2_power_5 id: sensor_2_power_5 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 217 register_type: holding name: sensor_2_power_6 id: sensor_2_power_6 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 218 register_type: holding name: sensor_2_power_7 id: sensor_2_power_7 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 on_value: - then: - lambda: |- id(sauna_power).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 219 register_type: holding name: sensor_2_power_8 id: sensor_2_power_8 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 220 register_type: holding name: sensor_2_power_9 id: sensor_2_power_9 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 221 register_type: holding name: sensor_2_energy_0 id: sensor_2_energy_0 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD on_value: - then: - lambda: |- id(kochfeld_energy).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 222 register_type: holding name: sensor_2_energy_1 id: sensor_2_energy_1 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 223 register_type: holding name: sensor_2_energy_2 id: sensor_2_energy_2 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 224 register_type: holding name: sensor_2_energy_3 id: sensor_2_energy_3 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 225 register_type: holding name: sensor_2_energy_4 id: sensor_2_energy_4 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 226 register_type: holding name: sensor_2_energy_5 id: sensor_2_energy_5 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 227 register_type: holding name: sensor_2_energy_6 id: sensor_2_energy_6 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 228 register_type: holding name: sensor_2_energy_7 id: sensor_2_energy_7 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD on_value: - then: - lambda: |- id(sauna_energy).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 229 register_type: holding name: sensor_2_energy_8 id: sensor_2_energy_8 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 230 register_type: holding name: sensor_2_energy_9 id: sensor_2_energy_9 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 231 register_type: holding name: sensor_2_energy_total id: sensor_2_energy_total state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 232 register_type: holding name: sensor_2_frequency id: sensor_2_frequency state_class: measurement device_class: frequency unit_of_measurement: Hz accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.01 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 233 register_type: holding name: sensor_2_temperature_1 id: sensor_2_temperature_1 state_class: measurement device_class: temperature unit_of_measurement: °C accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 # - platform: modbus_controller # modbus_controller_id: modbus_hub_m30 # address: 234 # register_type: holding # name: sensor_2_temperature_2 # id: sensor_2_temperature_2 # state_class: measurement # device_class: temperature # unit_of_measurement: °C # accuracy_decimals: 1 # value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 300 register_type: holding name: sensor_3_current_0 id: sensor_3_current_0 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_3_current_0).state; float red = (current - 0.0) / ${max_current_range21}; float green = (${max_current_range21} - current) / ${max_current_range21}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_3_light_0).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_3_light_0).turn_off(); call.perform(); } id(kochfeld_current).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 301 register_type: holding name: sensor_3_current_1 id: sensor_3_current_1 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_3_current_1).state; float red = (current - 0.0) / ${max_current_range22}; float green = (${max_current_range22} - current) / ${max_current_range22}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_3_light_1).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_3_light_1).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 302 register_type: holding name: sensor_3_current_2 id: sensor_3_current_2 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_3_current_2).state; float red = (current - 0.0) / ${max_current_range23}; float green = (${max_current_range23} - current) / ${max_current_range23}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_3_light_2).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_3_light_2).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 303 register_type: holding name: sensor_3_current_3 id: sensor_3_current_3 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_3_current_3).state; float red = (current - 0.0) / ${max_current_range24}; float green = (${max_current_range24} - current) / ${max_current_range24}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_3_light_3).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_3_light_3).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 304 register_type: holding name: sensor_3_current_4 id: sensor_3_current_4 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_3_current_4).state; float red = (current - 0.0) / ${max_current_range25}; float green = (${max_current_range25} - current) / ${max_current_range25}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_3_light_4).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_3_light_4).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 305 register_type: holding name: sensor_3_current_5 id: sensor_3_current_5 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_3_current_5).state; float red = (current - 0.0) / ${max_current_range26}; float green = (${max_current_range26} - current) / ${max_current_range26}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_3_light_5).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_3_light_5).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 306 register_type: holding name: sensor_3_current_6 id: sensor_3_current_6 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_3_current_6).state; float red = (current - 0.0) / ${max_current_range27}; float green = (${max_current_range27} - current) / ${max_current_range27}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_3_light_6).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_3_light_6).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 307 register_type: holding name: sensor_3_current_7 id: sensor_3_current_7 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_3_current_7).state; float red = (current - 0.0) / ${max_current_range28}; float green = (${max_current_range28} - current) / ${max_current_range28}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_3_light_7).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_3_light_7).turn_off(); call.perform(); } id(sauna_current).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 308 register_type: holding name: sensor_3_current_8 id: sensor_3_current_8 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_3_current_8).state; float red = (current - 0.0) / ${max_current_range29}; float green = (${max_current_range29} - current) / ${max_current_range29}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_3_light_8).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_3_light_8).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 309 register_type: holding name: sensor_3_current_9 id: sensor_3_current_9 state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 3 value_type: U_WORD filters: - multiply: 0.00098 on_value: - then: - lambda: |- float current = id(sensor_3_current_9).state; float red = (current - 0.0) / ${max_current_range30}; float green = (${max_current_range30} - current) / ${max_current_range30}; float blue = 0.0; if (id(light_enabled).state) { auto call = id(sensor_3_light_9).turn_on(); call.set_brightness(0.4); call.set_rgb(red, green, blue); call.set_color_mode(ColorMode::RGB); call.perform(); } else { auto call = id(sensor_3_light_9).turn_off(); call.perform(); } - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 310 register_type: holding name: sensor_3_voltage id: sensor_3_voltage state_class: measurement device_class: voltage unit_of_measurement: V accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.01 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 311 register_type: holding name: sensor_3_power_0 id: sensor_3_power_0 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 on_value: - then: - lambda: |- id(kochfeld_power).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 312 register_type: holding name: sensor_3_power_1 id: sensor_3_power_1 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 313 register_type: holding name: sensor_3_power_2 id: sensor_3_power_2 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 314 register_type: holding name: sensor_3_power_3 id: sensor_3_power_3 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 315 register_type: holding name: sensor_3_power_4 id: sensor_3_power_4 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 316 register_type: holding name: sensor_3_power_5 id: sensor_3_power_5 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 317 register_type: holding name: sensor_3_power_6 id: sensor_3_power_6 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 318 register_type: holding name: sensor_3_power_7 id: sensor_3_power_7 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 on_value: - then: - lambda: |- id(sauna_power).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 319 register_type: holding name: sensor_3_power_8 id: sensor_3_power_8 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 320 register_type: holding name: sensor_3_power_9 id: sensor_3_power_9 state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 321 register_type: holding name: sensor_3_energy_0 id: sensor_3_energy_0 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD on_value: - then: - lambda: |- id(kochfeld_energy).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 322 register_type: holding name: sensor_3_energy_1 id: sensor_3_energy_1 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 323 register_type: holding name: sensor_3_energy_2 id: sensor_3_energy_2 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 2 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 324 register_type: holding name: sensor_3_energy_3 id: sensor_3_energy_3 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 325 register_type: holding name: sensor_3_energy_4 id: sensor_3_energy_4 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 326 register_type: holding name: sensor_3_energy_5 id: sensor_3_energy_5 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 327 register_type: holding name: sensor_3_energy_6 id: sensor_3_energy_6 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 328 register_type: holding name: sensor_3_energy_7 id: sensor_3_energy_7 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD on_value: - then: - lambda: |- id(sauna_energy).update(); - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 329 register_type: holding name: sensor_3_energy_8 id: sensor_3_energy_8 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 330 register_type: holding name: sensor_3_energy_9 id: sensor_3_energy_9 state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 331 register_type: holding name: sensor_3_energy_total id: sensor_3_energy_total state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 value_type: U_WORD - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 332 register_type: holding name: sensor_3_frequency id: sensor_3_frequency state_class: measurement device_class: frequency unit_of_measurement: Hz accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.01 - platform: modbus_controller modbus_controller_id: modbus_hub_m30 address: 333 register_type: holding name: sensor_3_temperature_1 id: sensor_3_temperature_1 state_class: measurement device_class: temperature unit_of_measurement: °C accuracy_decimals: 1 value_type: U_WORD filters: - multiply: 0.1 # - platform: modbus_controller # modbus_controller_id: modbus_hub_m30 # address: 334 # register_type: holding # name: sensor_3_temperature_2 # id: sensor_3_temperature_2 # state_class: measurement # device_class: temperature # unit_of_measurement: °C # accuracy_decimals: 1 # value_type: U_WORD - platform: template name: kochfeld_current id: kochfeld_current state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 1 lambda: |- return id(sensor_1_current_0).state + id(sensor_2_current_0).state + id(sensor_3_current_0).state; - platform: template name: kochfeld_power id: kochfeld_power state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 lambda: |- return id(sensor_1_power_0).state + id(sensor_2_power_0).state + id(sensor_3_power_0).state; - platform: template name: kochfeld_energy id: kochfeld_energy state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 lambda: |- return id(sensor_1_energy_8).state + id(sensor_2_energy_0).state + id(sensor_3_energy_0).state; - platform: template name: sauna_current id: sauna_current state_class: measurement device_class: current unit_of_measurement: A accuracy_decimals: 1 lambda: |- return id(sensor_1_current_7).state + id(sensor_2_current_7).state + id(sensor_3_current_7).state; - platform: template name: sauna_power id: sauna_power state_class: measurement device_class: power unit_of_measurement: W accuracy_decimals: 1 lambda: |- return id(sensor_1_power_7).state + id(sensor_2_power_7).state + id(sensor_3_power_7).state; - platform: template name: sauna_energy id: sauna_energy state_class: total_increasing device_class: energy unit_of_measurement: kWh accuracy_decimals: 1 lambda: |- return id(sensor_1_energy_7).state + id(sensor_2_energy_7).state + id(sensor_3_energy_7).state; light: - platform: partition name: sensor_1_light_0 id: sensor_1_light_0 segments: - id: light1 from: 14 to: 14 - platform: partition name: sensor_1_light_1 id: sensor_1_light_1 segments: - id: light1 from: 13 to: 13 - platform: partition name: sensor_1_light_2 id: sensor_1_light_2 segments: - id: light1 from: 12 to: 12 - platform: partition name: sensor_1_light_3 id: sensor_1_light_3 segments: - id: light1 from: 11 to: 11 - platform: partition name: sensor_1_light_4 id: sensor_1_light_4 segments: - id: light1 from: 10 to: 10 - platform: partition name: sensor_1_light_5 id: sensor_1_light_5 segments: - id: light1 from: 9 to: 9 - platform: partition name: sensor_1_light_6 id: sensor_1_light_6 segments: - id: light1 from: 8 to: 8 - platform: partition name: sensor_1_light_7 id: sensor_1_light_7 segments: - id: light1 from: 7 to: 7 - platform: partition name: sensor_1_light_8 id: sensor_1_light_8 segments: - id: light1 from: 6 to: 6 - platform: partition name: sensor_1_light_9 id: sensor_1_light_9 segments: - id: light1 from: 5 to: 5 - platform: partition name: sensor_2_light_0 id: sensor_2_light_0 segments: - id: light1 from: 4 to: 4 - platform: partition name: sensor_2_light_1 id: sensor_2_light_1 segments: - id: light1 from: 3 to: 3 - platform: partition name: sensor_2_light_2 id: sensor_2_light_2 segments: - id: light1 from: 2 to: 2 - platform: partition name: sensor_2_light_3 id: sensor_2_light_3 segments: - id: light1 from: 1 to: 1 - platform: partition name: sensor_2_light_4 id: sensor_2_light_4 segments: - id: light1 from: 0 to: 0 - platform: partition name: sensor_2_light_5 id: sensor_2_light_5 segments: - id: light1 from: 15 to: 15 - platform: partition name: sensor_2_light_6 id: sensor_2_light_6 segments: - id: light1 from: 16 to: 16 - platform: partition name: sensor_2_light_7 id: sensor_2_light_7 segments: - id: light1 from: 17 to: 17 - platform: partition name: sensor_2_light_8 id: sensor_2_light_8 segments: - id: light1 from: 18 to: 18 - platform: partition name: sensor_2_light_9 id: sensor_2_light_9 segments: - id: light1 from: 19 to: 19 - platform: partition name: sensor_3_light_0 id: sensor_3_light_0 segments: - id: light1 from: 20 to: 20 - platform: partition name: sensor_3_light_1 id: sensor_3_light_1 segments: - id: light1 from: 21 to: 21 - platform: partition name: sensor_3_light_2 id: sensor_3_light_2 segments: - id: light1 from: 22 to: 22 - platform: partition name: sensor_3_light_3 id: sensor_3_light_3 segments: - id: light1 from: 23 to: 23 - platform: partition name: sensor_3_light_4 id: sensor_3_light_4 segments: - id: light1 from: 24 to: 24 - platform: partition name: sensor_3_light_5 id: sensor_3_light_5 segments: - id: light1 from: 25 to: 25 - platform: partition name: sensor_3_light_6 id: sensor_3_light_6 segments: - id: light1 from: 26 to: 26 - platform: partition name: sensor_3_light_7 id: sensor_3_light_7 segments: - id: light1 from: 27 to: 27 - platform: partition name: sensor_3_light_8 id: sensor_3_light_8 segments: - id: light1 from: 28 to: 28 - platform: partition name: sensor_3_light_9 id: sensor_3_light_9 segments: - id: light1 from: 29 to: 29 # Example for light segment source - platform: esp32_rmt_led_strip id: light1 rgb_order: GRB pin: GPIO12 num_leds: 30 rmt_channel: 0 chipset: ws2812 switch: - platform: template name: light_enabled id: light_enabled optimistic: true restore_mode: RESTORE_DEFAULT_OFF