BobRak / OpenHAB-Smartthings

53 stars 54 forks source link

powerMeter not working #3

Closed mythbai closed 7 years ago

mythbai commented 7 years ago

hi Bob

This is a great addon and working for my switch testing. I have this Zigbee SmartPower Outlet from Smartthings, but configuring powerMeter seems not working. Thing file: ... Thing powerMeter PianoSideLampPower [smartthingsName="Piano Side Lamp"] ...

Item File: Number S1_Piano_Side_Lamp_Power "Piano Side Lamp P [%.1f W]" (gLights, GF_Living) {channel="smartthings:power:Home:PianoSideLampPower:power"}

Openhab log file:

11:36:19.423 [DEBUG] [rtthings.internal.SmartthingsServlet] - Smartthings servlet service() called with: 192.168.1.2: POST /smartthings/state 11:36:19.425 [DEBUG] [rtthings.internal.SmartthingsServlet] - Smartthing servlet function requested: state with Method: POST 11:36:19.433 [DEBUG] [rtthings.internal.SmartthingsServlet] - Smartthing servlet processing "state" request. data: {"deviceDisplayName":"Piano Side Lamp","value":"10.2","capabilityAttribute":"power"} 11:36:19.438 [DEBUG] [s.internal.SmartthingsHandlerFactory] - Event received on topic: org/openhab/binding/smartthings/state 11:36:19.440 [DEBUG] [ngs.handler.SmartthingsBridgeHandler] - received message from Smartthings hub 11:36:19.441 [INFO ] [ngs.handler.SmartthingsBridgeHandler] - Could not map the message from the Smartthings hub: capabilityKey="null" with device name="Piano Side Lamp", capabilityAttribute="power", into an OpenHAB thing/channel, maybe this isn't configured in OpenHAB

Smartthings log:

6524383d-a8a9-4eb5-876a-6dc57a6f9743 11:35:49 AM: info [name:power, value:102, type:power] 6524383d-a8a9-4eb5-876a-6dc57a6f9743 11:35:49 AM: debug description is read attr - raw: 26B0010B040A0B05296600, dni: 26B0, endpoint: 01, cluster: 0B04, size: 0A, attrId: 050b, encoding: 29, value: 0066 6524383d-a8a9-4eb5-876a-6dc57a6f9743 11:35:19 AM: info [name:power, value:41, type:power] 6524383d-a8a9-4eb5-876a-6dc57a6f9743 11:35:19 AM: debug description is read attr - raw: 26B0010B040A0B05292900, dni: 26B0, endpoint: 01, cluster: 0B04, size: 0A, attrId: 050b, encoding: 29, value: 0029 6524383d-a8a9-4eb5-876a-6dc57a6f9743 11:35:19 AM: info [name:switch, value:on, type:switch] 6524383d-a8a9-4eb5-876a-6dc57a6f9743 11:35:19 AM: debug description is on/off: 1 6524383d-a8a9-4eb5-876a-6dc57a6f9743 11:35:18 AM: info [name:switch, value:on, type:switch]

It seems the mapping for this power attribute is not defined?

BobRak commented 7 years ago

Hi:

Thanks for providing such great diagnostic information. It makes helping you much easier. The problem is in your item definition:

Number S1_Piano_Side_Lamp_Power "Piano Side Lamp P [%.1f W]" (gLights, GF_Living) {channel="smartthings:power:Home:PianoSideLampPower:power"}

it should be

Number S1_Piano_Side_Lamp_Power "Piano Side Lamp P [%.1f W]" (gLights, GF_Living) {channel="smartthings:powerMeter:Home:PianoSideLampPower:power"}

If you change power to powerMeter you should be good to go. I have the same device and mine works.

Thanks,

BobRak

mythbai commented 7 years ago

Sorry I was struggling with my OH set up these days due to one rogue zwave device acting up, and didn't get time to pursue this issue. But your suggestion fixed it! Thanks Bob!

BobRak commented 7 years ago

Thanks for letting me know.

mythbai commented 7 years ago

Hi Bob. While this is working great for integrating SmartThings into openHAB, can I also suggest you considering integrating items in OH into SmartThings. I think infrastructure is there, you probably just need a SmartApp and some deviceHandler in ST. The reason being some ppl like me are taking advantage of both world: I use openHAB for critical local rule processing and keep some security/zigbee things still physically bound in ST. I also use SmartThings' notification platform, mobile widget, smart Home Monitor etc., and SmartApps developed by others to manage some non-critical missions, which is kind of convenient sometimes. Due to your integration only support one way, I'm still currently using a customized SmartThing-Mqtt-Bridge for communicating between the two platforms.

I think if you can provide integration from both side, it'll greatly ease up ppl in transitioning from ST to OH. Also, OH's cloud version is not always dependable, if you can find a way to take advantage of ST's notification feature that'd be super awesome. But as a developer myself, I realize it might be too much to ask, and might need to leave for a seperate addon.

BobRak commented 7 years ago

@mythbai I'll keep this in mind for the future. For now I need to do a significant overhaul of what I've already done to make it work with more devices so that is going tp keep me busy for a while.

Bob