Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Berger committed Jun 26, 2024
1 parent e714dac commit bee919c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 11 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/esphome_compilation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,12 @@ jobs:
- name: Create secrets file
run: |
echo "wifi_ssid: \"my_wifi_ssid\"" > secret.yaml
echo "wifi_password: \"my_wifi_password\"" >> secret.yaml
echo "solar_router_ota_password: \"my_solar_router_ota_password\"" >> secret.yaml
echo "api_encryption_key: \"my_api_encryption_key\"" >> secret.yaml
echo "wifi_ssid: \"my_wifi_ssid\"" > secrets.yaml
echo "wifi_password: \"my_wifi_password\"" >> secrets.yaml
echo "solar_router_ota_password: \"my_solar_router_ota_password\"" >> secrets.yaml
echo "api_encryption_key: \"my_api_encryption_key\"" >> secrets.yaml
echo "hotspot_password: \"my_hotspot_password\"" >> secrets.yaml
- name: Compile esp32-proxy-client.yaml
continue-on-error: true
Expand Down
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

0 comments on commit bee919c

Please sign in to comment.