Closed hirosan18 closed 5 years ago
失礼します。 私もシーン操作とHueボタンによる操作で同様の問題を抱えていたため、このコードの該当部分をindex.jsにて書き換えたところ、シーンやボタンでの操作では期待通りの修正が行われていましたが、Homeアプリ上でエアコンが「応答なし」と表示され操作できなくなってしまいました(スクリーンショット添付)。 (ただ、SIriからの操作、シーンやボタンによる操作はどの端末からも問題なく動いています。)
@gaojie429
Homeアプリ上でエアコンが「応答なし」と表示され操作できなくなってしまいました
- これはHomeアプリ再起動(一旦タスクKillした後再度アプリ起動)しても起こりますか?
- 「応答なし」と表示されるのはアクセサリを操作(タップしてON/OFF切り替え)しようとしたときですか?それとも何も操作しなくても起こりますか?
- 状況が再現できるなら(再起動しても起こるなら)、その時のhomebridgeのログを共有いただくことは可能ですか?
コードの書き換え部分が一行間違っていたようで、それが原因でこの問題が発生してしまったようです。こちらの確認不足でした、すみません。
また、@hirosan18 さんはスレッド冒頭で
ここで'button': this.record.settings.button, としているのは、エアコンをオフにした状態で温度変更してもエアコンをオンにしないため(buttonを設定せずにサーバにリクエストすると"button":"" として扱われ勝手にエアコンがオンになるから?)だと思いますが
とおっしゃっていますが、このパッチを適用した後、エアコンの電源がオフの状態で温度調節を行うと、エアコンの電源が入って前回の運転モードで運転を開始してしまいます。
以下その時のログとなっています、 「前回起動時の運転モード:暖房、温度スライダ:22度」
[2019-2-3 14:54:26] [エアコン] making request for update: {"temperature":"22"}
[2019-2-3 14:54:26] [エアコン] request to server: {"temperature":"22"}
[2019-2-3 14:54:27] [エアコン] got reponse for update
[2019-2-3 14:54:27] [エアコン] notifying values: {"temp":"22","mode":"warm","vol":"","dir":"","button":"","updated_at":"2019-02-03T05:54:27Z"}
@gaojie429 検証ありがとうございます。 バグってたので修正しました😇
早速の修正ありがとうございます! オフ状態で温度スライダを変更してもエアコンがオンにならないようになりました!
遅くなってしまいすみません、ありがとうございます 🙏 後ほど動作確認してマージしたいと思います!
@hirosan18 @gaojie429 遅くなりましたがマージしました!ありがとうございました 🙇
このプラグインを使用してHomeアプリに設定したエアコンに対して、 シーンを用いてON/OFFの切り替えを行えるように対応します
現状、シーンを使用してエアコンを操作すると、
モードの変更
と温度の変更
が別命令としてHomeBridgeに連携されるようで、 以下のログのような動きになってしまいます。 (ここのログを変更してパラメータをわかりやすくしています)エアコンがONの状態で、OFF(26℃)にするシーンを動作させた場合
エアコンがOFFの状態で、ON(26℃)にするシーンを動作させた場合
温度の変更を処理する際に、 ここで
'button': this.record.settings.button,
としているのは、エアコンをオフにした状態で温度変更してもエアコンをオンにしないため(button
を設定せずにサーバにリクエストすると"button":""
として扱われ勝手にエアコンがオンになるから?)だと思いますが、モードの変更
→温度の変更
とHomeアプリが命令した場合に温度の変更
で以前のbuttonの状態(モードの変更する前の状態)
を見てしまっているため、 状態の不整合が起こってしまっています(モードの変更
時に変更したbuttonがその時点ではthis.record.settings
に保存されていないため)対応の方針としては
モードの変更
と温度の変更
が別命令として連携された場合に、サーバに対して2回リクエストする必要もないので、モードの変更
と温度の変更
をマージして処理をする(サーバへのリクエストを若干遅延する)、button
に設定する値を、マージ後のパラメータにbutton
が存在していない場合のみ以前のbuttonの状態(this.record.settings.button)
を設定すると考えました。
あと、homebridge起動時にAPIエラーで温度が取得できなかった場合に
getTargetTemperature
でクラッシュする場合があるので、確認する処理も入れています。ご確認お願いします🙇♂️
以下の環境で問題を確認していますが、環境次第で問題が起きない可能性もあります。 端末 iPhone7 バージョン 12.1.2 (16C104) モデル NNCV2J/A