Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 9,124
» Latest member: novasmith
» Forum threads: 4,059
» Forum posts: 20,388

Full Statistics

Online Users
There are currently 25 online users.
» 0 Member(s) | 15 Guest(s)
Amazonbot, Baidu, Bing, Crawl, PetalBot, bot

Latest Threads
B4 Smart Controller Wirin...
Forum: B4
Last Post: vojtech
50 minutes ago
» Replies: 3
» Views: 127
Input real isolation
Forum: KC868-AI
Last Post: admin
11 hours ago
» Replies: 1
» Views: 5
M30 Power Factor
Forum: KC868-M16 / M1 / MB / M30
Last Post: admin
Yesterday, 12:37 PM
» Replies: 1
» Views: 24
Digital Input de-bounce
Forum: KC868-A6
Last Post: l0v4szl
06-01-2026, 09:40 PM
» Replies: 2
» Views: 27
access control panel by w...
Forum: KC868-A32/A32 Pro
Last Post: admin
05-31-2026, 08:58 PM
» Replies: 15
» Views: 9,557
KC868-HA-V21 24v supply
Forum: Getting Started with ESPHome and Home Assistant
Last Post: admin
05-31-2026, 12:20 AM
» Replies: 3
» Views: 68
DM4 ESPHome yaml for home...
Forum: Getting Started with ESPHome and Home Assistant
Last Post: admin
05-30-2026, 08:57 PM
» Replies: 1
» Views: 36
KC868-H32B configuration ...
Forum: DIY Project
Last Post: ahmed
05-30-2026, 04:51 AM
» Replies: 6
» Views: 1,600
KC868-A16v3 integration w...
Forum: KC868-A series and Uair Smart Controller
Last Post: admin
05-29-2026, 01:17 PM
» Replies: 1
» Views: 69
F24 work with TS RS485 se...
Forum: F24
Last Post: admin
05-29-2026, 04:15 AM
» Replies: 0
» Views: 48

  Errno 113
Posted by: shuhrat - 01-06-2024, 09:35 AM - Forum: KC868-A16S - Replies (5)

Can't connect to ESPHome API for kc868-a16s @ 192.168.30.85: Error connecting to [AddrInfo(family=<AddressFamily.AF_INET: 2>, type=<SocketKind.SOCK_STREAM: 1>, proto=6, sockaddr=IPv4Sockaddr(address='192.168.30.85', port=6053))]: [Errno 113] Connect call failed ('192.168.30.85', 6053) (SocketAPIError)

12:04:08 – (ПРЕДУПРЕЖДЕНИЕ) runner.py
kc868-a16s @ 192.168.30.85: Connection error occurred: Ping response not received after 90.0 seconds
12:04:07 – (ПРЕДУПРЕЖДЕНИЕ) runner.py

Almost every day I get this error. After it the device stops responding and I reboot it and then everything works
esphome:
name: kc868-a16s
platform: ESP32
board: esp32dev


# Enable logging
logger:

# Enable Home Assistant API
api:
encryption:
key: "iJcfgpwJwZg9ObKzoD9XIa1KAQx8yAy7BZwuo3ye5cg="

ota:
password: "f705fcd4ef788f830ac190213002873b"

# Example configuration entry for ESP32
i2c:
sda: 4
scl: 5
scan: true
id: bus_a


# Example configuration entry
ethernet:
type: LAN8720
mdc_pin: GPIO23
mdio_pin: GPIO18
clk_mode: GPIO17_OUT
phy_addr: 0
use_address: 192.168.30.85

# Optional manual IP
manual_ip:
static_ip: 192.168.30.85
gateway: 192.168.30.1
subnet: 255.255.255.0


# Example configuration entry
pcf8574:
- id: 'pcf8574_hub_out_1' # for output channel 1-8
address: 0x24

- 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: 0x23

# Individual outputs
switch:
- platform: gpio
name: "a16s-output1"
pin:
pcf8574: pcf8574_hub_out_1
number: 0
mode: OUTPUT
inverted: true

- platform: gpio
name: "a16s-output2"
pin:
pcf8574: pcf8574_hub_out_1
number: 1
mode: OUTPUT
inverted: true

- platform: gpio
name: "a16s-output3"
pin:
pcf8574: pcf8574_hub_out_1
number: 2
mode: OUTPUT
inverted: true

Print this item

  I tried to install KC868-A128 but I got an error!
Posted by: soethu - 01-06-2024, 04:28 AM - Forum: KC868-A128 - Replies (7)

INFO ESPHome 2023.12.5
INFO Reading configuration /config/esphome/a128.yaml...
WARNING GPIO5 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-a...pping-pins
WARNING GPIO15 is a strapping PIN and should only be used for I/O with care.
Attaching external pullup/down resistors to strapping pins can cause unexpected failures.
See https://esphome.io/guides/faq.html#why-a...pping-pins
Failed config

switch.gpio: [source <unicode string>:516]
 
  Pin 0 is used in multiple places.
  platform: gpio
  name: a128-light49
  pin:
    pcf8574: pcf8574_hub_out_4
    number: 0
    mode:
      output: True
      input: False
    inverted: True
  disabled_by_default: False
  restore_mode: ALWAYS_OFF
  interlock_wait_time: 0ms
switch.gpio: [source <unicode string>:644]
 
  Pin 0 is used in multiple places.
  platform: gpio
  name: a128-light65
  pin:
    pcf8574: pcf8574_hub_out_4
    number: 0
    mode:
      output: True
      input: False
    inverted: True
  disabled_by_default: False
  restore_mode: ALWAYS_OFF
  interlock_wait_time: 0ms

Print this item

  30 Channel ESP32 energy monitor – KinCony M30 released
Posted by: admin - 01-05-2024, 11:31 AM - Forum: News - Replies (5)

We have designed 30 Channel ESP32 energy monitor open source board - M30 (ESP32 30 Channel CT Clamp Energy Monitor) for home automation DIYer. The hardware have 30CH CT Clamp sensor INPUT ports + 3CH ZMPT101B voltage sensor + SD card + 30CH RGB colorful LED for current value. Ethernet+RS485+4G modbus 30CH high-accuracy energy meter ic-BL0910 with CT clamp. it can easy integrate to home assistant by ESPHome.
[Image: M30-1_01.jpg]
[Image: M30-1_02.jpg]
[Image: M30-1_03.jpg]
[Image: M30-1_04.jpg]
[Image: M30-1_05.jpg]

Print this item

  [Arduino source code for M30]-02 read all energy meter data
Posted by: admin - 01-05-2024, 11:25 AM - Forum: KC868-M16 / M1 / MB / M30 - No Replies

Code:
#include <ModbusMaster.h>
#include <arduino.h>
#include "HardwareSerial.h"
ModbusMaster node;
HardwareSerial my485Serial(2);

#define CHANNEL     0

String temp="";
void read_485(){
  while(my485Serial.available()>0)
  {
    temp = my485Serial.readString();   //read one data then delete it from buffer
     Serial.println(temp);
     //delay(100);
  }
  temp="";
}

void setup() {
  // put your setup code here, to run once:

  Serial.begin(115200);
  my485Serial.begin(115200,SERIAL_8N1,32,33);///rx:32  tx:33
  while(my485Serial.read()>0){}
  node.begin(1,my485Serial);
 
}

void loop() {
  // put your main code here, to run repeatedly:
  //first chip BL0910 address:100  second chip BL0910 address:200  third chip BL0910 address:300  every address have 35 bytes data
  if(0 == node.readHoldingRegisters(100,35))
  {
      Serial.print("register value: ");
      for(int i=0;i<35;i++)
      {
        Serial.print(node.getResponseBuffer(i));
        Serial.print(" ");
      }
  }
  Serial.println(" ");
  Serial.println("next circle!");
  delay(500);
}

Print this item

  [Arduino source code for M30]-01 debug 4G module AT command
Posted by: admin - 01-05-2024, 11:23 AM - Forum: KC868-M16 / M1 / MB / M30 - No Replies

   

Code:
void setup() {
  Serial.begin(115200);
  Serial2.begin(115200);
}

void loop() {
  while (Serial.available()) {
    //  delay(1);
      Serial2.write(Serial.read());
  }
  while (Serial2.available()) {
       Serial.write(Serial2.read());
  }
}

[Image: attachment.php?aid=1056]

Print this item

  M30 RS485 and Serial port development guide
Posted by: admin - 01-05-2024, 11:20 AM - Forum: KC868-M16 / M1 / MB / M30 - Replies (12)

M30 have one ARM cpu on board. the ARM CPU have one RS485 modbus interface for user. another ARM CPU's serial port connect to ESP32's GPIO.

RS485 communication settings: 38400bps,8,N,1
ESP32 serial port communication settings: 115200bps,8,N,1

they have some modbus protocol, just use by different baud rate.

first  BL0910 chip read CT 1-10 channel current.  modbus address is 100.
second BL0910 chip read CT 11-20 channel current. modbus address is 200.
third  BL0910 chip read CT 21-30 channel current. modbus address is 300.

every BL0910 have 35 bytes data, here are data structure:
   
this use by modbus pull tool:
   

Print this item

  M30 configure yaml for ESPhome
Posted by: admin - 01-05-2024, 11:11 AM - Forum: KC868-M16 / M1 / MB / M30 - Replies (89)

   
   
yaml download: 
.txt   M30_HA_LEDs.txt (Size: 49.87 KB / Downloads: 873)
modbus pull screen setting:    

substitutions:
  max_current_range1: "10"
  max_current_range2: "10"
  max_current_range3: "10"
  max_current_range4: "10"
  max_current_range5: "10"
  max_current_range6: "10"
  max_current_range7: "10"
  max_current_range8: "10"
  max_current_range9: "10"
  max_current_range10: "10"
  max_current_range11: "10"
  max_current_range12: "10"
  max_current_range13: "10"
  max_current_range14: "10"
  max_current_range15: "10"
  max_current_range16: "10"
  max_current_range17: "10"
  max_current_range18: "10"
  max_current_range19: "10"
  max_current_range20: "10"
  max_current_range21: "10"
  max_current_range22: "10"
  max_current_range23: "10"
  max_current_range24: "10"
  max_current_range25: "10"
  max_current_range26: "10"
  max_current_range27: "10"
  max_current_range28: "10"
  max_current_range29: "10"
  max_current_range30: "10"

esphome:
  name: m30
  friendly_name: m30

esp32:
  board: esp32dev
  framework:
    type: arduino


# Enable logging
logger:
  # baud_rate: 0

# Enable Home Assistant API
api:
  encryption:
    key: "8G0kVEA0/DqgAavgKNyy9EYUrWo6pEZM38JVMAryJv8="

ota:
  password: "2a26484203d80a83798414c879541760"

ethernet:
  type: LAN8720
  mdc_pin: GPIO23
  mdio_pin: GPIO18
  clk_mode: GPIO17_OUT
  phy_addr: 0

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: m30_1_current_1
    id: m30_1_current_1
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_1_current_1).state;
              float red = (current - 0.0) / ${max_current_range1};
              float green = (${max_current_range1} - current) / ${max_current_range1};
              float blue = 0.0;
             
              auto call = id(M30_LED1).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 101
    register_type: holding
    name: m30_1_current_2
    id: m30_1_current_2
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_1_current_2).state;
              float red = (current - 0.0) / ${max_current_range2};
              float green = (${max_current_range2} - current) / ${max_current_range2};
              float blue = 0.0;
             
              auto call = id(M30_LED2).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();   
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 102
    register_type: holding
    name: m30_1_current_3
    id: m30_1_current_3
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_1_current_3).state;
              float red = (current - 0.0) / ${max_current_range3};
              float green = (${max_current_range3} - current) / ${max_current_range3};
              float blue = 0.0;
             
              auto call = id(M30_LED3).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 103
    register_type: holding
    name: m30_1_current_4
    id: m30_1_current_4
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_1_current_4).state;
              float red = (current - 0.0) / ${max_current_range4};
              float green = (${max_current_range4} - current) / ${max_current_range4};
              float blue = 0.0;
             
              auto call = id(M30_LED4).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 104
    register_type: holding
    name: m30_1_current_5
    id: m30_1_current_5
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_1_current_5).state;
              float red = (current - 0.0) / ${max_current_range5};
              float green = (${max_current_range5} - current) / ${max_current_range5};
              float blue = 0.0;
             
              auto call = id(M30_LED5).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 105
    register_type: holding
    name: m30_1_current_6
    id: m30_1_current_6
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_1_current_6).state;
              float red = (current - 0.0) / ${max_current_range6};
              float green = (${max_current_range6} - current) / ${max_current_range6};
              float blue = 0.0;
             
              auto call = id(M30_LED6).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 106
    register_type: holding
    name: m30_1_current_7
    id: m30_1_current_7
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_1_current_7).state;
              float red = (current - 0.0) / ${max_current_range7};
              float green = (${max_current_range7} - current) / ${max_current_range7};
              float blue = 0.0;
             
              auto call = id(M30_LED7).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 107
    register_type: holding
    name: m30_1_current_8
    id: m30_1_current_8
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_1_current_8).state;
              float red = (current - 0.0) / ${max_current_range8};
              float green = (${max_current_range8} - current) / ${max_current_range8};
              float blue = 0.0;
             
              auto call = id(M30_LED8).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 108
    register_type: holding
    name: m30_1_current_9
    id: m30_1_current_9
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_1_current_9).state;
              float red = (current - 0.0) / ${max_current_range9};
              float green = (${max_current_range9} - current) / ${max_current_range9};
              float blue = 0.0;
             
              auto call = id(M30_LED9).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 109
    register_type: holding
    name: m30_1_current_10
    id: m30_1_current_10
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_1_current_10).state;
              float red = (current - 0.0) / ${max_current_range10};
              float green = (${max_current_range10} - current) / ${max_current_range10};
              float blue = 0.0;
             
              auto call = id(M30_LED10).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 110
    register_type: holding
    name: m30_1_voltage
    id: m30_1_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: m30_1_watt_1
    id: m30_1_watt_1
    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: 112
    register_type: holding
    name: m30_1_watt_2
    id: m30_1_watt_2
    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: m30_1_watt_3
    id: m30_1_watt_3
    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: m30_1_watt_4
    id: m30_1_watt_4
    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: m30_1_watt_5
    id: m30_1_watt_5
    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: m30_1_watt_6
    id: m30_1_watt_6
    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: m30_1_watt_7
    id: m30_1_watt_7
    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: m30_1_watt_8
    id: m30_1_watt_8
    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: 119
    register_type: holding
    name: m30_1_watt_9
    id: m30_1_watt_9
    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: m30_1_watt_10
    id: m30_1_watt_10
    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: m30_1_energy_1
    id: m30_1_energy_1
    unit_of_measurement: kWh
    accuracy_decimals: 1
    value_type: U_WORD
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 122
    register_type: holding
    name: m30_1_energy_2
    id: m30_1_energy_2
    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: m30_1_energy_3
    id: m30_1_energy_3
    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: m30_1_energy_4
    id: m30_1_energy_4
    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: m30_1_energy_5
    id: m30_1_energy_5
    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: m30_1_energy_6
    id: m30_1_energy_6
    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: m30_1_energy_7
    id: m30_1_energy_7
    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: m30_1_energy_8
    id: m30_1_energy_8
    unit_of_measurement: kWh
    accuracy_decimals: 1
    value_type: U_WORD
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 129
    register_type: holding
    name: m30_1_energy_9
    id: m30_1_energy_9
    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: m30_1_energy_10
    id: m30_1_energy_10
    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: m30_1_energy_sum
    id: m30_1_energy_sum
    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: m30_1_period
    id: m30_1_period
    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: m30_1_tps_1
    id: m30_1_tps_1
    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: m30_1_tps_2
  #  id: m30_1_tps_2
  #  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: m30_2_current_1
    id: m30_2_current_1
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_2_current_1).state;
              float red = (current - 0.0) / ${max_current_range11};
              float green = (${max_current_range11} - current) / ${max_current_range11};
              float blue = 0.0;
             
              auto call = id(M30_LED11).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 201
    register_type: holding
    name: m30_2_current_2
    id: m30_2_current_2
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_2_current_2).state;
              float red = (current - 0.0) / ${max_current_range12};
              float green = (${max_current_range12} - current) / ${max_current_range12};
              float blue = 0.0;
             
              auto call = id(M30_LED12).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 202
    register_type: holding
    name: m30_2_current_3
    id: m30_2_current_3
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_2_current_3).state;
              float red = (current - 0.0) / ${max_current_range13};
              float green = (${max_current_range13} - current) / ${max_current_range13};
              float blue = 0.0;
             
              auto call = id(M30_LED13).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 203
    register_type: holding
    name: m30_2_current_4
    id: m30_2_current_4
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_2_current_4).state;
              float red = (current - 0.0) / ${max_current_range14};
              float green = (${max_current_range14} - current) / ${max_current_range14};
              float blue = 0.0;
             
              auto call = id(M30_LED14).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 204
    register_type: holding
    name: m30_2_current_5
    id: m30_2_current_5
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_2_current_5).state;
              float red = (current - 0.0) / ${max_current_range15};
              float green = (${max_current_range15} - current) / ${max_current_range15};
              float blue = 0.0;
             
              auto call = id(M30_LED15).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 205
    register_type: holding
    name: m30_2_current_6
    id: m30_2_current_6
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_2_current_6).state;
              float red = (current - 0.0) / ${max_current_range16};
              float green = (${max_current_range16} - current) / ${max_current_range16};
              float blue = 0.0;
             
              auto call = id(M30_LED16).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 206
    register_type: holding
    name: m30_2_current_7
    id: m30_2_current_7
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_2_current_7).state;
              float red = (current - 0.0) / ${max_current_range17};
              float green = (${max_current_range17} - current) / ${max_current_range17};
              float blue = 0.0;
             
              auto call = id(M30_LED17).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 207
    register_type: holding
    name: m30_2_current_8
    id: m30_2_current_8
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_2_current_8).state;
              float red = (current - 0.0) / ${max_current_range18};
              float green = (${max_current_range18} - current) / ${max_current_range18};
              float blue = 0.0;
             
              auto call = id(M30_LED18).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 208
    register_type: holding
    name: m30_2_current_9
    id: m30_2_current_9
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_2_current_9).state;
              float red = (current - 0.0) / ${max_current_range19};
              float green = (${max_current_range19} - current) / ${max_current_range19};
              float blue = 0.0;
             
              auto call = id(M30_LED19).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 209
    register_type: holding
    name: m30_2_current_10
    id: m30_2_current_10
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_2_current_10).state;
              float red = (current - 0.0) / ${max_current_range20};
              float green = (${max_current_range20} - current) / ${max_current_range20};
              float blue = 0.0;
             
              auto call = id(M30_LED20).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 210
    register_type: holding
    name: m30_2_voltage
    id: m30_2_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: m30_2_watt_1
    id: m30_2_watt_1
    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: 212
    register_type: holding
    name: m30_2_watt_2
    id: m30_2_watt_2
    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: m30_2_watt_3
    id: m30_2_watt_3
    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: m30_2_watt_4
    id: m30_2_watt_4
    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: m30_2_watt_5
    id: m30_2_watt_5
    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: m30_2_watt_6
    id: m30_2_watt_6
    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: m30_2_watt_7
    id: m30_2_watt_7
    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: m30_2_watt_8
    id: m30_2_watt_8
    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: 219
    register_type: holding
    name: m30_2_watt_9
    id: m30_2_watt_9
    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: m30_2_watt_10
    id: m30_2_watt_10
    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: m30_2_energy_1
    id: m30_2_energy_1
    unit_of_measurement: kWh
    accuracy_decimals: 1
    value_type: U_WORD
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 222
    register_type: holding
    name: m30_2_energy_2
    id: m30_2_energy_2
    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: m30_2_energy_3
    id: m30_2_energy_3
    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: m30_2_energy_4
    id: m30_2_energy_4
    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: m30_2_energy_5
    id: m30_2_energy_5
    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: m30_2_energy_6
    id: m30_2_energy_6
    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: m30_2_energy_7
    id: m30_2_energy_7
    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: m30_2_energy_8
    id: m30_2_energy_8
    unit_of_measurement: kWh
    accuracy_decimals: 1
    value_type: U_WORD
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 229
    register_type: holding
    name: m30_2_energy_9
    id: m30_2_energy_9
    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: m30_2_energy_10
    id: m30_2_energy_10
    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: m30_2_energy_sum
    id: m30_2_energy_sum
    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: m30_2_period
    id: m30_2_period
    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: m30_2_tps_1
    id: m30_2_tps_1
    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: m30_2_tps_2
  #  id: m30_2_tps_2
  #  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: m30_3_current_1
    id: m30_3_current_1
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_3_current_1).state;
              float red = (current - 0.0) / ${max_current_range21};
              float green = (${max_current_range21} - current) / ${max_current_range21};
              float blue = 0.0;
             
              auto call = id(M30_LED21).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 301
    register_type: holding
    name: m30_3_current_2
    id: m30_3_current_2
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_3_current_2).state;
              float red = (current - 0.0) / ${max_current_range22};
              float green = (${max_current_range22} - current) / ${max_current_range22};
              float blue = 0.0;
             
              auto call = id(M30_LED22).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 302
    register_type: holding
    name: m30_3_current_3
    id: m30_3_current_3
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_3_current_3).state;
              float red = (current - 0.0) / ${max_current_range23};
              float green = (${max_current_range23} - current) / ${max_current_range23};
              float blue = 0.0;
             
              auto call = id(M30_LED23).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 303
    register_type: holding
    name: m30_3_current_4
    id: m30_3_current_4
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_3_current_4).state;
              float red = (current - 0.0) / ${max_current_range24};
              float green = (${max_current_range24} - current) / ${max_current_range24};
              float blue = 0.0;
             
              auto call = id(M30_LED24).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 304
    register_type: holding
    name: m30_3_current_5
    id: m30_3_current_5
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_3_current_5).state;
              float red = (current - 0.0) / ${max_current_range25};
              float green = (${max_current_range25} - current) / ${max_current_range25};
              float blue = 0.0;
             
              auto call = id(M30_LED25).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 305
    register_type: holding
    name: m30_3_current_6
    id: m30_3_current_6
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_3_current_6).state;
              float red = (current - 0.0) / ${max_current_range26};
              float green = (${max_current_range26} - current) / ${max_current_range26};
              float blue = 0.0;
             
              auto call = id(M30_LED26).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 306
    register_type: holding
    name: m30_3_current_7
    id: m30_3_current_7
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_3_current_7).state;
              float red = (current - 0.0) / ${max_current_range27};
              float green = (${max_current_range27} - current) / ${max_current_range27};
              float blue = 0.0;
             
              auto call = id(M30_LED27).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 307
    register_type: holding
    name: m30_3_current_8
    id: m30_3_current_8
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_3_current_8).state;
              float red = (current - 0.0) / ${max_current_range28};
              float green = (${max_current_range28} - current) / ${max_current_range28};
              float blue = 0.0;
             
              auto call = id(M30_LED28).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 308
    register_type: holding
    name: m30_3_current_9
    id: m30_3_current_9
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_3_current_9).state;
              float red = (current - 0.0) / ${max_current_range29};
              float green = (${max_current_range29} - current) / ${max_current_range29};
              float blue = 0.0;
             
              auto call = id(M30_LED29).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 309
    register_type: holding
    name: m30_3_current_10
    id: m30_3_current_10
    unit_of_measurement: A
    accuracy_decimals: 3
    value_type: U_WORD
    filters:
      - multiply: 0.00098
    on_value:
      - then:
          - lambda: |-
              float current = id(m30_3_current_10).state;
              float red = (current - 0.0) / ${max_current_range30};
              float green = (${max_current_range30} - current) / ${max_current_range30};
              float blue = 0.0;
             
              auto call = id(M30_LED30).turn_on();
              call.set_brightness(0.6);
              call.set_rgb(red, green, blue);
              call.set_color_mode(ColorMode::RGB);
              call.perform();
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 310
    register_type: holding
    name: m30_3_voltage
    id: m30_3_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: m30_3_watt_1
    id: m30_3_watt_1
    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: 312
    register_type: holding
    name: m30_3_watt_2
    id: m30_3_watt_2
    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: m30_3_watt_3
    id: m30_3_watt_3
    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: m30_3_watt_4
    id: m30_3_watt_4
    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: m30_3_watt_5
    id: m30_3_watt_5
    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: m30_3_watt_6
    id: m30_3_watt_6
    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: m30_3_watt_7
    id: m30_3_watt_7
    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: m30_3_watt_8
    id: m30_3_watt_8
    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: 319
    register_type: holding
    name: m30_3_watt_9
    id: m30_3_watt_9
    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: m30_3_watt_10
    id: m30_3_watt_10
    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: m30_3_energy_1
    id: m30_3_energy_1
    unit_of_measurement: kWh
    accuracy_decimals: 1
    value_type: U_WORD
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 322
    register_type: holding
    name: m30_3_energy_2
    id: m30_3_energy_2
    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: m30_3_energy_3
    id: m30_3_energy_3
    unit_of_measurement: kWh
    accuracy_decimals: 1
    value_type: U_WORD
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 324
    register_type: holding
    name: m30_3_energy_4
    id: m30_3_energy_4
    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: m30_3_energy_5
    id: m30_3_energy_5
    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: m30_3_energy_6
    id: m30_3_energy_6
    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: m30_3_energy_7
    id: m30_3_energy_7
    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: m30_3_energy_8
    id: m30_3_energy_8
    unit_of_measurement: kWh
    accuracy_decimals: 1
    value_type: U_WORD
  - platform: modbus_controller
    modbus_controller_id: modbus_hub_m30
    address: 329
    register_type: holding
    name: m30_3_energy_9
    id: m30_3_energy_9
    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: m30_3_energy_10
    id: m30_3_energy_10
    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: m30_3_energy_sum
    id: m30_3_energy_sum
    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: m30_3_period
    id: m30_3_period
    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: m30_3_tps_1
    id: m30_3_tps_1
    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: m30_3_tps_2
  #  id: m30_3_tps_2
  #  unit_of_measurement: °C
  #  accuracy_decimals: 1
  #  value_type: U_WORD


light:
  - platform: partition
    name: "M30_LED1"
    id: M30_LED1
    segments:
      - id: light1
        from: 14
        to: 14


  - platform: partition
    name: "M30_LED2"
    id: M30_LED2
    segments:
      - id: light1
        from: 13
        to: 13

  - platform: partition
    name: "M30_LED3"
    id: M30_LED3
    segments:
      - id: light1
        from: 12
        to: 12

  - platform: partition
    name: "M30_LED4"
    id: M30_LED4
    segments:
      - id: light1
        from: 11
        to: 11

  - platform: partition
    name: "M30_LED5"
    id: M30_LED5
    segments:
      - id: light1
        from: 10
        to: 10

  - platform: partition
    name: "M30_LED6"
    id: M30_LED6
    segments:
      - id: light1
        from: 9
        to: 9

  - platform: partition
    name: "M30_LED7"
    id: M30_LED7
    segments:
      - id: light1
        from: 8
        to: 8

  - platform: partition
    name: "M30_LED8"
    id: M30_LED8
    segments:
      - id: light1
        from: 7
        to: 7

  - platform: partition
    name: "M30_LED9"
    id: M30_LED9
    segments:
      - id: light1
        from: 6
        to: 6

  - platform: partition
    name: "M30_LED10"
    id: M30_LED10
    segments:
      - id: light1
        from: 5
        to: 5

  - platform: partition
    name: "M30_LED11"
    id: M30_LED11
    segments:
      - id: light1
        from: 4
        to: 4

  - platform: partition
    name: "M30_LED12"
    id: M30_LED12
    segments:
      - id: light1
        from: 3
        to: 3

  - platform: partition
    name: "M30_LED13"
    id: M30_LED13
    segments:
      - id: light1
        from: 2
        to: 2

  - platform: partition
    name: "M30_LED14"
    id: M30_LED14
    segments:
      - id: light1
        from: 1
        to: 1

  - platform: partition
    name: "M30_LED15"
    id: M30_LED15
    segments:
      - id: light1
        from: 0
        to: 0

  - platform: partition
    name: "M30_LED16"
    id: M30_LED16
    segments:
      - id: light1
        from: 15
        to: 15

  - platform: partition
    name: "M30_LED17"
    id: M30_LED17
    segments:
      - id: light1
        from: 16
        to: 16

  - platform: partition
    name: "M30_LED18"
    id: M30_LED18
    segments:
      - id: light1
        from: 17
        to: 17

  - platform: partition
    name: "M30_LED19"
    id: M30_LED19
    segments:
      - id: light1
        from: 18
        to: 18

  - platform: partition
    name: "M30_LED20"
    id: M30_LED20
    segments:
      - id: light1
        from: 19
        to: 19

  - platform: partition
    name: "M30_LED21"
    id: M30_LED21
    segments:
      - id: light1
        from: 20
        to: 20

  - platform: partition
    name: "M30_LED22"
    id: M30_LED22
    segments:
      - id: light1
        from: 21
        to: 21

  - platform: partition
    name: "M30_LED23"
    id: M30_LED23
    segments:
      - id: light1
        from: 22
        to: 22

  - platform: partition
    name: "M30_LED24"
    id: M30_LED24
    segments:
      - id: light1
        from: 23
        to: 23

  - platform: partition
    name: "M30_LED25"
    id: M30_LED25
    segments:
      - id: light1
        from: 24
        to: 24

  - platform: partition
    name: "M30_LED26"
    id: M30_LED26
    segments:
      - id: light1
        from: 25
        to: 25

  - platform: partition
    name: "M30_LED27"
    id: M30_LED27
    segments:
      - id: light1
        from: 26
        to: 26

  - platform: partition
    name: "M30_LED28"
    id: M30_LED28
    segments:
      - id: light1
        from: 27
        to: 27

  - platform: partition
    name: "M30_LED29"
    id: M30_LED29
    segments:
      - id: light1
        from: 28
        to: 28

  - platform: partition
    name: "M30_LED30"
    id: M30_LED30
    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

Print this item

  M30 ESP32 I/O pin define
Posted by: admin - 01-05-2024, 11:02 AM - Forum: KC868-M16 / M1 / MB / M30 - Replies (7)

Ethernet (LAN8720) I/O define:

ETH_ADDR        0
ETH_POWER_PIN  -1
ETH_MDC_PIN    23
ETH_MDIO_PIN  18
ETH_TYPE      ETH_PHY_LAN8720
ETH_CLK_MODE  ETH_CLOCK_GPIO17_OUT

IIC BUS:
SDA:5
SCL:16

SPI BUS:
SCK:14
MOSI:15
MISO:2

WS2812 RGBW LED:12

----------------------------------
ARM CPU TXD:32
ARM CPU RXD:33

4G:
RXD:13
TXD:4

Print this item

  how to enable Raspberry pi CM4 additional UART serial ports
Posted by: admin - 01-05-2024, 06:02 AM - Forum: KC868-Server Raspberry Pi4 local server - No Replies

edit config.txt file, add:

dtoverlay=uart2
dtoverlay=uart3
dtoverlay=uart4
dtoverlay=uart5

Note that the kernel will reject attempts to enable UARTs where the pins are in use by something else (e.g. UART0, UART1 or one of the I2C ports), or it might even disable the other thing, so make sure what you are trying to do is possible.

uart1 being enabled by default, pi 4 having 4 extra uarts.

Print this item

  Communicate between multiple ESP's with RS485 Modbus
Posted by: k0cka - 01-04-2024, 11:22 PM - Forum: Getting Started with ESPHome and Home Assistant - Replies (10)

Hello, I was searching on the internet but I could not find answers to my questions. So I would like to try my luck here and see if someone can help me.

I would like to ask if it’s possible to communicate between multiple ESP’s using modbus in ESPHome. So for example - I press a button on esp1 and turn on a relay on esp2.

I have some max485 modules to convert UART to RS485, but I just don’t understand how should the yaml files been written since I’m a total newbie in this field.

Thank you in advance!

Print this item