diff --git a/lib/weewx_proxy/modbus/deye.ex b/lib/weewx_proxy/modbus/deye.ex index d4857bf..1506ad9 100644 --- a/lib/weewx_proxy/modbus/deye.ex +++ b/lib/weewx_proxy/modbus/deye.ex @@ -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