fix(deye): transmit solarEnergyDay as watt_hours
All checks were successful
Build / build (push) Successful in 3m24s

This commit is contained in:
Daniel Kempkens 2024-07-16 17:44:39 +02:00
parent 2350a7859d
commit 495723fb32
Signed by: daniel
SSH key fingerprint: SHA256:Ks/MyhQYcPRQiwMKLAKquWCdCPe3JXlb1WttgnAoSeM

View file

@ -87,7 +87,13 @@ defmodule WeewxProxy.Modbus.Deye do
defp handle_reading("deye/day_energy", reading, {:active, active}) do
timestamp = DateTime.utc_now() |> DateTime.to_unix()
data = %{dateTime: timestamp, solarEnergyDay: reading, solarEnergyActive: active}
data = %{
dateTime: timestamp,
solarEnergyDay: reading * 1000.0,
solarEnergyActive: active
}
:ok = Publisher.publish("weewx/ingest_si", data)
nil
@ -99,7 +105,13 @@ defmodule WeewxProxy.Modbus.Deye do
defp handle_reading("deye/ac/active_power", reading, {:day, day}) do
timestamp = DateTime.utc_now() |> DateTime.to_unix()
data = %{dateTime: timestamp, solarEnergyDay: day, solarEnergyActive: reading}
data = %{
dateTime: timestamp,
solarEnergyDay: day * 1000.0,
solarEnergyActive: reading
}
:ok = Publisher.publish("weewx/ingest_si", data)
nil