Now i tried this Code, and it does nothing with my MIN TL-XH.
Any Ideas?
button:
- platform: template
name: "Battery First"
on_press:
then:
lambda: |-
esphome::modbus_controller::ModbusController *controller = id(growatt);
std::vector<uint16_t> on={0,23*256+59,1};
std::vector<uint16_t> off={0,23*256+59,0};
int size = on.size();
ESP_LOGI("ModbusLambda","Enqueue Writes");
//BF1
controller->queue_command(esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller,1100,size,on));
//LF1
controller->queue_command(esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller,1110,size,off));
//GF1
controller->queue_command(esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller,1080,size,off));
ESP_LOGI("ModbusLambda","Writes");
- platform: template
name: "Load First"
on_press:
then:
lambda: |-
esphome::modbus_controller::ModbusController *controller = id(growatt);
std::vector<uint16_t> on={0,23*256+59,1};
std::vector<uint16_t> off={0,23*256+59,0};
int size = on.size();
ESP_LOGI("ModbusLambda","Enqueue Writes");
//BF1
controller->queue_command(esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller,1100,size,off));
//LF1
controller->queue_command(esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller,1110,size,on));
//GF1
controller->queue_command(esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller,1080,size,off));
ESP_LOGI("ModbusLambda","Writes");
- platform: template
name: "Grid First"
on_press:
then:
lambda: |-
esphome::modbus_controller::ModbusController *controller = id(growatt);
std::vector<uint16_t> on={0,23*256+59,1};
std::vector<uint16_t> off={0,23*256+59,0};
int size = on.size();
ESP_LOGI("ModbusLambda","Enqueue Writes");
//BF1
controller->queue_command(esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller,1100,size,off));
//LF1
controller->queue_command(esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller,1110,size,off));
//GF1
controller->queue_command(esphome::modbus_controller::ModbusCommandItem::create_write_multiple_command(controller,1080,size,on));
ESP_LOGI("ModbusLambda","Writes");