nguyer / homeassistant-bond-home

38 stars 15 forks source link

Hotfix/latest bondhome library #11

Closed bcb2000 closed 4 years ago

bcb2000 commented 4 years ago

Changed bond-home library requirement to 0.0.6

niemyjski commented 4 years ago

If we could get this merged in today and released that would be amazing

nguyer commented 4 years ago

Let me run this through some quick testing with my hub. If all looks good, I'll merge.

niemyjski commented 4 years ago

Seems like I have a fan and a light for my fireplace. Light doesn’t do anything but the fan turns it on and off but no fan levels. Should I share my button configuration? I really only have on, off, flame up and down

Sent from my iPhone

On Dec 15, 2019, at 5:51 PM, Nicko Guyer notifications@github.com wrote:

 Let me run this through some quick testing with my hub. If all looks good, I'll merge.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

nguyer commented 4 years ago

@bcb2000 It looks like the bond-home dependency is still at 0.0.4 in this fork. Did you maybe forget to push a commit?

bcb2000 commented 4 years ago

I think there was all sorts wrong with my last push. As I say, complete novice! Please check again now.

nguyer commented 4 years ago

Looks like I'm getting two "medium" speed options in my dropdown. I can try to dig into what's happening, but I'm guessing it's how the mapping is being done. My fans have 6 speeds.

image

nguyer commented 4 years ago

I have tried all the speed settings in the dropdown and it doesn't seem to be working correctly for me. It definitely did change the speed one time, but now it doesn't matter what speed I pick in the frontend, it will not actually change. I confirmed by checking the speed via the local API with Postman, and it was just stuck on "3", no matter what Home Assistant said.

bcb2000 commented 4 years ago

Likely to be in this piece of code, in fan.py:

            if 'max_speed' in self._properties:
                self._speed_high = int(self._properties['max_speed'])
                self._speed_low = int(1)
                self._speed_list.append(SPEED_LOW)
                if self._speed_high > 2:
                    self._speed_list.append(SPEED_MEDIUM)
                    self._speed_medium = (self._speed_high + 1) // 2
                    self._speed_list.append(SPEED_MEDIUM)
                self._speed_list.append(SPEED_HIGH)

I'm not going to get much chance to look at this before Monday next week - and anyway, with my three-speed fan I don't get the same issue.

bcb2000 commented 4 years ago

Incidentally, my fan is configured in Bond with three speeds like this: image

So my three speeds are contiguous - 1, 2, 3. The maths above works - bond gives 3 for high, and 1 for low, and the algebra works out (3+1)//2 = 2 for medium (floor division).

For six speeds, I would expect 6 for high, 1 for low, and (6+1)//2 = 3 for medium.

niemyjski commented 4 years ago

https://github.com/nguyer/homeassistant-bond-home/issues/1#issuecomment-541029386 here are my commands that are being detected as a fan.

{"name":"Fireplace","type":"FP","location":"Living Room","actions":["IncreaseFlame","TurnOn","TurnOff","DecreaseFlame","Stop","TogglePower","SetFlame"],"_":"2acd21ff","commands":{"_":"b172eef0"},"state":{"_":"fb9a8ae1"},"properties":{"_":"9bdfb59f"}}

IMG_6448

niemyjski commented 4 years ago

should we have a service to increase and decrease flame level? For me I have three levels but none doesn’t know that. And I’m not sure how you’d represent as a switch

marciogranzotto commented 4 years ago

btw, I think this is the latest commit, which is including all code from the other PRs. @bcb2000 be careful when opening PRs not to have several of them which include the code from the other ones! I think we could close all the other PRs and merge this one

nguyer commented 4 years ago

I'm going to merge this PR into a feature branch, and then do a little cleanup. I'll close the other PRs since this one supersedes the rest.