Skip to content

Commit

Permalink
ci: Update example configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Berger committed Jun 26, 2024
1 parent 3577d3f commit 2fa09db
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 31 deletions.
31 changes: 20 additions & 11 deletions esp32-proxy-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ esp32:

# Enable logging
logger:
baud_rate: 0
baud_rate: 115200
level: INFO
logs:
component: ERROR
Expand Down Expand Up @@ -66,17 +66,26 @@ substitutions:
green_led_pin: GPIO19
yellow_led_pin: GPIO18

# Uncomment the following lines if you want to use the source from github
# packages:
# power_meter:
# url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
# file: solar_router/power_meter_proxy_client.yaml
# refresh: 5s
# regulator:
# url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
# file: solar_router/regulator_triac.yaml
# refresh: 5s
# solar_router:
# url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
# file: solar_router/solar_router_engine.yaml
# refresh: 5s

# Remove the following lines if you want to use the source from github
packages:
power_meter:
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
file: solar_router/power_meter_proxy.yaml
refresh: 5s
<<: !include solar_router/power_meter_proxy_client.yaml
regulator:
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
file: solar_router/regulator_triac.yaml
refresh: 5s
<<: !include solar_router/regulator_triac.yaml
solar_router:
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
file: solar_router/solar_router_engine.yaml
refresh: 5s

<<: !include solar_router/solar_router_engine.yaml
31 changes: 21 additions & 10 deletions esp32-standalone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,29 @@ substitutions:
green_led_pin: GPIO19
yellow_led_pin: GPIO18


# Uncomment the following lines if you want to use the source from github
# packages:
# power_meter:
# url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
# file: solar_router/power_meter_fronius.yaml
# refresh: 5s
# regulator:
# url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
# file: solar_router/regulator_triac.yaml
# # file: solar_router/regulator_relay.yaml
# refresh: 5s
# solar_router:
# url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
# file: solar_router/solar_router_engine.yaml
# refresh: 5s

# Remove the following lines if you want to use the source from github
packages:
power_meter:
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
file: solar_router/power_meter_fronius.yaml
refresh: 5s
<<: !include solar_router/power_meter_fronius.yaml
regulator:
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
file: solar_router/regulator_triac.yaml
# file: solar_router/regulator_relay.yaml
refresh: 5s
<<: !include solar_router/regulator_triac.yaml
solar_router:
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
file: solar_router/solar_router_engine.yaml
refresh: 5s
<<: !include solar_router/solar_router_engine.yaml

14 changes: 7 additions & 7 deletions esp8266-proof-of-concept.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@ logger:
# Enable Home Assistant API
api:
encryption:
key: !secret api_key
key: !secret api_encryption_key

ota:
- platform: esphome
password: !secret ota_password
password: !secret solar_router_ota_password

# Define wifi connection
wifi:
Expand Down Expand Up @@ -157,6 +157,7 @@ http_request:
timeout: 10s
esp8266_disable_ssl_support: True
id: http_request_data
verify_ssl: False

# ----------------------------------------------------------------------------------------------------
# Define scripts for power collection or energy regulation
Expand All @@ -172,14 +173,13 @@ script:
then:
- http_request.get:
url: http://${fronius_inverter_ip_address}/solar_api/v1/GetMeterRealtimeData.cgi
headers:
Content-Type: application/json
verify_ssl: False
capture_response: true
on_response:
then:
- lambda: |-
json::parse_json(id(http_request_data).get_string(), [](JsonObject data) {
id(real_power).publish_state(data["Body"]["Data"]["0"]["PowerReal_P_Sum"].as< float >());
json::parse_json(body, [](JsonObject root) -> bool {
id(real_power).publish_state(root["Body"]["Data"]["0"]["PowerReal_P_Sum"].as< float >());
return true;
});
# Manage energy regulation
Expand Down
10 changes: 8 additions & 2 deletions esp8285-power-meter-proxy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ globals:
type: int
initial_value: "1"

# Uncomment the following lines if you want to use the source from github
# packages:
# power_meter:
# url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
# file: solar_router/power_meter_fronius.yaml

# Remove the following lines if you want to use the source from github
packages:
power_meter:
url: https://github.com/XavierBerger/Solar-Router-for-ESPHome/
file: solar_router/power_meter_fronius.yaml
<<: !include solar_router/power_meter_fronius.yaml

http_request:
esp8266_disable_ssl_support: True
2 changes: 1 addition & 1 deletion solar_router/power_meter_proxy_client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ script:
then:
- lambda: |-
json::parse_json(body, [](JsonObject root) -> bool {
id(real_power).publish_state(data["value"].as< float >());
id(real_power).publish_state(root["value"].as< float >());
return true;
});
Expand Down

0 comments on commit 2fa09db

Please sign in to comment.