Lightwave Generation 2 component

Thanks for sending the info. Please forgive my ignorance of HA, but where do the lines need to be inserted in the configuration file. I placed at the end of my current config and HA reported that the config file was incorrect.

After, I attempted to place in the default_config: but I didn’t see any additional logging.

Ooops. Sloppy copy and pasting. I was missing the first line.

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

End of your config file should be fine as long as you don’t already have a logger entry.

Ok. Here is the extended log. The interesting ones are:
Energy monitor: ‘Consumer Unit’, ‘deviceId’: '5e164b8defa11c07306a90bf-6-3157351965+1

and

Magnetic Switch: ‘Doot’, ‘deviceId’: ‘5e164b8defa11c07306a90bf-16-3157351965+1’

NB. Ignore the spelling ‘Doot’. When I added the device, I incorrectly typed the name ‘Doot’ instead of ‘Door’ (obviously)

How do i post the file to you?

I have been using this component for 2 months now, and its working great. I have 2 observations:

  1. Memory Usage on the HA docker image jumps from ~1GB to >2.5GB over time (1-2 days) when the Energy Monitor is included in the Recorder settings (by default I have quite a lot of Recorder settings disabled in configuration.yaml). Not sure why the increase in memory usage, other then polling interval and data sent to DB? Your Python code infers that polling is not used?
  2. The Energy Monitor can display Current/Total Energy Used with each individual Gen2 device (Sockets and Dimmers). Can this be added to the component easily?

Again, thanks for a great plugin.

  1. Not sure what’s going on with recorder. I don’t have an energy monitor, but if it’s constantly updating your energy consumption, maybe it’s recording too many entries in the database? You could use a filter sensor, see someone else who was having a similar problem with a different energy sensor
  1. All gen 2 devices have the attributes current_power_w and lwrf_power for the current power usage, and lwrf_energy for total energy usage to date.

Just upgraded the plugin to v2.3.1 from v2.2.0 and I got these messages from the restart:

The following integrations and platforms could not be set up:

  • lightwave2.switch
  • lightwave2.binary_sensor
  • lightwave2.light
  • lightwave2.climate
  • lightwave2.cover

Please check your config.

Any ideas as to why. It was working fine before the upgrade. I reverted to v2.2.0 and everything is working again.

I had the same iirc - I had to upgrade Home Assistant to 0.110, it looked like an API had changed that the new version of the plugin required.

I have other issues with the upgrade to 0.110 but the Lightwave integration isn’t one of them, no problems with that!

Hope that helps.
Fred.

2020-06-08 12:31:53 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect (exception '0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url='https://auth.lightwaverf.com/v2/lightwaverf/autouserlogin/lwapps'). Waiting 2 seconds to retry
2020-06-08 12:31:55 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect, max_tries exceeded, aborting

This is with the latest Beta 3 version (2.3.2 Beta 3).

Any ideas?

Hi - I can’t reproduce this, so not 100% sure. My setup is working.

It’s failing at the authentication stage - the first step in connecting to the LW server is to send your username and password, and receive an access token. This is failing for some reason.

Possibilities:

  1. invalid username/password (I don’t think this is the case, I think you would get a different error) EDIT: having tried entering incorrect password, this could be the cause
  2. LW authentication server being temporarily down
  3. some kind of error with your internet connection

My first suggestion is to wait a while, reboot your HA server and hope it resolves itself. If that doesn’t work, can you turn on additional logging by putting the following in your configuration.yaml?

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

Thanks for the quick reply, I’m doing a reboot now, and if that doesn’t work I’ll add logging and post back here.

I actually went out and bought the Plus Hub just because of this module lol, so I will be perservering.

:slight_smile:

020-06-08 19:14:22 DEBUG (MainThread) [lightwave2.lightwave2] Connecting to websocket
2020-06-08 19:14:23 WARNING (MainThread) [homeassistant.components.media_player] MediaPlayerDevice is deprecated, modify ArloMediaPlayerDevice to extend MediaPlayerEntity
2020-06-08 19:14:26 DEBUG (MainThread) [lightwave2.lightwave2] Requesting authentication token (using username and password)
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:29 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:30 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:30 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:30 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:30 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:30 WARNING (MainThread) [aiohue.util] Received unexpected bridge id: 93eadbeef13
2020-06-08 19:14:31 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect (exception '0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8', url='https://auth.lightwaverf.com/v2/lightwaverf/autouserlogin/lwapps'). Waiting 2 seconds to retry
2020-06-08 19:14:34 DEBUG (MainThread) [lightwave2.lightwave2] Requesting authentication token (using username and password)
2020-06-08 19:14:34 WARNING (MainThread) [lightwave2.lightwave2] Cannot connect, max_tries exceeded, aborting

Not sure if this is much help!?

Found this posted on the site, don’t know if it is any help.

I’ve been having the same issue, and have done a bit of investigation…

The error is caused by python3.7/site-packages/aiohue/bridge.py at line 62 it has

            async with self.websession.request(method, url, json=json) as res:
                if res.content_type != 'application/json':
                    raise ResponseError(
                        'Invalid content type: {}'.format(res.content_type))

looking at the URL it is calling…

http://xx.xx.xx.xx/api/<apikey>/lights/

or variations of.
This returns a type

text/html

although the content is JSON formatted.
Thus the error is thrown.

I don’t know enough about what is happening here, but this may give someone else a clue.
Happy to test ideas.

Can you check username and password please? I can reproduce this by entering an incorrect password.

Easiest thing to do is to delete the integration and re-add it.

Can you also check your username/password allows you to log in to the official web app at:
https://my.lightwaverf.com/a/login

Hangs head in complete shame…

D’oh.

Er I could weakly mention that it is a weird response, but no, I just need to go and sit in the corner and be quiet for a while.

:flushed:

No worries. I should definitely improve the error messages at some point.

Let me know if you have any feedback on the component.

Will do, and thank you for your work, excellent btw, very pleased.

I’ve just got the radiators, boiler and thermostat and energy monitor into the new Hub and HA, I’ve got a whole house of plugs and light switches left to add so I will let you know how I get on.

Seems to be being a little strange trying to control the boiler and thermostat so far, doesn’t seem to want to go “on”, it is either off or heat but showing idle.

The other thing is the radiators will not go back into AUTO once you have picked a percentage. So if it is showing AUTO, and I click 20%, then try AUTO it sets it to 100%, not back to AUTO.

Oh, also the Energy Monitor only has two options now, which is strange because I used another module previously (since removed) for that and I got more data entities.

Ok update. Once I had switched the boiler on, it’s state changed (correctly) to Heating, then I turned it off using the controls.

Now it is fine.

But you can have a state of idle, so it looks like this isn’t being handled, you can’t then go into heating through HA without first manually switching it on.

Thermostat, that seems strange, but always has, only had it working once properly, stupid thing. But it doesn’t seem to be reacting other than off, then it seems to go back to idle. (the device does show off, then back on to the idle state of not on, or off, just sort of existing…)

:slight_smile:

I’ll take this in two bits - hopefully the one that’s easy to solve first. On the energy monitor, what are the missing entities? All of the data provided by the device should be provided through attributes. I don’t have an energy monitor, but the attributes for a gen 2 light are shown below.

If you want these to be available as separate entities in HA, you can set up a template sensor:

How do they appear in the offical app?

And now the harder one :slight_smile:

Thermostats/boilers. I struggle with this because the LW behaviour seems weird, and the HA template is quite constraining.

Let’s do the boiler first. I think you’re probably the first person to use one of these. How does it appear in the offical app - can you provide screenshots (either from the phone app or the web app? If you can provide log files where you control it using the offical app and let me know roughly what you did I can try and work it out.

For the thermostat, which of these is it?


or

https://lightwaverf.com/search?type=product&q=LW934

Again, a description/screenshots of the official behaviour and some logs will help.

The LW934 should work (that’s the one I have). “Idle” means “On but has already reached target temperature”. If the room falls below the target temperature, the state should change to “Heating”

image
image