banban525 / echonetlite2mqtt

ECHONET Lite to MQTT bridge.
MIT License
48 stars 7 forks source link

General Issues & Solutions #20

Open AnthonyOGorman opened 1 year ago

AnthonyOGorman commented 1 year ago

I thought I might write down some issues I had setting up echonetlite2mqtt and the solutions I inevitably came too. Hopefully this saves people the hours spent debugging.

My setup is a WTY2001, with 2 WTY24173W. These use リンクプラス (Link Plus) however the WTY2001 does support EchoNetLite out of the box.

My first mistake was plugging it into a separate VLAN that was on a different subnet, I thought this would not be an issue. However from my understanding "ECHONET_TARGET_NETWORK" env variable is used to match your interface IP, then your interface IP is the IP used to Initialize the EchoNetCommunicator. If your subnet does not match, it looks like this never gets initialized properly?

My second mistake was not setting docker to network host. This can cause issues with the "ECHONET_ALT_MULTI_NIC_MODE" due to Multicast.

However I was not using that env variable, instead, using a virtual interface of course my interface subnet is going to be different to the "ECHONET_TARGET_NETWORK". Causing the same issue as above.

Hopefully this helps someone having the same issues I was, Glad to say now everything is working and using switches through Home Assistant has never felt so good.

banban525 commented 1 year ago

@AnthonyOGorman

Thank you for your report.

As you report, ECHONET_TARGET_NETWORK is used to pick one network interface when a host has multiple network interfaces. echonetlite2mqtt cannot find the device even if you specify a different subnet for ECHONET_TARGET_NETWORK.

For the same reason, docker environments cannot find devices without the --net=host option.

I believe ECHONET Lite only works within the same subnet. I will add it to Readme.md later.

banban525 commented 1 year ago

@AnthonyOGorman

But I don't know about the "ECHONET_ALT_MULTI_NIC_MODE" problem.

My second mistake was not setting docker to network host. This can cause issues with the "ECHONET_ALT_MULTI_NIC_MODE" due to Multicast.

What happened at this time? If this option causes the application to crash, I have to fix it.

The following command had no problems other than not finding the device, but what about your environment?

docker run -d -e ECHONET_ALT_MULTI_NIC_MODE=1 banban525/echonetlite2mqtt 
aftertommy commented 1 year ago

@AnthonyOGorman Just to confirm as there’s discussion in another thread, are you able to control your Link Plus lights via echonetlite2mqtt with the WTY2001?

I have the aiseg2, which is a similar device from Panasonic with echonetlite support, but it only allows me to control other companies’ devices via echonetlite. It does nothing to let me control my Link Plus lights via echonetlite.

AnthonyOGorman commented 1 year ago

Did not realize this thread has comments, sorry for the late reply!

@AnthonyOGorman

But I don't know about the "ECHONET_ALT_MULTI_NIC_MODE" problem.

My second mistake was not setting docker to network host. This can cause issues with the "ECHONET_ALT_MULTI_NIC_MODE" due to Multicast.

What happened at this time? If this option causes the application to crash, I have to fix it.

The following command had no problems other than not finding the device, but what about your environment?

docker run -d -e ECHONET_ALT_MULTI_NIC_MODE=1 banban525/echonetlite2mqtt 

No crashes or issues here, just trying to use "ECHONET_ALT_MULTI_NIC_MODE" without the --net=host docker option. Which was my mistake.

@AnthonyOGorman Just to confirm as there’s discussion in another thread, are you able to control your Link Plus lights via echonetlite2mqtt with the WTY2001?

I have the aiseg2, which is a similar device from Panasonic with echonetlite support, but it only allows me to control other companies’ devices via echonetlite. It does nothing to let me control my Link Plus lights via echonetlite.

Yes everything is working and controllable using the WTY2001 -> echonetlite2mqtt -> MQTT Home Assistant Integration, I was about to buy the AISEG2 but did not need the screen so ill consider myself lucky for now. Ill drop by the thread and see if I have any solutions.

Entity Integration with home assistant was done via configuration.yaml mqtt: !include echonetlite.yaml

Then in echonetlite.yaml

- light:
    name: "switch-01"
    state_topic: "echonetlite2mqtt/elapi/v2/devices/switch-01/properties/operationStatus"
    command_topic: "echonetlite2mqtt/elapi/v2/devices/switch-01/properties/operationStatus/set"
    brightness_state_topic: "echonetlite2mqtt/elapi/v2/devices/switch-01/properties/lightLevel"
    brightness_command_topic: "echonetlite2mqtt/elapi/v2/devices/switch-01/properties/lightLevel/set"
    brightness_scale: 100
    qos: 0
    payload_on: "true"
    payload_off: "false"
    optimistic: false
- light:
    name: "switch-02"
    state_topic: "echonetlite2mqtt/elapi/v2/devices/switch-02/properties/operationStatus"
    command_topic: "echonetlite2mqtt/elapi/v2/devices/switch-02/properties/operationStatus/set"
    brightness_state_topic: "echonetlite2mqtt/elapi/v2/devices/switch-02/properties/lightLevel"
    brightness_command_topic: "echonetlite2mqtt/elapi/v2/devices/switch-02/properties/lightLevel/set"
    brightness_scale: 100
    qos: 0
    payload_on: "true"
    payload_off: "false"
    optimistic: false
aftertommy commented 1 year ago

Thank you for your reply! Wow your link plus lights are discoverable over echonetlite using the WTY2001? I am incredibly jealous. Do you mind posting a (redacted is ok) screenshot of what echonetlite2mqtt’s web ui shows for a link plus light?

AnthonyOGorman commented 1 year ago

Thank you for your reply! Wow your link plus lights are discoverable over echonetlite using the WTY2001? I am incredibly jealous. Do you mind posting a (redacted is ok) screenshot of what echonetlite2mqtt’s web ui shows for a link plus light?

What do you mean before by

only allows me to control other companies devices

The spec sheet did mention AISEG2 being supported for Link Plus devices.

Here are some screenshots: image image

aftertommy commented 1 year ago

With Aiseg2, I’m unable to discover any of my lights over echonetlite, but I can connect other companies’ echonetlite products to the aiseg2 and control them via the aiseg2 web ui, which isn’t really ideal.

AnthonyOGorman commented 1 year ago

With Aiseg2, I’m unable to discover any of my lights over echonetlite, but I can connect other companies’ echonetlite products to the aiseg2 and control them via the aiseg2 web ui, which isn’t really ideal.

What lights are you using?

aftertommy commented 1 year ago

I believe Link Plus. WTY2421, WTY22173, and similar.

AnthonyOGorman commented 1 year ago

I believe Link Plus. WTY2421, WTY22173, and similar.

And you paired the devices to the AISEG2, as the devices don't communicate with the AISEG2 over echonetlite, they communicate via 923mhz.

See page 2 of manual.

banban525 commented 1 year ago

No crashes or issues here, just trying to use "ECHONET_ALT_MULTI_NIC_MODE" without the --net=host docker option. Which was my mistake.

Thank you for the reply. I was relieved that echonetlite2mqtt seemed to have no problems.

And, thank you for reporting your light's behavior. I believe this report will be useful to other users as well.

aftertommy commented 1 year ago

And you paired the devices to the AISEG2, as the devices don't communicate with the AISEG2 over echonetlite, they communicate via 923mhz.

See page 2 of manual.

Correct, the lights are paired with the Aiseg2. I presume your lights are paired with the WTY2001 over 923mhz, and the WTY2001 acts as a bridge for echonetlite, is that not correct?

AnthonyOGorman commented 1 year ago

Correct, the lights are paired with the Aiseg2. I presume your lights are paired with the WTY2001 over 923mhz, and the WTY2001 acts as a bridge for echonetlite, is that not correct?

Yes, Had a look though AISEG2's documentation to see if you have to enable Echonetlite, could not find anything. It could be that echonetlite2mqtt is detecting all other echonetlite devices that are on the network but cant detect the AISEG2. Is there a web interface for the AISEG2?

aftertommy commented 1 year ago

Yeah it’s funny how little they really cover in their manuals for this stuff. Aiseg2 does have a web ui, though as best as I can tell there’s no means of enabling lights <-> echonetlite bridging.

In any case I pulled the trigger on a WTY2001 and I’ll try it out once it arrives! Saves me from a larger project.

AnthonyOGorman commented 1 year ago

Just one more check, which docker image tag are you using?

aftertommy commented 1 year ago

I don’t recall which tag, but fwiw even rolling it manually with the various echonetlite libraries out there doesn’t turn up any devices.

AnthonyOGorman commented 1 year ago

Give this image a shot if you have time banban525/echonetlite2mqtt:master

banban525 commented 1 year ago

@aftertommy @AnthonyOGorman

I will explain about tag:master.

tag:master is a release candidate for the next v2.3.0. The major differences from v2.2.0 are as follows.

  1. Updated the library for EchonetLite, so finding the device is a little faster.
  2. Added mode for multiple IP environments.

But, Both are unlikely to solve the aftertomy's problem. I think there is a problem with the WTY2001 settings or network environment.

Unfortunately, I don't have リンクプラス(Link Plus), so I can't experiment with it.

aftertommy commented 1 year ago

Sorry for hijacking this thread. Confirming that the WTY2001 is indeed broadcasting the lights over echonetlite as @AnthonyOGorman described. Man I wish I didn’t bother with this dumb aiseg!

Thanks everyone.

AnthonyOGorman commented 1 year ago

I would love to do some debugging with it if I ever find AISEG2 on sale or second hand. But glad to hear its all working with the WTY2001!

flutschepfeil commented 9 months ago

I would also like to hijack this thread for a short question. Is it possible to do a soft on with LEDs? Basically that the light goes not on 0 seconds from 0-100 brightness but over for example 2 seconds from 1-100. I assume it may not be possible with normal LEDs, if that's the case, does it work in combination with smart bulbs?

banban525 commented 9 months ago

@flutschepfeil

Is the feature you want a light bulb that gradually brightens?

ECHONETLite2MQTT does not have such functionality. However, it seems that this function can be achieved by sending a brightness change command many times to a smart bulb that can change brightness. But it's not easy.

flutschepfeil commented 9 months ago

@banban525 @aftertommy

Correct. But I have to admit that this question is maybe more Panasonic Advance Plus related than echonetlite2mqtt. If we take the Philips Hue with home assistant as example, the turn on gradually during maybe a 1 sec period instead of instantly. Since the Panasonic Advance Plus switch turn on the power to the bulb, I do not know if it can automatically start at 100% or if you can somehow manage a soft transition to 100%. banban525, I assume you mean that first the switch gets switched on (hoping that the smartbulb wont activate instantly) and then a command is issued from Home Assistant, that the bulb is turned on gradually. This may indeed work, but here I would like to ask if someone tried it and confirm if it is possible.

I assume, normal switches can not dim the bulbs, meaning it is not possible via the switch itself.