NorthernMan54 / homebridge-yamaha-home

Homebridge plugin for my Yamaha Receiver optimized for use with the Home App and Alexa
26 stars 9 forks source link

Scene_Sel instead of Scene_Load #8

Closed jczwo closed 6 years ago

jczwo commented 6 years ago

My Yamaha definetly needs Scene_Sel.

TommyCardello commented 6 years ago

I agree with your changes on Scene_Sel.

But I am not sure about your changes to remove power off scene switch functionality. I'll test it later today, but for now, I have some doubts.

When I developed this function, idea was to use a switch to turn on input (or scene) and being able to turn the receiver off using the same switch. If I need to change input/scene, I press a different switch. When a different switch has been turned off, previous switch status will be updated to Off.

The way you changed it when you press scene switch off, it will do nothing. iOS Home app will turn it off, but in reality, nothing will happen.

It still will work, but I thought it's not logical when the switch does nothing when you turn it off. Let me know your thoughts.

TommyCardello commented 6 years ago

Okay,

I have tested everything. Your changes make sense.

Scene_Sel works same as Scene_Load. Hopefully, it will work for others.

Removing turnoff functionality from scene switch is not what I wanted to do, but I agree, it makes sense.

So, everything works fine. Pull can be merged.

jczwo commented 6 years ago

Sorry for not explaining poweroff removal. I think most people would like to switch scenes without shutting down their device. Poweroff make no sense to me. There are other switches for that.

NorthernMan54 commented 6 years ago

Ok, I will publish this latest PR tonight

Sent from my iPad

On Jun 14, 2018, at 1:26 AM, jczwo notifications@github.com wrote:

Sorry for not explaining poweroff removal. I think most people would like to switch scenes without shutting down their device. Poweroff make no sense to me. There are other switches for that.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.

NorthernMan54 commented 6 years ago

@jczwo @TommyCardello Thanks very much guys, I just published this.

NorthernMan54 commented 6 years ago

@jczwo @TommyCardello I'm just trying this feature out and it works great, I'm using it to flip between tuner and spotify and is really useful. My only comment was how the switches are handled, when I flip between the two, the switch stays "On" even when the mode is no longer active. Would it make sense to flip the switch off, when another scene is selected? Mind you this would only work correctly if you only used homebridge to control the receiver and not the remote itself.

TommyCardello commented 6 years ago

@NorthernMan54 Sure, I'll explain what I have found.

  1. GET method gets current input name and compares it to switch name in config.json. But Not the scene. Yamaha does not return current scene status. That's the reason why I strongly recommend to specify input in config.json when you add new scene switch. This way status will be updated correctly. Unless someone has a different solution.

  2. The status will be updated but there is a delay. When you select different switch and previous stays on, you can force restart iOS app and previous switch status will be updated. I need to check why this delays happens. I use different plugin for turning on music on apple tv, and that switch updates instantly. I'll take a look how to avoid status update delay and if it's possible.

NorthernMan54 commented 6 years ago

I’m just doing this

"inputs_as_accessories":{ "YamahaReceiver": { "1": { "name":"Radio", "setInputTo": "TUNER" }, "2": { "name":"Spotify", "setInputTo": "Spotify" } }

I thinking just a simple state machine between the group of buttons, so if I turn on 1, it turns off the others.

PS If you name a button “Spotify” both Alexa and Siri treat is as a reserved word and turn on the native Spotify for each.

On Jun 15, 2018, at 1:36 PM, Artem Dyachuk notifications@github.com wrote:

@NorthernMan54 https://github.com/NorthernMan54 Sure, I'll explain what I have found.

GET method gets current input name and compares it to switch name in config.json. But Not the scene. Yamaha does not return current scene status. That's the reason why I strongly recommend to specify input in config.json when you add new scene switch. This way status will be updated correctly. Unless someone has a different solution.

The status will be updated but there is a delay. When you select different switch and previous stays on, you can force restart iOS app and previous switch status will be updated. I need to check why this delays happens. I use different plugin for turning on music on apple tv, and that switch updates instantly. I'll take a look how to avoid status update delay and if it's possible.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/NorthernMan54/homebridge-yamaha-home/pull/8#issuecomment-397692113, or mute the thread https://github.com/notifications/unsubscribe-auth/AS5CmBZg-xqH8qt-u-Ht8RIfkx1qS4hzks5t8_CwgaJpZM4UmzNT.

TommyCardello commented 6 years ago

I haven't tested it with anything other than HDMI and AUDIO inputs. Yes, seems like the state machine will do the job. I've never done that, so I'll research for the solution.

I have checked code, which I mentioned above. That's homebridge-dacp plugin. They use a state machine for updating status. And that works flawlessly. Even when I pause the music using AppleTV remote, switch status in home app updates instantly. I need to research how to do that. I'm still learning all this coding stuff :)

Let me know if you have any ideas.