New add-on to add support for Easywave devices

Hello Marcselis, first of all, my enormous appreciation for the amazing work you’ve been doing for this niko integration so far. Niko ending the support for remote controlling these switches was huge bummer but it seems you might actually be the person who came to our rescue, not all hero’s wear capes :slight_smile:

I’ve been tinkering around with this setup a bit, and I think I’m almost there, however, for some reason my light dont react to the commands send…yet

My config:

{
  "LogLevel": "Information",
  "SerialPort": "/dev/ttyUSB0",
  "EasywaveActionTimeout": "500",
  "EasywaveRepeatTimeout": "80",
  "MQTTServer": "192.168.1.203",
  "MQTTPort": "1883",
  "MQTTUser": "My",
  "MQTTPassword": "secret",

  "Devices": [
    {
      "Id": "0ae33b",
      "Type": "Transmitter",
      "Name": "Poolhouse lichtschakelaar",
      "Area": "Poolhouse",
      "Buttons": ["A", "B"]
    },
    {
      "Id": "phpl",
      "Type": "Light",
      "Name": "Poolhouse plafondverlichting",
      "Area": "Poolhouse",
      "Subscriptions": [
        {
          "Address": "0ae33b",
          "KeyCode": "A"
        },
        {
          "Address": "000010",
          "KeyCode": "A",
          "CanSend": "true"
        }
      ]
    }
  ]

}```



When I press the button to turn off/on the lights I get something like this in the logging:

[19:14:22.678 DBG Easywave2Mqtt.Mqtt.MessagingService] Topic mqtt2easywave/phpl/set received with payload OFF
[19:14:22.679 DBG Easywave2Mqtt.Mqtt.MessagingService] Received OFF on phpl
[19:14:22.681 DBG Easywave2Mqtt.Easywave.EldatRx09Transceiver] Sent TXP,10,B
[19:14:22.683 WRN Easywave2Mqtt.Easywave.EasywaveSwitch] Switch Poolhouse plafondverlichting is turned Off
[19:14:22.684 DBG Easywave2Mqtt.Mqtt.MessagingService] Publishing topic easywave2mqtt/phpl/state with payload OFF
[19:14:22.689 DBG Easywave2Mqtt.Easywave.EldatRx09Transceiver] Received OK
[19:14:22.689 DBG Easywave2Mqtt.Easywave.EldatRx09Transceiver] Eldat Transceiver confirmed last command
[19:14:22.699 DBG Easywave2Mqtt.Mqtt.MessagingService] Topic easywave2mqtt/phpl/state received with payload OFF
[19:14:24.337 DBG Easywave2Mqtt.Mqtt.MessagingService] Topic mqtt2easywave/phpl/set received with payload ON
[19:14:24.338 DBG Easywave2Mqtt.Mqtt.MessagingService] Received ON on phpl
[19:14:24.338 DBG Easywave2Mqtt.Easywave.EldatRx09Transceiver] Sent TXP,10,A
[19:14:24.341 WRN Easywave2Mqtt.Easywave.EasywaveSwitch] Switch Poolhouse plafondverlichting is turned On
[19:14:24.341 DBG Easywave2Mqtt.Mqtt.MessagingService] Publishing topic easywave2mqtt/phpl/state with payload ON
[19:14:24.345 DBG Easywave2Mqtt.Easywave.EldatRx09Transceiver] Received OK
[19:14:24.345 DBG Easywave2Mqtt.Easywave.EldatRx09Transceiver] Eldat Transceiver confirmed last command
[19:14:24.348 DBG Easywave2Mqtt.Mqtt.MessagingService] Topic easywave2mqtt/phpl/state received with payload ON```

I’m far from an expert, but to me this all seems to be okay, but still the lights don’t react to commands sent from HomeAssistant at all, any ideas what I am doing wrong?

From the logs it seems everything is working ok: the EasyWave stick is sending out instructions when you turn on/off lights using Home Assistant. But is something listening to them? The USB stick is just the same like every other new switch that you add to your home: you need to manually tell the light that it needs to listen to the instructions of the new switch to be able to operate the light with that switch. I think you forgot this step, and now the light’s controllers see the EayWave messages flying by and do not know they are meant for them.

Usually the controllers have some kind of button that you need to press to put it in programming node, and then you’ll need to make HA send the “turn light on” signal for that light (so make sure the light is off in HA before putting the controller in programming mode) and when the controller’s light blinks, they will be linked. Then wait for the programming mode timeout and you will be able to control that light with HA. You’ll need to do that for each light you want to control, and also make sure that in the config file, each of the lights is listening to another EasyWave address, so you can control them individually.

You can find detailed instructions for your controllers on the Niko site. See an example here.

Hello,

I’m still struggling a bit…

My stick is functioning and the state of the light is changing in home assistant trough MQTT. So I assume that part is working correctly. As mentioned in your previous reply. I need to program everything in my easy wave relay box? I assume that there is where your subscription address from in the light configuration comes from? This is to differentiate between different lights so you can switch them individually?

The main issue I’m having is that after some time the add-on just becomes very unresponsive at this point. I’ve just added one light and switch just for testing purposes. The state changes using the physical button. The home assistant switch I still need to configure in the controller.

[23:18:57.102 DBG Easywave2Mqtt.Easywave.EldatRx09Transceiver] Received REC,2d4ed7,A
[23:18:57.103 VRB Easywave2Mqtt.Easywave.EldatRx09Transceiver] -->Parse(REC,2d4ed7,A) start
[23:18:57.103 VRB Easywave2Mqtt.Easywave.EldatRx09Transceiver] <--Parse returns EasywaveTelegram { Address = 2d4ed7, KeyCode = A }
[23:18:57.103 VRB Easywave2Mqtt.Easywave.EasywaveTransmitter] -->HandleButton 2d4ed7:'A'
[23:18:57.103 VRB Easywave2Mqtt.Easywave.EasywaveButton]   -->HandlePress 'A' (36 elapsed)
[23:18:57.104 DBG Easywave2Mqtt.Easywave.EasywaveButton]     Increasing repeat counter to 5
[23:18:57.104 INF Easywave2Mqtt.Mqtt.MessagingService] Button 2d4ed7:'A' held
[23:18:57.104 DBG Easywave2Mqtt.Mqtt.MessagingService] Publishing topic easywave2mqtt/2d4ed7/action with payload button_A_hold

My suspicion is that my hardware is getting a bit old to run this add-on? At this point I’m trying to run it on a Raspberry Pi 3. That might be a bit light? It doesn’t show excessive RAM or CPU Usage tough?

On Raspberry PIs it’s usually not the CPU & Memory that are the bottleneck on performance, but the SD Card definitely is. Especially when logging is increased to Debug or Trace, the plugin is writing a lot of data to the disk in a short time, and this can cause delays in its working. Generally it is not advised to run HA on SD Cards, due to their slow writing/reading speeds & the quick wear-out of these cards.

I run Home Assitant on an RPI 4, but instead of using an SD Card, I configured it to boot from an 256GB SSD drive attached to one of the USB3 ports.

As for your other question: in general it works like this:

My plugin has no idea whether there really is a poolhouse light and what state it is in. It just builds it’s own little view on reality and tries to interact with it, based on the configuration that you gave it. The Eldat stick can receive all Easywave messages, sent on all addresses, and my plugin uses these to update its view on reality, but unfortunately the stick can only send on addresses 000000 to 00004F or 00007F depending on whether you have the 64 or 128 channel version. This means that my plugin can not send out the exact same messages that your lights currently react to.

In the configuration you have shared earlier, you added 2 subscriptions to your Poolhouse light:

  • one for address 0ae33b and keycode A: that is the one that tells my plugin that when it sees that message passing by, the Poolhouse light is probably turned On, or Off (with keycode B). My plugin then adapts the in-memory state of it’s virtual Poolhouse Light object, and sends an MQTT message to HA to reflect that new state. It seems that this part is already working fine.
  • the other subscription with address 000010, keycode A and CanSend True is used by the plugin when it receives an MQTT message from HA requesting to control the light. When HA asks to turn the light On, my plugin instructs the Eldat stick to send out keycode A on address 000010 and then assumes the light is on and reports that state to HA. When HA asks to turn the light off, it instructs to send out keycode B on address 000010, and assumes that happened as well.

And that is where the story ends for the plugin. It has no idea whether the poolhouse light really turned on or not as unlike newer protocols like Zigbee, Easywave receivers that control devices do not send out messages and thus not report their state.

You need to configure somewhere that the poolhouse light need to turn on when keycode A on Easywave address 000010 is sent and turned off when keycode B is sent on that same address, on top of the commands the light currently listens to.

Each of my lights are are normal household ligths that are controlled by their own Easywave receiver relay that is mounted in the ceiling. That relay has a little button, and when I press it for a few seconds, the relay switches to ‘learning mode’. If I then press the on button of any Easywave wall mounted transmitter switch, or I make my plugin send out an A message, the light on the Easywave relay will start blinking, meaning that it is now linked to the device that sent out that message, and will start listening to it.

I don’t know what you have as setup and I don’t know what an Easywave Relay Box is. I’m guessing it’s some kind of bridge device to link Easywave to the Niko Home Control system, or something, but as I’m not familiar with that, I can’t help you with that. You’ll need to figure out a way to make that poolhouse light to turn on when keycode A is sent out on Easywave address 000010, and of when keycode B is sent, on top of its current working.

Once that is working ok, you can start adding other lights, and linking them with other Easywave addresses.

After that you can do more advanced things. Because my plugin is able to detect hold, release and single, double & triple button presses, you can do more with your Easywave buttons using HA. For example when double-pressing the On button of a light, the light will turn on, because it’s dumb controller saw the messages passing by, but in HA you can make that double-press start an automation that starts a timer for X seconds and turn the light back off.