GithubHelp home page GithubHelp logo

Comments (8)

RobHofmann avatar RobHofmann commented on July 28, 2024

Do you have simplejson installed? Im running HASSIO so it gets fixed automatically (if I recall correctly). I think you need to install modules on hassbian.

Let me know :)

from homeassistant-greeclimatecomponent.

omribenami avatar omribenami commented on July 28, 2024

from homeassistant-greeclimatecomponent.

omribenami avatar omribenami commented on July 28, 2024

hi.
installed simplejson and running python 3.5.3
unfortunatly no good news :(

Traceback (most recent call last):
File "/srv/homeassistant/lib/python3.5/site-packages/homeassistant/helpers/entity_platform.py", line 126, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/lib/python3.5/asyncio/tasks.py", line 400, in wait_for
return fut.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 293, in result
raise self._exception
File "/usr/lib/python3.5/asyncio/tasks.py", line 239, in _step
result = coro.send(None)
File "/usr/lib/python3.5/asyncio/coroutines.py", line 210, in coro
res = func(*args, **kw)
File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 113, in async_setup_platform
GreeClimate(hass, name, ip_addr, port, mac_addr, min_temp, max_temp, target_temp, target_temp_step, temp_sensor_entity_id, operation_list, fan_list, swing_updn_mode_list, default_operation, default_fan_mode, default_operation_from_idle, default_swing_updn_mode, encryption_key, uid)
File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 152, in init
self._encryption_key = self.GetDeviceKey().encode("utf8")
File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 220, in GetDeviceKey
return self.FetchResult(cipher, self._ip_addr, self._port, jsonPayloadToSend)['key']
File "/home/homeassistant/.homeassistant/custom_components/gree/climate.py", line 192, in FetchResult
receivedJson = simplejson.loads(data)
File "/usr/lib/python3.5/json/init.py", line 312, in loads
s.class.name))
TypeError: the JSON object must be str, not 'bytes'

from homeassistant-greeclimatecomponent.

RobHofmann avatar RobHofmann commented on July 28, 2024

Hi, im not sure why this is going wrong. Maybe, if possible, you can switch to HASSIO? All dependencies will be fixed for you in that distro.

Unfortunately I dont have a test-setup with hassbian available.

from homeassistant-greeclimatecomponent.

srozb avatar srozb commented on July 28, 2024

Hi, looks like recvfrom method returns bytes type as described here, and simplejson.loads method expects string. Perhaps decode() will solve that.

from homeassistant-greeclimatecomponent.

RobHofmann avatar RobHofmann commented on July 28, 2024

@omribenami can you try the suggestion from @srozb and let us know?

from homeassistant-greeclimatecomponent.

omribenami avatar omribenami commented on July 28, 2024

guys with a help of a friend i got it fixed... it turned out to be like rob said... a lack of Simplejson..ive installed it on PIP command instead of PIP3... i still got an time out error because climate.py couldnt fetch the encryption keys but i extracted them myself and now its fully working. tnx for the help you guys and tnx for effort bringing gree to HA Rob!!

from homeassistant-greeclimatecomponent.

RobHofmann avatar RobHofmann commented on July 28, 2024

Glad to hear! Enjoy.

from homeassistant-greeclimatecomponent.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.