Smart Home Automation Forum
Recording of energy usage data on M30 to MicroSD - Printable Version

+- Smart Home Automation Forum (https://www.kincony.com/forum)
+-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20)
+--- Forum: KC868-M16 / M1 / MB / M30 (https://www.kincony.com/forum/forumdisplay.php?fid=50)
+--- Thread: Recording of energy usage data on M30 to MicroSD (/showthread.php?tid=7607)



Recording of energy usage data on M30 to MicroSD - sc00bs - 02-12-2025

Hi Everyone

Thank you to Kincony for the great product, I have a few questions, if anyone can help me please? :-) 

Any suggestions as to what is the best way to set up the M30 for recording usage data to the microsd as a standalone unit? 
There will be no internet access for the unit while it is monitoring the energy usage and I would like to be able to record the usage with time stamps and be able to review it once the installation is complete. 
I have various sizes of CT Clamps (30,60 & 100A) so need to be able to specify the size of the clamp installed per port and would also like a WebUi to check that everything is working and set times etc if necessary. 

I have been investigating using ESPHome but assume that I could use Arduino IDE as well to do this, what would you recommend and do you have any sample code I could use?

I have been struggling to work out the pinouts for the Microsd card, can you tell me if these are the correct pinouts? 

sd_card:
  cs_pin: GPIO5  # Adjust CS pin based on your hardware
  spi_id: sd_spi
  spi:
    clk_pin: GPIO18
    mosi_pin: GPIO23
    miso_pin: GPIO19

I have attached a copy of the ESPZHome YAML code I have been working on. 
All suggestions welcome.


RE: Recording of energy usage data on M30 to MicroSD - admin - 02-12-2025

M30 SD card pin define as these:
SPI BUS:
SCK:14
MOSI:15
MISO:2

now ESPHome not support SD card. You can write your own arduino code for that.


RE: Recording of energy usage data on M30 to MicroSD - sc00bs - 02-12-2025

Thank you for your reply, 

Do you have a sample Arduino IDE code for that perhaps?

I am not a programmer so is easier if I can build on something that already exists.


RE: Recording of energy usage data on M30 to MicroSD - admin - 02-12-2025

https://www.kincony.com/forum/showthread.php?tid=2868


RE: Recording of energy usage data on M30 to MicroSD - sc00bs - 02-12-2025

Thank you for the assistance, is there any specific model of ESP32 I should use in Arduino IDE when I want to upload the code


RE: Recording of energy usage data on M30 to MicroSD - admin - 02-12-2025

you can chose NodeMcu-32S or ESP32 device.