QSB36

Query SunnyBoy 3.6 inverter for current output in watts, total yield and other information via the inverter's internal web interface.

Note:

Example

iex> {:ok, session} = QSB36.user_login("192.168.1.90", "password_for_user_group")
{:ok, %QSB36.Session{host: "192.168.1.90", sid: "mOi0Eg_N4kaNhg_R"}}

iex> QSB36.device_info(session)
{:ok, {"SB3.6-1AV-40 231", 1234567890}}

iex> QSB36.health_status(session)                      
{:ok, {307, :ok}}

iex> QSB36.current_time(session)
{:ok, {1584382357, 0}}

iex> QSB36.current_watts(session)
{:ok, 262}

iex> QSB36.total_yield(session)
{:ok, 3388801}

iex> QSB36.yield_daily(session, 1584309600, 1584410400) 
{:ok, [{1584316800, 3356183}, {1584403200, 3370444}]}

iex> QSB36.yield_5min(session, 1584316800, 1584403200)  
{:ok,                    
  [                       
    {1584316800, 3356183},
    ...
    {1584403200, 3370444}
  ]
}

iex> QSB36.logout(session)
:ok

Installation

Add qsb36 to your list of dependencies in mix.exs:

def deps do
  [
    {:qsb36, "~> 0.1.0"}
  ]
end

The docs can be found at https://hexdocs.pm/qsb36.