New TP-Link Smart Home binding with Bulb, Plug and Switch Support

This would suggest the status information of the bulb isn’t interpreted correctly by the binding. The binding can log the json returned by the bulb if you set the log level for the binding to trace level. This will among others print the json of the bulb from the get_sysinfo call. The state info is in the light_state block. If possible can you post what it returns in the case of when you switch it off with Kasa, and when you change the color? You might have to wait some seconds after the command given because the data is retrieved at the refresh interval. This information can give me a clue about why it’s not working as intended. At this moment I have no other clue.

Hi,
downloaded the jarin my addons folder, but cant start.

192 | Installed | 80 | 2.2.0.201712161258 | TPLinkSmartHome Binding

bundle:start 192

Error executing command: Error executing command on bundles:
Error starting bundle 192: Could not resolve module: org.openhab.binding.tplinksmarthome [192]
Unresolved requirement: Import-Package: org.eclipse.jdt.annotation; resolution:="optional"
Unresolved requirement: Import-Package: org.eclipse.smarthome.core.cache

How can i install the missing requirements ?

2nd Question - will that bundle show up in the paper ui so that i can configure mit things and items and use it in the HABPanel?

Sorry iam new to openhab2 and still figuring out how thinks work.

greetings

Ben

The normal way is to just install the binding through paper ui. I looks like you tried to manually install something instead.

in the paper ui , it didnt show up on openhab2

It’s available in version 2.2, otherwise try via eclipse marketplace. The marketplace is a binding you first need to install via paper UI binding

Thanks for the info , iam running on stable 2.0 is it possible to upgrade ? or need to make afresh install ?

I think it’s not compatible with that version, which explains the error you got. I’m not familiar with that upgrade path, so can’t give advice.

Hi,

I had to add 2 LB110 bulbs earlier to my sister’s openhab2.2 so advance apologies for not being in a position to offer further information. The 2 HS100 sockets worked perfectly (thanks for the effort with this binding).

Both bulbs autodiscovered in Paperui, listed as LB110. Only a brightness channel was made available and this defined itself as a dimmer. Within the Paperui, this shows as a slider, with no option to turn the light on or off unless moving the slider. If the item is changed to a switch, you can turn on and off. However…

The bulbs keep changing their status to ON after being switched off. It appears to refresh and because the brightness value is greater than zero, it decides the bulb should be on - based on the event log info. It doesn’t actually physically turn the bulb on, only shows a status of on. I’m not sure if this is normal behaviour or a difference in configuration for that model. Unfortunately wasn’t in a position to try manual config.

If I can obtain a bulb at a later date I’ll provide more info.

i updated to openhab 2.2, thx for the hint :slight_smile: only 1 problem left hrhr

I really like to test it but I cannot see the device in Homekit. I configured it via PaperUI and I can switch it with the openHAB app and the PaperUI. Maybe I get things totally wrong but I expected to appear the device in the openHAB bridge in Homekit - but I only see some Hue bulbs I also added. Any ideas?
Using the latest stable openHAB on a Pi and the 2.2 of the add-on.

@Jonathan_Mabrito, @warcom I’ve created a fix for the off state of the light bulb. I hope it will now work as intended. The update binding is available via the eclipse marketplace. Let me know if this fixes the issues.

Just had a chance to test this, and the bulb state is now correct. All seems to be working ok. Many thanks for the effort fixing this :slight_smile:

Hi hilbrand,
i followed this thread and I am still confused about the source of TP-link smarthome binding.
You are referencing two sources:

  1. eclipse market place
  2. paper ui --> Add-ons --> Bindings

Could you expand a little bit, which one to use and why?

ad auto-detection: in case it fails, is it possible to install the binding manually?

There are 2 versions of the binding:

  1. The binding in the openHAB release, which can be installed via Paper UI.
  2. The binding in the Eclipse Marketplace. This is a beta release of the binding with new devices supported and bug fixes. This binding can also be installed via Paper UI if you have the Eclipse Market place binding installed.

If you have issues that are fixed or devices not yet supported in the official binding you can install the binding from the Eclipse Market place, in all other cases best install the official binding. With a new release of openHAB the binding will be updated and be the same as the binding in the Eclipse Marketplace (If all changes are merged with the openHAB addons master, which is the case at this moment), while if you install the binding from the Eclipse Market place it’ss not automatically updated when you update openHAB to a new release of openHAB.

I’m not sure if I understand your last question correctly. But you can install it manually. Downloading the jar from the Eclipse Market place and put it in the right folder (I thing there are some desciptions on how to do that somewhere on the forum). But I wouldn’t recommend it as it should work via one of the other ways.

Good Morning Hilbrand,
thank you very much for making it crystal clear.
Is it safe to install both bindings at the same time?
ad second question: I meant, is it possible to use “textual configuration”, not installation of the jar.

No I don’t think it’s possible to install both, since they use the same namespace.
Yes, It is possible to do a textual configuration, see the read me for details.

Thx again, sorry to pester you. I really try to understand how this works.

There is an example for textual configuration at the openhab docs for tplinksmarthome.things.

tplinksmarthome:hs100:home "Living Room"        [ ipAddress="192.168.0.13", refresh=60 ]

Syntax for .things:

    `Thing <binding_id>:<type_id>:<thing_id> "Label" @ "Location" [ <parameters> ]
  • tplinksmarthome is the binding_id - I suppose I am not allowed to change it?

  • type_id is in my case re270.

  • thing_id: this one is a mystery. Docs state it is an ID to uniquely identify the Thing. I suppose “home” is a placeholder, but I am not sure what to fill in instead.

  • The word Thing is missing in the example. Is the example simply outdated or is Thing not mandatory?

  • binding_id is fixed and defined by the binding, so you can’t change it.
  • type_id is also fixed and is the identifier of the device as defined by the binding
  • thing_id is something you define yourself. You can name it something that is logical to you, for example the location in your house.
  • The word Thing seems to be optional. I’ve never given it any consideration, but looking at other bindings, some have it in the docs and other don’t.

I see you have a re270. The bad news: It might not be detected or work. I’ve had a report from a user it was not detected, but never got feedback for more detailed information. Since I don’t have this device as they are new and not available everywhere I’ve guessed how it works. If it doesn’t auto detect or work at all you can do is enable trace logging for the binding (Are you familiar with the logging?) This will show detailed information what the device returns and with that information I can improve the binding. When enabled start auto discovery in PaperUI en see in the logs what is happening. If you are able to add the device manually and it doesn’t work either, also check the logs. You can send the logs in a private message or post it here, whatever you prefer.

Okay logging!
Of course I am not familiar with logging but I did a bit digging!
What I did to produce a bit of logs!

  • log in to console

  • typed: log:set DEBUG org.openhab.binding.tplinksmarthome

  • confirm if it is in the list with: log:list

    Logger │ Level
    ───────────────────────────────────────────────────┼──────
    ROOT │ WARN
    javax.jmdns │ ERROR
    org.apache.karaf.jaas.modules.audit │ INFO
    org.apache.karaf.kar.internal.KarServiceImpl │ ERROR
    org.apache.karaf.shell.support │ OFF
    org.eclipse.smarthome │ INFO
    org.jupnp │ ERROR
    org.openhab │ INFO
    org.openhab.binding.tplinksmarthome │ DEBUG
    org.ops4j.pax.url.mvn.internal.AetherBasedResolver │ ERROR
    org.ops4j.pax.web.pax-web-runtime │ OFF
    smarthome.event │ INFO
    smarthome.event.InboxUpdatedEvent │ ERROR
    smarthome.event.ItemAddedEvent │ ERROR
    smarthome.event.ItemRemovedEvent │ ERROR
    smarthome.event.ItemStateEvent │ ERROR
    smarthome.event.ThingAddedEvent │ ERROR
    smarthome.event.ThingRemovedEvent │ ERROR
    smarthome.event.ThingStatusInfoEvent │ ERROR

Okay it is there. I assume logging is now possible. :slight_smile:

  • next I did: log:display org.openhab.binding.tplinksmarthome after I turned on autodetection in paperUI

Result is:

openhab> log:display org.openhab.binding.tplinksmarthome                                               
18:16:54.273 [DEBUG] [ernal.TPLinkSmartHomeDiscoveryService] - Stop scan for TP-Link Smart devices.
18:16:54.274 [DEBUG] [ernal.TPLinkSmartHomeDiscoveryService] - Start scan for TP-Link Smart devices.
18:16:55.276 [DEBUG] [ernal.TPLinkSmartHomeDiscoveryService] - Discovering poller timeout...
18:17:14.274 [DEBUG] [ernal.TPLinkSmartHomeDiscoveryService] - Stop scan for TP-Link Smart devices.

Not really verbose I guess. Probably I need a little hint how to get more info from logging :smile:

follow up from events.log:

2018-02-09 18:05:15.189 [hingStatusInfoChangedEvent] - 'tplinksmarthome:re270:833c3ec8' changed from OFFLINE (COMMUNICATION_ERROR): Error (-1): method not support to ONLINE
2018-02-09 18:05:15.190 [vent.ItemStateChangedEvent] - RE270K_Switch changed from ON to OFF