Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PZEM-004T With A6 on Serial
#1
Howdy!

Thanks for the A6 Board, im using the second one already and i enjoy it.
I encountered a problem, connected PZEM-004T to Serial on A6 (GPIO12, 13)

When i power the board, it doesnt boot. I plug out the PZEM-004T from A6, it boots. I plug pzem back in. It works normaly, and i receive all the needed data.
What is the problem i have on boot?

pastebin code:
https://pastebin.com/Rbujh2R1

code:
Code:
esphome:
name: kotela6
friendly_name: KotelA6
libraries:
- "Wire"
- "ArduinoJson"

 
esp32:
board: esp32dev
framework:
type: arduino
 
 
wifi:
ssid: !secret wifi_ssid
password: !secret wifi_password
 
 
 
logger:
 
api:
encryption:
key:
 
captive_portal:
 
ota:
password: "
 
#########################
 
uart:
- id: ubus1
tx_pin: GPIO13
rx_pin: GPIO12
baud_rate: 9600
stop_bits: 1
 
 
 
 
 
i2c:
sda: GPIO4
scl: GPIO15 # Change SCL to GPIO22 to avoid issues with GPIO15
scan: true
 
 
 
##########################
pcf8574:
- id: 'pcf8574_hub_out_1' # for output channel 1-8
address: 0x24
- id: 'pcf8574_hub_in_1' # for input channel 9-16
address: 0x22
pcf8575: false
 
 
#####################
time:
- platform: ds1307
id: rtc_time
 
 
sensor:
 
#### PZEM-004T V3 ####
 
- platform: pzemac
address: 1
current:
name: "pMeter_current"
accuracy_decimals: 2
voltage:
name: "pMeter_voltage"
accuracy_decimals: 2
power:
name: "pMeter_power"
unit_of_measurement: W
accuracy_decimals: 2
id: pMeter_power
frequency:
name: "pMeter_frequency"
unit_of_measurement: Hz
accuracy_decimals: 2
power_factor:
name: "pMeter_power_factor"
accuracy_decimals: 2
id: pMeter_power_factor
energy:
name: "pMeter_energy"
unit_of_measurement: Wh
accuracy_decimals: 1
id: pMeter_energy
update_interval: 5s
 
 
- platform: template
name: "pMeter_cumulative power"
unit_of_measurement: "kWh"
accuracy_decimals: 1
update_interval: 5s
icon: mdi:power
lambda: return (( (id(pMeter_energy).state)/1000.0));
 
- platform: total_daily_energy
name: "pMeter_of_day"
power_id: pMeter_power
unit_of_measurement: "kWh"
accuracy_decimals: 2
id: pMeter_power_of_day
filters:
# Multiplication factor from W to kW is 0.001
- multiply: 0.001
icon: mdi:counter
 
- platform: template
name: "pMeter_veille"
id: template_pMeter_veille
unit_of_measurement: "kwh"
accuracy_decimals: 2
icon: mdi:power
update_interval: 10s
 
- platform: template
name: "pMeter_power_apparente"
id: pMeter_power_apparente
unit_of_measurement: "VA"
accuracy_decimals: 2
update_interval: 10s
icon: mdi:power
lambda: return ( (id(pMeter_power).state/id(pMeter_power_factor).state));
 
- platform: template
name: "pMeter_power_reactive"
id: pMeter_power_reactive
unit_of_measurement: "VAr"
accuracy_decimals: 2
update_interval: 10s
icon: mdi:power
lambda: return ( ( sqrt( (id(pMeter_power_apparente).state)*(id(pMeter_power_apparente).state) - (id(pMeter_power).state)*(id(pMeter_power).state) ) ) );
 
- platform: wifi_signal
name: "WiFi power_pMeter"
update_interval: 10s
 
- platform: uptime
name: "up"
id: uptime_sec
 
 
 
 
 
 
 
text_sensor:
- platform: template
name: pMeter_uptime
lambda: |-
int seconds = (id(uptime_sec).state);
int days = seconds / (24 * 3600);
seconds = seconds % (24 * 3600);
int hours = seconds / 3600;
seconds = seconds % 3600;
int minutes = seconds / 60;
seconds = seconds % 60;
return { (String(days) +"d " + String(hours) +"h " + String(minutes) +"m "+ String(seconds) +"s").c_str() };
icon: mdi:clock-start
update_interval: 113s
 
################################################# SENSOR
binary_sensor:
 
 
- platform: status
name: "pMeter_status"
- platform: gpio
name: "flood_elling"
icon: mdi:home-flood
pin:
pcf8574: pcf8574_hub_in_1
number: 0
mode: INPUT
inverted: true
 
- platform: gpio
name: "flood_pool"
icon: mdi:home-flood
pin:
pcf8574: pcf8574_hub_in_1
number: 1
mode: INPUT
inverted: true
- platform: gpio
name: "flood_pump"
icon: mdi:home-flood
pin:
pcf8574: pcf8574_hub_in_1
number: 2
mode: INPUT
inverted: true
- platform: gpio
name: "KC868-A6-IN-4"
pin:
pcf8574: pcf8574_hub_in_1
number: 3
mode: INPUT
inverted: true
- platform: gpio
name: "KC868-A6-IN-5"
pin:
pcf8574: pcf8574_hub_in_1
number: 4
mode: INPUT
inverted: true
- platform: gpio
name: "KC868-A6-IN-6"
pin:
pcf8574: pcf8574_hub_in_1
number: 5
mode: INPUT
inverted: true
 
 
################################################# RELAYS
switch:
 
- platform: restart
name: "pMeter_restart"
 
### KINCONY 1
- platform: gpio
name: "Boiler ten"
id: relay_1
icon: mdi:fan
pin:
pcf8574: pcf8574_hub_out_1
number: 0
mode: OUTPUT
inverted: true
 
 
- platform: gpio
name: "free"
id: relay_2
pin:
pcf8574: pcf8574_hub_out_1
number: 1
mode: OUTPUT
inverted: true
 
########################### ######### BOILER PUMP
- platform: gpio
name: "Boiler Pump"
icon: mdi:pump
id: relay_3
pin:
pcf8574: pcf8574_hub_out_1
number: 2
mode: OUTPUT
inverted: true
 
 
################################## #RECIRCULATE
 
 
- platform: gpio
name: "Recirculate Pump"
icon: mdi:pump
id: relay_4
pin:
pcf8574: pcf8574_hub_out_1
number: 3
mode: OUTPUT
inverted: true
 
######################## INTERLOCK WATER STOP ###########################
- platform: gpio
name: "HouseWater OFF"
icon: mdi:water-off-outline
 
id: relay_5
pin:
pcf8574: pcf8574_hub_out_1
number: 4
mode: OUTPUT
inverted: true
interlock: [relay_6] # Interlock with Grow Pump_6
 
- platform: gpio
name: "HouseWater ON"
icon: mdi:water
id: relay_6
pin:
pcf8574: pcf8574_hub_out_1
number: 5
mode: OUTPUT
inverted: true
interlock: [relay_5]
restore_mode: ALWAYS_ON
 


Attached Files Image(s)
   
Reply


Messages In This Thread
PZEM-004T With A6 on Serial - by Techno - 09-02-2024, 01:56 PM
RE: PZEM-004T With A6 on Serial - by mikesloper - 09-02-2024, 03:19 PM
RE: PZEM-004T With A6 on Serial - by Techno - 09-02-2024, 06:31 PM
RE: PZEM-004T With A6 on Serial - by mikesloper - 09-03-2024, 01:37 PM
RE: PZEM-004T With A6 on Serial - by admin - 09-03-2024, 06:13 AM
RE: PZEM-004T With A6 on Serial - by mikesloper - 09-03-2024, 01:25 PM
RE: PZEM-004T With A6 on Serial - by Techno - 09-03-2024, 01:41 PM
RE: PZEM-004T With A6 on Serial - by admin - 09-03-2024, 11:47 PM
RE: PZEM-004T With A6 on Serial - by Techno - 09-12-2024, 05:52 PM
RE: PZEM-004T With A6 on Serial - by admin - 09-13-2024, 12:11 AM

Forum Jump:


Users browsing this thread:
1 Guest(s)