dlarrick / pykumo

Python library to interact with Mitsubishi KumoCloud devices via their local API
MIT License
35 stars 12 forks source link

Error from basic query call #42

Closed batesenergy closed 1 year ago

batesenergy commented 1 year ago

Hi All,

I'm having difficulty with my understanding the documentation. Looking to get data from all units for logging purposes. I am able to connect and get the indoor units serial #'s. When I try to formulate this request as in the documentation:

query = '{"c":{"indoorUnit":{"status":{}}}}'.encode('utf-8') unit._request(query)

and get this response

line 67, in _request url = "http://" + self._address + "/api"


TypeError: can only concatenate str (not "NoneType") to str

I'm pretty sure i'm missing something in my query formulation. Any help appreciated.

Thanks
dlarrick commented 1 year ago

I think you didn't successfully get information from the KumoCloud service. the _address field should be the unit's IP address. It gets set by the KumoCloudAccount object when it creates the unit object.

batesenergy commented 1 year ago

Yes its interesting. I authenticate and get the serial numbers of the indoor units just fine. But when I run:

kumos = account.make_pykumos()

Exception fetching {"c":{"indoorUnit":{"status":{}}}}: can only concatenate str (not "NoneType") to str 1st Floor: Error retrieving status from {'r': {}}: 'indoorUnit' Exception fetching {"c":{"indoorUnit":{"status":{}}}}: can only concatenate str (not "NoneType") to str 2nd Floor: Error retrieving status from {'r': {}}: 'indoorUnit'

The indoor unit names are correct no other data is included, hence the error? Is anyone else experiencing this issue?

dlarrick commented 1 year ago

I am making an update to log a clearer error in this case. There's really nothing it can do without an IP address, and known deficiencies in the Kumo server ecosystem can cause it to not get an address.