Giter Site home page Giter Site logo

bigbadblunt / homeassistant-lightwave2 Goto Github PK

View Code? Open in Web Editor NEW
41.0 16.0 11.0 378 KB

Lightwave RF custom component for Home Assistant. Requires generation 2 ("Link Plus") hub, but will control both generation 1 ("Connect Series") and generation 2 ("Smart Series") devices.

Python 100.00%
lightwave home-assistant homeassistant home-automation lightwaverf

homeassistant-lightwave2's Introduction

Note: This repo is receiving minimal maintenance - a new version is here

Lightwave2

Home Assistant (https://www.home-assistant.io/) component for controlling LightwaveRF (https://lightwaverf.com) devices with use of a Lightwave Link Plus hub. Controls both generation 1 ("Connect Series") and generation 2 ("Smart Series") devices. Does not work with gen1 hub.

Setup

There are two ways to set up:

1. Using HACS (preferred)

This component is available through the Home Assistant Community Store HACS (https://hacs.netlify.com/)

If you use this method, your component will always update to the latest version. But you'll need to set up HACS first.

2. Manual

Copy all files and folders from custom_components/lightwave2 to a <ha_config_dir>/custom_components/lightwave2 directory. (i.e. you should have <ha_config_dir>/custom_components/lightwave2/__init__.py, <ha_config_dir>/custom_components/lightwave2/switch.py, <ha_config_dir>/custom_components/lightwave2/translations/en.json etc)

The latest version is at https://github.com/bigbadblunt/homeassistant-lightwave2/releases/latest

If you use this method then you'll need to keep an eye on this repository to check for updates.

Configuration:

In Home Assistant:

  1. Enter configuration menu
  2. Select "Integrations"
  3. Click the "+" in the bottom right
  4. Choose "Lightwave 2"
  5. Enter username and password
  6. This should automatically find all your devices

Usage:

Once configured this should then automatically add all switches, lights, thermostats, blinds/covers, sensors and energy monitors that are configured in your Lightwave app. If you add a new device you will need to restart Home Assistant, or remove and re-add the integration.

Various sensor entities (including power consumption) and controls for the button lock and status LED are exposed within the corresponding entities.

All other attributes reported by the Lightwave devices are exposed with the names lwrf_*. These are all read-only.

For gen2 devices, the brightness can be set without turning the light on using lightwave2.set_brightness.

Firmware 5+ devices generate lightwave2.click events when the buttons are pressed. The "code" returned is the type of click:

Code Hex Meaning
257 101 Up button single press
258 102 Up button double press
259 103 Up button triple press
260 104 Up button quad press
261+ (and so on - I believe up to 20x click is supported)
512 200 Up button press and hold
768 300 Up button release after long press
4353 1101 Down button single press
4354 1102 Down button double press
4355 1103 Down button triple press
4356 1104 Down button quad press
4357+ (and so on)
4608 1200 Down button press and hold
4864 1300 Down button release after long press

For sockets the codes are the "up button" versions.

There are further service calls:

lightwave2.reconnect: Force a reconnect to the Lightwave servers (only for non-public API, has no effect on public API) lightwave2.whdelete: Delete a webhook registration (use this if you get "Received message for unregistered webhook" log messages) lightwave2.update_states: Force a read of all states of devices

Thanks

Credit to Warren Ashcroft whose code I used as a base https://github.com/washcroft/LightwaveRF-LinkPlus

homeassistant-lightwave2's People

Contributors

bigbadblunt avatar ikb42 avatar robcos avatar uvjim avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

homeassistant-lightwave2's Issues

"HomeKit Accessory Protocol"

Hi again,

I have now got your integration working and find that a HA integration for Lightwave Link Plus has also shown itself. I attach the image below.

I don't know much about HA etc. as yet, and I almost hate to bring this up as this integration may be seen as a rival to yours. But as it has now suddenly shown itself, would it be useful in any way? I.e. perhaps it complements the functionality of your integration in some way?

I don't want to install it just because it has appeared, as it may equally interfere with your HACS integration.

I do not have any Apple or Homekit products apart from this link plus hub. From what I have understood from the documentation for Homekit Accessory Protocol, it can be added to HA only if it is not already paired with an Apple device via HomeKit.

Have you had a look at it by chance?

image

Toggle vs dimmer

Thanks for this awesome plugin @bigbadblunt been working great for 6 months. I've just upgraded my switches to v5 of the firmware and for some reason the light entities have changed. Some stayed as dimmers and others have changed to a toggle switch. Without wiping the database and starting over I wanted to check with you to see if there is a way to reset individual devices to dimmers at the entity level.

This example is from the same two throw single gang switch

image

API error using set_led_rgb

API error 'LWRF2Light' object has no attribute 'ledrgb' when trying to use set_led_rgb.
It occurs from v3.5.3 to v3.5.6, working correctly on v3.5.1

Logger: homeassistant.components.websocket_api.http.connection
Source: custom_components/lightwave2/light.py:150
Integration: Home Assistant WebSocket API (documentation, issues)
First occurred: 12:20:59 (4 occurrences)
Last logged: 12:21:01

[140466948796576] 'LWRF2Light' object has no attribute 'ledrgb'
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 185, in handle_call_service
await hass.services.async_call(
File "/usr/src/homeassistant/homeassistant/core.py", line 1495, in async_call
task.result()
File "/usr/src/homeassistant/homeassistant/core.py", line 1530, in _execute_service
await handler.job.target(service_call)
File "/config/custom_components/lightwave2/init.py", line 36, in service_handle_led
await ent.async_set_rgb(led_rgb=rgb)
File "/config/custom_components/lightwave2/light.py", line 150, in async_set_rgb
await self._lwlink.async_set_led_rgb_by_featureset_id(self._featureset_id, self.ledrgb)
AttributeError: 'LWRF2Light' object has no attribute 'ledrgb'

Removed devices not marked "unavailable"

Hi. I've been getting my Lightwave system setup and had to swap out a few switches. Consequently I now have some devices which are no longer in my home and have no entity but still show up under devices. Apparently if these are marked as "unavailable" then HA will show the delete button to remove them. I am assuming that the integration is not marking them as unavailable as I have no delete button. Please could you advise?

Lightwave heating devices showing up incorrectly (Lightwave L92 and Honeywell HR91 / DTS92E)

Hi!

I'm an experienced programmer (Java/Javascript mostly, but I just about know my way around Python) and I've been adding home automation systems for about a decade now. I'm about 6 months into my Lightwave journey with lots of devices and have just added Home Assistant to get a better control plane and create more advanced automation logic. I also don't like my usage data being locked up in the Lightwave (and many other) apps.

I've been getting on pretty well with lighting and power sockets, your custom component pulled them all in brilliantly. Thanks for sharing - it's really done a bunch of the work for me already!

However, I have come unstuck with using the Lightwave heating devices in Home Assistant. I'm fairly new to Home Assistant, and am happy to contribute (but will need a bit of support to make any PR useful).

Relevant Devices

I have a bunch of radiators in my property, each fitted with a Honeywell TRV (HR91). My central heating system is zoned into 3 loops, each individually controlled by a Smart Heating Switch (L92). I also have a couple of Honeywell Home Wireless Thermostats (DTS92E) for some rooms with underfloor heating.

I have connected them all appropriately within a Lightwave automation to call for heat, which is pretty functional. However the Lightwave App is really restricted. So if I have 10 TRVs connected to a L92, it's very tedious to work out which TRVs are causing the heating to be on - as you have to go into each room and drill into the TRV to find out if it's actively calling-for-heat or not. So, dragging all that information into Home Assistant will enable me to create a better control plane.

Notably, the devices are appearing in Home Assistant in an incorrect / illogical manner.

Representation in the Lightwave App

HR91

Within the Lightwave App the HR91s show:

  • Temperature (degrees centigrade to 1dp)
  • Valve open status (percentage)
  • Battery (percentage)

With two control tabs:

  • Target Temperature Slider (degrees centigrade to 1dp)
  • "State" (binary) with text reading "Setting the state to 'off' will cause the device to target 5 degrees. Setting the state to 'on' will cause the device to target 21 degrees" ... these are universally off on my TRVs

L92

Within the Lightwave App the L92s show:

  • Temperature (degrees centigrade to 1dp) - around the L92, not that useful to me as it's sat next to my boiler!
  • Humidity (percentage to 1dp)
  • Watts consumption
  • kWattHours total

With 4 control tabs:

  • "State" (binary) - for manually turning the heating control on/off, useful for my hot water circulator and hot water heater, but not so much for central heating which is driven by the heat demand from the TRVs
  • Target (degrees centigrade to 1dp) - not useful to me, as it's set against the temperature of the L92
  • Boost (binary I presume) - not used this yet, I just see "setup boost function"
  • Lock (binary) - disables the hardware controls for the L92

DTS92E

I also have two Honeywell Home Wireless Thermostats (DTS92E) which show up in the app:

  • Temperature (degrees centigrade to 1dp)
  • Battery (percentage)

With one control tab:

  • Target Temperature Slider (degrees centigrade to 1dp)

Representation in Home Assistant

HR91

If I go to Configuration > Devices then I can see all my TRVs - although they show the model up as HR92 rather than HR91. It does not show the battery level, just a dash. When I click into the device, it shows me a single item under Entities marked Closed and if I drill down again, I see it has the entity ID of binary_sensor.office_trv.

L92

If I go to Configuration > Devices then I can see all my L92s, with the correct model, no battery (as it's wired that's fine), with 4 entities:

  • switch.central_heating_l92
  • sensor.central_heating_l92_current_consumption
  • lock.central_heating_l92_lock
  • sensor.central_heating_l92_total_consumption

Missing is humidity, current temperature, target temperature, or anything related to boost (which might be as I've not set boost up).

DTS92E

I am unable to find anything under Devices or Entities which looks like the thermostats, nor anything with the name thermostat (as they're named in the Lightwave app). They were only added in the last 24 hours, I'm not sure if they would appear automatically.

# Finally - the request!

Hopefully the above context helps. From what little I've picked up about Lightwave's web socket data structure, Home Assistant's API and what your custom component is doing, it seems like:

  • The HR91 is being given only a single binary_sensor entity, which I guess represents the "State" (that is always off for me) and needs expanding for the other 4 entities.
  • The L91s have 4 of the entities already, but are missing humidity, current temperature, target temperature, or anything related to boost.
  • The DTS92Es aren't being detected at all for some reason (which might be because I need to update/refresh something for them to appear).

With some tips I'm up for helping out - to do so, some hints on where to start in the cod, how to deploy a development version (I'm currently using HACS), and what the dev/debug loop looks like, would all be of great help!

Alternatively, if it's something easy to change, perhaps with a bit more information from me, I'll happily provide.

Warning got since update to HA Core 2021.3.2

Got the warning below in logs after updating to latest version HA Core 2021.3.2.

2021-03-07 15:46:09 WARNING (MainThread) [homeassistant.loader] No 'version' key in the manifest file for custom integration 'lightwave2'. This will not be allowed in a future version of Home Assistant. Please report this to the maintainer of 'lightwave2

Changing name in Lightwave App does not pull through

Hi Again!

I've recently zoned my central heating piping and turned my single L92 Smart Switches into a triple to control the zones independently. This means I've renamed my "Central Heating L92" in the app to "Upstairs Heat L92" and added new "Downstairs Left Heat L92" and "Downstairs Right Heat L92" devices. Initially they didn't show up, but after a restart of Home Automation they did - however the renamed one remains "Central Heating L92" throughout (the entity system name is still "climate.central_heating_l92").

I've found a "Friendly Name" property on the entity, but it doesnt seem to have updated along with the app.

Screenshot 2021-11-18 at 22 14 52

I'm thinking the solution to clean up the entity system name will need to be to unpair it from the Lightwave system and repair it with the new name, but I think the updated Friendly Name should certainly pull through.

Flicker on switching on gen 2 switches

I have just installed this and it works fine. However, on switching on any gen 2 switch, as the led on the switch itself (not the light bulbs) changes colour to indicate it is on, it flickers between the colours for on, off, on. This doesn't happen when I switch the same switches on using either the Lightwave app, Alexa app or a previous instance of openhab that I ran. Just wondering if there is a minor bug somewhere that is causing multiple instructions to be sent perhaps?

Would gladly look for the bug myself but I'm afraid I don't know where to start.

New error

Hi.

Firstly thanks for the plugin

It’s been working perfectly for sometime! I’d be lost without it and actually I am! The last few days (no changes or updated to my home assistant) the entities stop showing up. This shows in the log

homeassistant.setup] Error during setup of component lightwave2
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/setup.py", line 145, in _async_setup_component
hass, processed_config)
File "/config/custom_components/lightwave2.py", line 32, in async_setup
await link.async_get_hierarchy()
File "/config/deps/lib/python3.6/site-packages/lightwave2/lightwave2.py", line 179, in async_get_hierarchy
await self._async_read_groups(group_ids)
File "/config/deps/lib/python3.6/site-packages/lightwave2/lightwave2.py", line 221, in _async_read_groups
y.features[x["attributes"]["type"]] = [x["featureId"], x["attributes"]["value"]]
KeyError: 'value'

Appreciate any help! Desperate to have this working again!

Power/Energy sensors/statistics stopped working after v3.5.1

I'm using the following products:

  • L24 (4-gang light switch)
  • L22 (2-gang light switch)
  • L21 (1-gang light switch)
  • LW600 (clamp energy sensor)

With version v3.5.1 I get a "total consumption" and "current consumption" entity for each device, i.e. 4 total and 4 current for the 4-gang L24 switch.

With version v3.5.3 or v3.5.6 installed those entities become unavailable .

I found the following error in my logs (v3.5.6):

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 304, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 128, in async_setup_entry
    return await component.async_setup_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 149, in async_setup_entry
    platform = await async_prepare_setup_platform(
  File "/usr/src/homeassistant/homeassistant/setup.py", line 334, in async_prepare_setup_platform
    platform = integration.get_platform(domain)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 532, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 537, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/custom_components/lightwave2/sensor.py", line 13, in <module>
    SensorEntityDescription(
TypeError: __init__() got an unexpected keyword argument 'entity_category'

Can't get lightwave2 to show in integrations

Im very new at Home Assistant. Currently running on a Pi2 just playing with it to see if it will do what I want whilst I await my Pi4 delivery.

I've managed to install HACS, gone into that on Home Assistant, installed the Lightwave2 intigration in HACS, checked it has actually put files in custom_components but despite restarts and clearing cache on browser for the life of me I can't get the Lightwave2 integration to appear to install it.

Am I being super dense? Do i need to have installed something else first to get it to work?

Help!!

Attribute state update for button multi press

Idea was to be able use multiple press of buttons to trigger automation but attribute state dose not update properly to trigger automation.

platform: state entity_id: light.dining_light_led attribute: lwrf_uiButtonPair for: hours: 0 minutes: 0 seconds: 1 milliseconds: 0 to: '4354'

4353 single press down
4354 double press down
And so on

Expose "Set Brightness"

It would be nice to be able to set the brightness of a light without turning it on.
This can be useful in automations like "at 10pm, set bathroom light brightness to 20%" so that when I go for a pee I don't get blinded in the middle of the night.
I poked with the code and saw that this should be possible with lightwave, which is a feature not available otherwise with many other light integrations.

You don't have any statistics

I have a LW600 and it’s not showing in the drop down, only get the following message - You don't have any statistics, reading in to it get the following info.

You’re configuring a statistic but you couldn’t find your source in the dropdown? That’s caused by a bug in the integration providing the entity. Integrations need to configure their entities correctly so Home Assistant knows that we need to track statistics for it and how.

Open an issue with the author of the integration and link them to https://developers.home-assistant.io/docs/core/entity/sensor#long-term-statistics.

Error regarding climate

Hi

I’m not using Lightwave for heating in any way, but since the latest update I’m getting this error on startup

It doesn’t seen to be affecting anything but I’d like to stop it if possible?

Log Details (ERROR)
Fri Oct 18 2019 22:44:39 GMT+0100 (BST)

Unable to prepare setup for platform climate.lightwave2: Platform not found

Feature request: Detect button presses on dimmer devices

With the new version 5 firmware for dimmers, automations can be triggered directly with button presses - both on and off button can trigger different things. Is it possible to observe those via the API and for the integration to make them available to Home Assistant?

version fix

In the latest build of home assistant the plugin is disabled because the version in the manifest isn't right

2021-05-23 21:22:52 ERROR (MainThread) [homeassistant.loader] The custom integration 'lightwave2' does not have a valid version key (3.2.1beta2) in the manifest file and was blocked from loading. See https://developers.home-assistant.io/blog/2021/01/29/custom-integration-changes#versions for more details

The manifest.json file now has added support for a version key. The version should be a string with a major, minor and patch version. For example, "1.0.0". This version will help users communicate with you the version they had issues with. And if you ever find a security issue with your custom integration, Home Assistant will be able to block insecure versions from being used. The version key is required from Home Assistant version 2021.6

Integration keeps failing

Please describe your issues here.

Ideally provide output from homeassistant.log, preferably with additional logging enabled.

To enable additional logging, add the following to configuration.yaml

logger:
default: warning
logs:
lightwave2.lightwave2: debug
custom_components.lightwave2: debug

[INFO] Local Control API

Hi @bigbadblunt

I have written/maintain an openhab integration for lightwave and thought this may be of interest:

I again contacted lightwave regarding a local api, this time to be told that it is in development stage, but new product lineups for 2021 are taking priority at present.

so watch this space.. finally.. we may actually get this 👍

Positive Feedback

I updated to the latest Lightwave2 code and it worked first time, both with my on/off switches and open/stop/close curtain controls. Thanks for all your hard work to make this easy!

Unable To Start Home Assistant During A Lightwave Outage

It appears that lightwave2 stops home assistant from booting in the event of a lightwave api outage.

These outages are very rare but I wanted to make you aware of this as It seems there is an outage at the moment.

Home assistant was working ok until I rebooted it, now checking the logs shows a lot of error messages similar to:

2019-10-06 12:34:41 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect (exception '0, message='Attempt to decode JSON with unexpected mimetype: text/html''). Waiting 120 seconds
2019-10-06 12:34:42 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect (exception '0, message='Attempt to decode JSON with unexpected mimetype: text/html''). Waiting 32 seconds
2019-10-06 12:34:43 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect (exception '0, message='Attempt to decode JSON with unexpected mimetype: text/html''). Waiting 2 seconds
2019-10-06 12:34:43 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect (exception '0, message='Attempt to decode JSON with unexpected mimetype: text/html''). Waiting 120 seconds
2019-10-06 12:34:43 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect (exception '0, message='Attempt to decode JSON with unexpected mimetype: text/html''). Waiting 4 seconds
2019-10-06 12:34:45 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect (exception '0, message='Attempt to decode JSON with unexpected mimetype: text/html''). Waiting 64 seconds
2019-10-06 12:34:45 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect (exception '0, message='Attempt to decode JSON with unexpected mimetype: text/html''). Waiting 4 seconds
2019-10-06 12:34:48 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect (exception '0, message='Attempt to decode JSON with unexpected mimetype: text/html''). Waiting 8 seconds
2019-10-06 12:34:49 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect (exception '0, message='Attempt to decode JSON with unexpected mimetype: text/html''). Waiting 8 seconds
2019-10-06 12:34:56 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect (exception '0, message='Attempt to decode JSON with unexpected mimetype: text/html''). Waiting 16 seconds
2019-10-06 12:34:58 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect (exception '0, message='Attempt to decode JSON with unexpected mimetype: text/html''). Waiting 16 seconds

Setting thermostat temperatures within automations / scripts etc

Hi,

Now we are into the colder months i'm discovering a couple of issues with my TRVs and thermostat.

For some reason I am unable to set the temperature of the thermostat within automations etc. And it keeps resetting to 13 degrees when one of my radiators come on meaning whilst it is on, it will only provide heat if the temp is below 13. (was trying to write a routine to mitigate this as if I can tell it what temp to set the thermostat at the same time it wouldn't be an issue!)

I can see temperature and lwrf_targetTemperature within the entity but am unable to set them within routines, only read them. Within the entity in Lovelace I can modify the temperature and that works perfectly but without the automation/script options I can't get all the home automation etc it to work properly and I still have to do everything manually.

Any thoughts?

The presets you did are working brilliantly.

Cheers

Ian

P.S If you need logs of particular actions let me know and ill start logging and run through a whole load of actions for you.

Power consumption

Lightwave Gen2 devices now give power readings from power sockets as well as light switches. Would it be possible to add these features?

Heating use case question

Not so much a bug with your code, but with my understanding

I have a bunch of LW gear, mostly the older Connect Series, recently upgraded to the L2 controller .. so now trying to setup my heating in HA. I have

LW921 - Thermostat
LW920 - Boiler Switch

Previously, I set the schedule in the LW921 (via older Connect App) and it controlled the LW920 to turn on/off the boiler.

Questions

  1. Do I just add all the devices within the new Smart LW App, and NO heating schedule automation, set all the scheduling within HA?
  2. Will the link between the LW921 and LW920 no longer be needed, as HA will directly connect to LW920 to turn it on/off? ie LW921 is "just" a thermostat and LW920 is "just" a switch ?

thanks
e

LW2 devices are missing

Switches are successfully added to Home Assistant, they are listed under Configuration > Entity Registry and available on Overview screen. If I toggle switches on Overview screen controls work as expected.

However none of the LW2 switches appear under Configuration > Devices. And I guess because of this there is no way to target an LW2 device in automations.

Am I missing something obvious or is this a limitation of this library ? I am trying to trigger a LW2 switch through automations, is there another way of doing it without targeting it as a device ?

Versions
Home Assistant: 0.101.3
homeassistant-lightwave2 : Current master

Lightwave login failure (I think)

Hi,

Firstly: thanks for setting all of this up. I'm really looking forward to using it!

I've just set up an RPI4 with HA and the first thing I wanted to install was Lightwave 2. I had a few issues getting it there. Like one other I had a problem with it being listed in the HA Integrations, but finally it showed up. So almost there!

Perhaps the last hurdle is the fact that I can't achieve authentication with the Lightwave server. I have put in the debug code and find the below in the logs- I found a facility to generate an API token in the Lightwave Web area, but doing that doesn't seem to have helped. Can you suggest anything please?

2020-12-25 17:38:16 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-12-25 17:38:16 WARNING (MainThread) [homeassistant.loader] You are using a custom integration for lightwave2 which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant.
2020-12-25 17:38:19 DEBUG (MainThread) [lightwave2.lightwave2] Connecting to websocket
2020-12-25 17:38:20 DEBUG (MainThread) [lightwave2.lightwave2] Requesting authentication token (using username and password)
2020-12-25 17:38:20 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect (exception '0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url=URL('https://auth.lightwaverf.com/v2/lightwaverf/autouserlogin/lwapps')'). Waiting 2 seconds to retry
2020-12-25 17:38:23 DEBUG (MainThread) [lightwave2.lightwave2] Requesting authentication token (using username and password)
2020-12-25 17:38:23 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect, max_tries exceeded, aborting
2020-12-25 17:43:20 DEBUG (MainThread) [lightwave2.lightwave2] Received WSMessage(type=<WSMsgType.CLOSE: 8>, data=1000, extra='')
2020-12-25 17:43:20 DEBUG (MainThread) [lightwave2.lightwave2] Received WSMessage(type=<WSMsgType.CLOSED: 257>, data=None, extra=None)
2020-12-25 17:43:20 DEBUG (MainThread) [lightwave2.lightwave2] Websocket closed in message handler
2020-12-25 17:43:20 DEBUG (MainThread) [lightwave2.lightwave2] Connecting to websocket
2020-12-25 17:43:20 DEBUG (MainThread) [lightwave2.lightwave2] Requesting authentication token (using username and password)

Not working in HA

Have followed the manual procedure, adding the 11x files into the folder as described. Unfortunately am unable to find the Lightwave2 integration so unable to proceed. Am a newbie so just need to confirm that I have correctly completed the procedure.

Since this mornings update and restart

Logger: homeassistant.config_entries
Source: custom_components/lightwave2/init.py:102
First occurred: 1:30:25 PM (1 occurrences)
Last logged: 1:30:25 PM

Error setting up entry Lightwave 2 for lightwave2
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 217, in async_setup
hass, self
File "/config/custom_components/lightwave2/init.py", line 102, in async_setup_entry
await link.async_get_hierarchy()
File "/usr/local/lib/python3.7/site-packages/lightwave2/lightwave2.py", line 210, in async_get_hierarchy
await self.async_update_featureset_states()
File "/usr/local/lib/python3.7/site-packages/lightwave2/lightwave2.py", line 247, in async_update_featureset_states
x.features[y][1] = value["items"][0]["payload"]["value"]
KeyError: 'payload'

OOOps ... seem to have forked your project by mistake

Hi Bigbadblunt,

Back in September I seem to have forked your project by mistake. I am new to all this still! Is there a way to remove that fork do you happen to know? I think leaving it would be confusing for others.

Regards.

Exception on startup

Since a week or so I'm getting errors when starting homeassistant.
I'm not sure if there has been any changes to the code of this integration or the api has started to return something different, however it seems that features["dimLevel"][1] is None which cause the call to fail.

2020-06-20 14:38:22 ERROR (MainThread) [homeassistant.components.light] Error while setting up lightwave2 platform for light
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 178, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 442, in wait_for
    return fut.result()
  File "/config/custom_components/lightwave2/light.py", line 20, in async_setup_entry
    lights.append(LWRF2Light(name, featureset_id, link, url))
  File "/config/custom_components/lightwave2/light.py", line 39, in __init__
    "dimLevel"][1] / 100 * 255))
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

Dimming profile and time, button map.

Since now it is possible to fully use button multi clicks and even change LED settings it would be helpful to access dimming profile and time.
I think LW want's to charge on subscription base way to much for new pro features.
I can see them in attribute list.
Is there any chance to access these features?
At least change dimming time would be great.

Lightwave V1 Mood switches

Hi @bigbadblunt

I don't know if you (or anyone) has considered the V1 Mood switches? These are not wired, and are not visible via the integration. They are used to "remote control" the switches, and I guess may not be entities in the lightwave hub as such. My research identifies that they are going to be RF 433Mhz devices (as are all V1 products). Lightwave have not yet achieved the equivalent as a V2 product and I had a thought that the V1 Mood Switch may be re-usable via HA to connect to and control either or both V1 or V2 Lightwave products(?)

If you have mood switches I wonder if you have considered something along the same lines? I saw some posts on accessing these via RF 433MHz but not really a detailed solution to achieving it.

I didn't expect it to be so hard to identify a suitable and compatible "off the shelf" RF 433Mhz piece of hardware with decent range (my first stumbling block) for a Raspberry Pi!

It would be interesting to know if you have tried this, and if you may know of a post somehwere that gives a detailed walk through.

Thanks

Invalid Config

Hey,

Firstly thank you for setting up this integration, unfortunately I get an invalid config notification after I link my account via the integrations panel. Screenshot and log as per below:

Capture

Log

New energy consumption wrong unit of measure?

Hi, thanks for adding the new energy sensors.

I have one light that is showing as 7,893 kWh in HA

image

but only 7.9 kWh in the app

image

I suspect the app is the correct value. Guess the integration is multiplying by 1000 somewhere?

Hub needed?

Hi

Does it require a hub or does it work just with a switch and HA?

New exception at startup

Similarly to #15, I'm getting a new exception at startup

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 179, in _async_setup_platform
    await asyncio.wait_for(asyncio.shield(task), SLOW_SETUP_MAX_WAIT)
  File "/usr/local/lib/python3.8/asyncio/tasks.py", line 483, in wait_for
    return fut.result()
  File "/config/custom_components/lightwave2/light.py", line 20, in async_setup_entry
    lights.append(LWRF2Light(name, featureset_id, link, url))
  File "/config/custom_components/lightwave2/light.py", line 38, in __init__
    self._lwlink.get_featureset_by_id(self._featureset_id).features[
TypeError: unsupported operand type(s) for /: 'NoneType' and 'int'

Home Assistant 0.113.3
LW v2.3.2beta4
home-assistant.log

Warnings in log when using Scenes.

Hi Bigbadblunt. All is working well with the lightwave integrations, but I do have a log message that occurs and I think this may be associated to "Scenes". Basically I have set the chosen lights to the dim level I required and saved the HA scene. The "scene" has the desired outcome when triggered i.e. it works.

I'm not sure what the warning message is telling me though, and if I can do something to stop it therefore.

2021-01-24 15:09:45 WARNING (MainThread) [lightwave2.lightwave2] Received unhandled message: {'version': 1, 'senderId': 1, 'direction': 'response', 'items': [{'itemId': 207, 'payload': {'deviceId': 2, 'type': 'switch', 'channel': 0, 'writable': True, 'stateless': False, 'virtual': False, 'value': 1, 'status': 'ok', '_feature': {'featureId': '5fd9dc9940e2c0457d3cf784-18-3157348103+1', 'deviceId': '5fd9dc9940e2c0457d3cf784-2-3157348103+1', 'productCode': 'LW400', 'featureType': 'switch'}}, 'success': True}], 'class': 'feature', 'operation': 'write', 'transactionId': 207}

Many thanks for your help.

Invalid config

I am trying to load the lightwave2 config and I have added the security and component in the yammer file. I am still getting the following response

image

_

Invalid config
The following components and platforms could not be set up:

lightwave2
Please check your config.

_

I am also getting the following logs

Log Details (ERROR)
Mon Sep 30 2019 11:25:54 GMT+0100 (British Summer Time)
Error during setup of component lightwave2
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 168, in _async_setup_component
hass, processed_config
File "/config/custom_components/lightwave2/init.py", line 35, in async_setup
from custom_components.lightwave2 import lightwave2
ImportError: cannot import name 'lightwave2' from 'custom_components.lightwave2' (/config/custom_components/lightwave2/init.py)

This was working around a week ago but then it stopped working. Since then I have tried everything including fresh installs of the component and even home assistant.

Home assistant is working on a docker within synology and other custom components are loading and working fine.

Error during setup of component lightwave2

Getting the following error when trying to use this component with hass.io

Error during setup of component lightwave2
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/homeassistant/setup.py", line 145, in _async_setup_component
    hass, processed_config)
  File "/config/custom_components/lightwave2.py", line 24, in async_setup
    from lightwave2 import lightwave2
ModuleNotFoundError: No module named 'lightwave2'

Not sure if it's hass.io related or not but it doesn't seem to be since it can find the right files. Happy to try and help debug, having this working on hass.io would be pretty good.

Understanding 'set_led_rgb'

I am trying to set a dimmer LED to 1% at certain times (in a bedroom, close to a bed) but whatever value I set the app reports 11%. Is this deliberate or am I doing it wrong? Higher values seem to work as expected.

I don't know what the precision is on the LEDs but 1% seems dimmer to me than 11% and Lightwave's own Automations seem happy to apply it.

Energy monitor stopped working

At some point in the last couple of weeks the energy monitor component of this integration has stopped working correctly. It will work for a few minutes after restarting HA or even just updating the integration options, but then it stops updating.

Lightwave light switches are unaffected. There's no specific error in the logs. Energy readings are correctly updated within the official Lightwave app.

Broken!!

Just updated to core 2021-1.5 and it's all stopped working!!

This is in the log......

2021-01-24 17:06:39 ERROR (MainThread) [homeassistant.bootstrap] Error setting up integration lightwave2 - received exception
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 64, in async_setup_component
return await task # type: ignore
File "/usr/src/homeassistant/homeassistant/setup.py", line 158, in _async_setup_component
await async_process_deps_reqs(hass, config, integration)
File "/usr/src/homeassistant/homeassistant/setup.py", line 343, in async_process_deps_reqs
await requirements.async_get_integration_with_requirements(
File "/usr/src/homeassistant/homeassistant/requirements.py", line 76, in async_get_integration_with_requirements
await async_process_requirements(
File "/usr/src/homeassistant/homeassistant/requirements.py", line 123, in async_process_requirements
if pkg_util.is_installed(req):
File "/usr/src/homeassistant/homeassistant/util/package.py", line 54, in is_installed
return version(req.project_name) in req
File "/usr/local/lib/python3.8/site-packages/pkg_resources/init.py", line 3125, in contains
return self.specifier.contains(item, prereleases=True)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/specifiers.py", line 789, in contains
item = parse(item)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/version.py", line 56, in parse
return Version(version)
File "/usr/local/lib/python3.8/site-packages/pkg_resources/_vendor/packaging/version.py", line 275, in init
match = self._regex.search(version)
TypeError: expected string or bytes-like object

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.