Coder Social home page Coder Social logo

homeassistant-control4's Introduction

homeassistant-control4

This plugin for home assistant allows you to control your control4 devices using Home Assistant. This plugin is very early state and right now only supports lights/dimmers and thermostat.

How To:

Known Issues:

  • Changing thermostat mode is not working. Only temperature control

Sample Home Assistant Config:

For lights:

light:
  - platform: control4
    base_url: 'http://192.168.1.142:9000/'
    proxy_id: 25
    name: Bedroom
    scan_interval: 10

For thermostat:

climate:
  - platform: control4
    base_url: 'http://192.168.1.142:9000/'
    proxy_id: 36
    name: Top Floor
    scan_interval: 10

homeassistant-control4's People

Contributors

itsfrosty avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

homeassistant-control4's Issues

Climate component - hardcoded IP address in async_set_hvac_mode?

@asyncio.coroutine
def async_set_hvac_mode(self, hvac_mode):
url_str = 'http://192.168.86.152:8080/'
if self._proxy_id == 36:
url_str = url_str + 'ThreeMode'
else:
url_str = url_str + 'TwoMode'
if hvac_mode == HVAC_MODE_HEAT:
self._current_operation = HVAC_MODE_HEAT
self._enabled = True
url_str = url_str + 'Heat'
elif hvac_mode == HVAC_MODE_COOL:
self._current_operation = HVAC_MODE_COOL
self._enabled = True
url_str = url_str + 'Cool'
elif hvac_mode == HVAC_MODE_AUTO:
self._current_operation = HVAC_MODE_AUTO
self._enabled = True
url_str = url_str + 'Auto'
elif hvac_mode == HVAC_MODE_OFF:
self._current_operation = HVAC_MODE_OFF
self._enabled = False
url_str = url_str + 'Off'
websession = async_get_clientsession(self.hass)
request = None
with async_timeout.timeout(TIMEOUT, loop=self.hass.loop):
request = yield from websession.get(url_str)
return

I was just wondering, what is this code supposed to do? Since there's a hardcoded IP address, how would a user use this component to change the HVAC mode on their Control4 system on a different IP?

Not working with Home Assistant 2023.8.3

See title.

`Unexpected exception importing platform custom_components.control4b.light
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 833, in get_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 850, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_components/control4b/light.py", line 43, in
@asyncio.coroutine
^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'
2023-08-20 17:34:53.445 ERROR (MainThread) [homeassistant.config] Platform error: light
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/loader.py", line 833, in get_platform
cache[full_name] = self._import_platform(platform_name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 850, in _import_platform
return importlib.import_module(f"{self.pkg_path}.{platform_name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "", line 1204, in _gcd_import
File "", line 1176, in _find_and_load
File "", line 1147, in _find_and_load_unlocked
File "", line 690, in _load_unlocked
File "", line 940, in exec_module
File "", line 241, in _call_with_frames_removed
File "/config/custom_components/control4b/light.py", line 43, in
@asyncio.coroutine
^^^^^^^^^^^^^^^^^
AttributeError: module 'asyncio' has no attribute 'coroutine'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config.py", line 924, in async_process_component_config
platform = p_integration.get_platform(domain)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/loader.py", line 842, in get_platform
raise ImportError(
ImportError: Exception importing custom_components.control4b.light`

Errors in HomeAssistant plugin?

Hi,

I've got things running and it does switch my lights, but I'm not able to get the brightness controls working. I do seem to get an error within HomeAssistant related to the control4 python component.

This was in Homeassistant 0.74 and 0.75 and with Control4 2.9.1.

I'm not discounting issues within my my HomeAssistant configuration, but figured I'd ask for help.

light.theatre is as per guide, proxy found using the same code provided.

Thanks in advance

Log Details (ERROR)
Sun Aug 05 2018 18:46:57 GMT+1000 (AEST)

Update for light.theatre fails
Traceback (most recent call last):
File "/config/custom_components/light/control4.py", line 135, in async_update
request = yield from websession.get(url)
File "/usr/local/lib/python3.6/site-packages/aiohttp/client.py", line 387, in _request
await resp.start(conn)
File "/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py", line 748, in start
message, payload = await self._protocol.read()
File "/usr/local/lib/python3.6/site-packages/aiohttp/streams.py", line 533, in read
await self._waiter
aiohttp.client_exceptions.ServerDisconnectedError: None

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 199, in async_update_ha_state
yield from self.async_device_update()
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py", line 320, in async_device_update
yield from self.async_update()
File "/config/custom_components/light/control4.py", line 137, in async_update
except (asyncio.TimeoutError, aiohttp.errors.ClientError):
AttributeError: module 'aiohttp' has no attribute 'errors'

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.