yangqian / hass-cozylife

third party cozylife integration
MIT License
53 stars 12 forks source link

Cozylife platform integration #8

Open ddean6232 opened 8 months ago

ddean6232 commented 8 months ago

I use the getconfig.py and got this:

$ python getconfig.py 192.xxx.xxx.1 192.xxx.xxx.253
IP scan from 192.xxx.xxx.1, end with 192.xxx.xxx.253
light:
- platform: cozylife
  lights:
  - ip: 192.xxx.xxx.118
    did: 69333560acd82913d7cf
    pid: p93sfg
    dmn: Smart Bulb Light
    dpid: [1, 2, 3, 4, 5, 7, 8, 9, 13, 14]
switch:
- platform: cozylife
  switches:

copy into configuration.yaml and got this...

Logger: homeassistant.components.websocket_api.http.connection
Source: components/websocket_api/commands.py:230
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 4:11:36 AM (1 occurrences)
Last logged: 4:11:36 AM

[139961059280832] The system cannot restart because the configuration is not valid: Platform error switch.cozylife - Integration 'cozylife' not found. Platform error light.cozylife - Integration 'cozylife' not found.
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 230, in handle_call_service
    await hass.services.async_call(
  File "/usr/src/homeassistant/homeassistant/core.py", line 2035, in async_call
    response_data = await coro
                    ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/core.py", line 2072, in _execute_service
    return await target(service_call)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 986, in admin_handler
    await result
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/__init__.py", line 191, in async_handle_core_service
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: The system cannot restart because the configuration is not valid: Platform error switch.cozylife - Integration 'cozylife' not found.
Platform error light.cozylife - Integration 'cozylife' not found.

Tried to find an integration for cozylife but nothing in HASS What am I missing?

ddean6232 commented 8 months ago

NVM... solved

kozfelipe commented 7 months ago

I know that sounds dumb but it took me some time to figure out I needed a Terminal addon to run python over HAOS and the device has to be IP reserved in router. Could you please add this to README.md

to replace the bolt buttons with toggle switch I added this to my configuration.yaml

homeassistant:
  customize:
    light.cozylife_272d:
        assumed_state: false
ddean6232 commented 7 months ago

I use HA on a proxmox LXC container so I have access to the OS for running the getconfig.py. My problem was that the plugin did not get installed into the custom_components directory properly. It has been running flawlessly since I correct the directory install error. Not sure what you mean by "bolt button"

ddean6232 commented 7 months ago

Thanks @yangqian for all your work. If you need some help to further the development let me know.