Wemo Dimmer Help

I am currently trying to add in support for the Wemo Dimmer, after having written the support for it in the pywemo library.

The last big hurdle that I can not get through is the automatic updates of the brightness levels when I change the brightness from the physical switch, or the Wemo app.

This comment on my fork shows exactly what is happening. I do get an event in the HASS console that I have change the brightness on the switch via something other than HASS, but the slider on the HASS GUI does not change from where it was previously.

2 Likes

@angel12

Ran your fork and things seem to be working fine:

INFO:pywemo.subscribe:Received event from <WeMo Dimmer "Living Room Lights">(192.168.XXX.XXX) - Brightness 6
INFO:homeassistant.components.light.wemo:Subscription update for  <WeMo Dimmer "Living Room Lights">
INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state light.living_room_lights=on; brightness=15, min_mireds=154, supported_features=1, max_mireds=500, friendly_name=Living Room Lights @ 2017-11-26T15:05:18.443630-05:00>, old_state=<state light.living_room_lights=on; brightness=22, min_mireds=154, supported_features=1, max_mireds=500, friendly_name=Living Room Lights @ 2017-11-26T15:05:18.443630-05:00>, entity_id=light.living_room_lights>
...
INFO:pywemo.subscribe:Received event from <WeMo Dimmer "Living Room Lights">(192.168.XXX.XXX) - Brightness 100
INFO:homeassistant.components.light.wemo:Subscription update for  <WeMo Dimmer "Living Room Lights">
INFO:homeassistant.core:Bus:Handling <Event state_changed[L]: new_state=<state light.living_room_lights=on; brightness=255, min_mireds=154, supported_features=1, max_mireds=500, friendly_name=Living Room Lights @ 2017-11-26T15:05:18.443630-05:00>, old_state=<state light.living_room_lights=on; brightness=15, min_mireds=154, supported_features=1, max_mireds=500, friendly_name=Living Room Lights @ 2017-11-26T15:05:18.443630-05:00>, entity_id=light.living_room_lights>

Everything updates on the front-end as expected.

Can you try updating the pywemo version to 0.4.22?

There may be a fix in that version that you’re not pulling into your fork.

1 Like

Well, I’ll be damned. Not sure what fixed it then, but it is working on my end. Time to clean my code and submit :slight_smile:

1 Like

Great work on the submission! I’ve been running your fork all day and the dimmer is great! Thanks so much!

Just so you know, there are only 2 files that need to be replaced in HASS, my fork is technically a few versions behind. The two files are under the components folder: wemo.py and light/wemo.py, that way you can run the latest version until I get these changes submitted in a PR

1 Like

Looking forward to this in Hassio!

1 Like

Thanks! That’s what I did. Also had to update requirements_all.txt to pywemo 0.4.22 and delete the existing pywemo folders under deps.

Just patched my local version with your changes. Everything works like a charm! Thanks so much. Looking forward to seeing this change as part of HASS release.

angel12, You are my HERO!!! :blush:

Possible to get this new version running in hass.io? I’ve set up the custom_components folder and put angel12s code in there, but I’m not sure how to update pywemo…

Looks like the pywemo component won’t update. Hopefully there is some workaround and we don’t have to wait for it to be updated in the next release.

I don’t use hass.io, so I am not sure how that is supposed to work. Since this isn’t really a custom component, but a replacement for a component, I would assume you have to replace the component\wemo.py and component\light\wemo.py with my versions, and that should then tell HASS to install the newest version of pywemo because of the requirements in my files.

I will try to take a look at it later today if I get a chance. I submitted a PR on the dev branch, and am working through some of the bugs the bots found.

Thanks!

Yeah, I’ve got all the custom components inplace, so I’m pretty sure hass.io is blocking the update of pywemo.

If this gets merged into the main HA set, it’ll make it into Hassio with the HA update.

I’m using HASS.IO and I manually updated the two wemo.py files as well as the updated “pywemo” version from angel12’s github site and it works like a charm. I’ve waited almost a year for this and I’m very grateful to angel12 for his efforts!

Hey Stew, can you send me the details on how you did that? I’ve been waiting as long as you, and it looks like the updated pywemo component did not make it into todays release.

I think I almost have this figured out. Got the wemo.py files updated in the custom_configuration folder, and I can see this in the logs:

2017-12-05 15:49:41 INFO (MainThread) [homeassistant.components.discovery] Found new service: belkin_wemo 
{'host': '10.0.0.43', 'port': 49153, 'ssdp_description': 'http://10.0.0.43:49153/setup.xml', 'name': 'Table', 'model_name': 
'Dimmer', 'model_number': '1.0', 'serial': '241714K1500120', 'mac_address': '149182D746C6'}

2017-12-05 15:49:41 INFO (MainThread) [homeassistant.core] Bus:Handling <Event platform_discovered[L]: 
service=belkin_wemo, discovered=host=10.0.0.43, port=49153, ssdp_description=http://10.0.0.43:49153/setup.xml, 
name=Table, model_name=Dimmer, model_number=1.0, serial=241714K1500120, mac_address=149182D746C6>

So it looks like HA sees the dimmer, but it does not show up as a light or as any kind of entity. I do see an item called ‘Table’ in the history tab, so I’m kind of lost at this point. Any ideas?

First of all I’m not using the custom_components folder method, I’m actually going to my HA host via SSH and editing the Home Assistant files to update the pywemo files to reflect angel12’s version on his GitHub fork.

This involves editing:
pywemo/discovery.py
pywemo/ssdp.py
pywemo/ __init__.py
and adding file pywemo/ouimeaux_device/dimmer.py

That will get your dimmer to show up as a regular wemo switch but without brightness control.

Then I updated this file with angel12’s version:
homeassistant / components / wemo.py
And added this one from his fork:
homeassistant / components / light / wemo.py

After that the units will appear in HA as lights rather than switches and have brightness and On/Off control.

I don’t think you should have to edit the pywemo files, adding my components/wemo.py should tell HASS that pywemo version needs to be updated to the latest one. At least thats how it works on regular installations, unsure about hass.io still

edit – NM I figured it out. Must have been using old wemo.py versions or something. Everything works now!

Thanks everyone!