hypweb.net
XOOPSマニア  最新情報のRSS(サイト全体)
[ 自宅サーバーWebRing |ID=54 前後5表示乱移動サイト一覧 ]

TOP » UsersWiki » calendar nao-pon/blog/2021.06
Archives
2003
1 2 3 4 5 6 7 8 9 10 11 12
2004
1 2 3 4 5 6 7 8 9 10 11 12
2005
1 2 3 4 5 6 7 8 9 10 11 12
2006
1 2 3 4 5 6 7 8 9 10 11 12
2007
1 2 3 4 5 6 7 8 9 10 11 12
2008
1 2 3 4 5 6 7 8 9 10 11 12
2009
1 2 3 4 5 6 7 8 9 10 11 12
2010
1 2 3 4 5 6 7 8 9 10 11 12
2011
1 2 3 4 5 6 7 8 9 10 11 12
2012
1 2 3 4 5 6 7 8 9 10 11 12
2013
1 2 3 4 5 6 7 8 9 10 11 12
2014
1 2 3 4 5 6 7 8 9 10 11 12
2015
1 2 3 4 5 6 7 8 9 10 11 12
2016
1 2 3 4 5 6 7 8 9 10 11 12
2017
1 2 3 4 5 6 7 8 9 10 11 12
2020
1 2 3 4 5 6 7 8 9 10 11 12
2021
1 2 3 4 5 6 7 8 9 10 11 12
2022
1 2 3 4 5 6 7 8 9 10 11 12
2023
1 2 3 4 5 6 7 8 9 10 11 12
<< 2021.6 >>
[nao-pon/blog]
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 16 17 18 19
21 22 23 24 25 26
27 28 29 30      
 
RSS of nao-pon/blog

ミンティア[MINTIA] で WiFi 6ボタンスイッチを作った :-D anchor.png

Google Home や Alexa と HomeAssistant を統合しているので、声で大体のことはできる・・・けど。
声を発声して、アシスタントに認識させるのが、面倒くさいと感じる。なんてわがままな! :lol:
だって、正しく認識してくれないと、もう一度言い直したり、見当違いのスイッチを ON/OFF されたり・・・

そこで、やっぱり物理ボタンですよ!

ちょうど手元にミンティアとESP-32が転がっていて・・・。ん?これ入るんじゃね?って思ったところ。

おぉー!やっぱりピッタリじゃないですか!厚みが若干きついけど。

で、結果こうなりました。やっぱりボタンで操作できるのは快適です。USB電源はいるけどね。

DSC_3857.JPGDSC_3856.JPG

ボタンの穴あけを少し失敗したけど、今度作るときはもう少しきちんと作ろう!

ボタンを押すと青いLEDが光ります。

Page Top

いるもの *1 anchor.png

Page Top

ESPHome の設定 anchor.png

esp32_ble_tracker は、手元に Qmote-S があったので、うまく使えないかな?と思って試してみたけど、検知範囲が狭くてほぼ使えなかった。残念。

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
substitutions:
  devicename: switch_box_11
 
esphome:
  name: $devicename
  platform: ESP32
  board: wemos_d1_mini32
  on_boot:
    - priority: 1000
      then:
        - while:
            condition:
              not:
                api.connected:
            then:
            - switch.turn_on: led
            - delay: 500ms 
            - switch.turn_off: led
            - delay: 500ms
 
wifi:
  networks: !include common/wifi.networks.yaml
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap: !include common/wifi.ap.yaml
 
  manual_ip:
    static_ip: 192.168.1.xx
    gateway: 192.168.1.1
    subnet: 255.255.255.0
 
captive_portal:
 
# Enable logging
logger:
 
# Enable Home Assistant API
api:
 
ota:
 
esp32_ble_tracker:
  id: ble_tracker
 
  on_ble_manufacturer_data_advertise:
    - mac_address: 88:4A:XX:XX:DE:52
      manufacturer_id: 004C
      then:
        - lambda: |-
            if (id(qmote_de52_click).state == false) {
              id(qmote_de52_click).publish_state(true);
              id(qmote_de52_click).publish_state(false);
            }
    - mac_address: 88:4A:XX:XX:99:BB
      manufacturer_id: 004C
      then:
        - lambda: |-
            if (id(qmote_99bb_click).state == false) {
              id(qmote_99bb_click).publish_state(true);
              id(qmote_99bb_click).publish_state(false);
            }
    - mac_address: 88:4A:XX:XX:9F:03
      manufacturer_id: 004C
      then:
        - lambda: |-
            if (id(qmote_9f03_click).state == false) {
              id(qmote_9f03_click).publish_state(true);
              id(qmote_9f03_click).publish_state(false);
            }
  
binary_sensor:
  - platform: gpio
    pin:
      number: GPIO23
      inverted: True
      mode: INPUT_PULLUP
    name: "$devicename btn1"
    on_press:
      then:
        - switch.turn_on: led
    on_release:
      then:
        - switch.turn_off: led
  - platform: gpio
    pin:
      number: GPIO19
      inverted: True
      mode: INPUT_PULLUP
    name: "$devicename btn2"
    on_press:
      then:
        - switch.turn_on: led
    on_release:
      then:
        - switch.turn_off: led
  - platform: gpio
    pin:
      number: GPIO18
      inverted: True
      mode: INPUT_PULLUP
    name: "$devicename btn3"
    on_press:
      then:
        - switch.turn_on: led
    on_release:
      then:
        - switch.turn_off: led
  - platform: gpio
    pin:
      number: GPIO33
      inverted: True
      mode: INPUT_PULLUP
    name: "$devicename btn4"
    on_press:
      then:
        - switch.turn_on: led
    on_release:
      then:
        - switch.turn_off: led
  - platform: gpio
    pin:
      number: GPIO05
      inverted: True
      mode: INPUT_PULLUP
    name: "$devicename btn5"
    on_press:
      then:
        - switch.turn_on: led
    on_release:
      then:
        - switch.turn_off: led
  - platform: gpio
    pin:
      number: GPIO26
      inverted: True
      mode: INPUT_PULLUP
    name: "$devicename btn6"
    on_press:
      then:
        - switch.turn_on: led
    on_release:
      then:
        - switch.turn_off: led
  - platform: template
    id: qmote_de52_click
    name: "$devicename Qmote de52 Click"
    filters:
      delayed_off: 800ms
    on_press:
      then:
        - switch.turn_on: led
    on_release:
      then:
        - switch.turn_off: led
  - platform: template
    id: qmote_99bb_click
    name: "$devicename Qmote 99bb Click"
    filters:
      delayed_off: 800ms
    on_press:
      then:
        - switch.turn_on: led
    on_release:
      then:
        - switch.turn_off: led
  - platform: template
    id: qmote_9f03_click
    name: "$devicename Qmote 9f03 Click"
    filters:
      delayed_off: 800ms
    on_press:
      then:
        - switch.turn_on: led
    on_release:
      then:
        - switch.turn_off: led
 
sensor:
  - platform: wifi_signal
    name: "$devicename WiFi"
    update_interval: 60s
    unit_of_measurement: "%"
    filters:
      - lambda: x = 2 * (x + 100); if (x < 0) {x = 0;} else if (x > 100) {x = 100;} return x;
 
switch:
  - platform: restart
    name: "$devicename Restart"
  - platform: gpio
    pin:
      number: GPIO2
    name: "$devicename LED"
    id: led

 
RSS of nao-pon/blog

Tasmota を 9.4.0 から 9.5.0 へアップデート anchor.png

210620-214752.png

エアコンのWiFi化は、Tasmota をカスタマイズした独自ビルドを使っているけど、Tasmota 9.5.0 がリリースされたので、アップデートした。

次に実行するときは、多分忘れているだろうから、自分用の覚書を書いておく。

Page Top

自前 GitHub リポジトリ anchor.png

IRremoteESP8266 は、とにかく最新版を使うようにしている。

master ブランチは upstream の master を参照している。

1
2
3
4
5
6
git diff master > _diff1.txt
git checkout master
git pull
git checkout mitsu_pana_custom
git rebase master
git diff master > _diff2.txt

で、_diff1.txt と _diff2.txt を比較して、問題なくカスタマイズ分が反映されているか確認する。

 diff _diff1.txt _diff2.txt > _diff3.txt
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
2c2
< index f194430..9284250 100644
---
> index 316d756..4a05193 100644
75c75
< @@ -1375,12 +1429,13 @@ void IRac::midea(IRMideaAC *ac,
---
> @@ -1367,12 +1421,13 @@ void IRac::midea(IRMideaAC *ac,
90c90
< @@ -1394,10 +1449,12 @@ void IRac::mitsubishi(IRMitsubishiAC *ac,
---
> @@ -1386,10 +1441,12 @@ void IRac::mitsubishi(IRMitsubishiAC *ac,
105c105
< @@ -1613,8 +1670,8 @@ void IRac::panasonic(IRPanasonicAc *ac, const panasonic_ac_remote_model_t model,
---
> @@ -1605,8 +1662,8 @@ void IRac::panasonic(IRPanasonicAc *ac, const panasonic_ac_remote_model_t model,
116c116
< @@ -1626,6 +1683,11 @@ void IRac::panasonic(IRPanasonicAc *ac, const panasonic_ac_remote_model_t model,
---
> @@ -1618,6 +1675,11 @@ void IRac::panasonic(IRPanasonicAc *ac, const panasonic_ac_remote_model_t model,
128c128
< @@ -2304,11 +2366,11 @@ bool IRac::sendAc(const decode_type_t vendor, const int16_t model,
---
> @@ -2296,11 +2358,11 @@ bool IRac::sendAc(const decode_type_t vendor, const int16_t model,
142c142
< @@ -2609,7 +2671,7 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
---
> @@ -2601,7 +2663,7 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
151c151
< @@ -2665,7 +2727,7 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
---
> @@ -2657,7 +2719,7 @@ bool IRac::sendAc(const stdAc::state_t desired, const stdAc::state_t *prev) {
160c160
< @@ -2827,7 +2889,7 @@ bool IRac::cmpStates(const stdAc::state_t a, const stdAc::state_t b) {
---
> @@ -2819,7 +2881,7 @@ bool IRac::cmpStates(const stdAc::state_t a, const stdAc::state_t b) {
227c227
< index 99b103f..4cfb3d6 100644
---
> index 20fd7d0..0cbc259 100644
248c248
< index 3ec5303..523ebd0 100644
---
> index 5d16c85..acf57a5 100644
251c251
< @@ -551,6 +551,8 @@ namespace irutils {
---
> @@ -552,6 +552,8 @@ namespace irutils {

問題ない。

1
2
3
4
git checkout development
git pull
git checkout irremote_full_custom
git merge development

今回は大丈夫だったけど、lib/lib_basic/IRremoteESP8266 でコンフリクトが生じるかも知れない。
そんなときは、次のようにとりあえず development 側を適用しておけばいいかな。知らんけど。

Everything is expanded.Everything is shortened.
1
2
3
 
 
 
git checkout --theirs lib/lib_basic/IRremoteESP8266
git add lib/lib_basic/IRremoteESP8266
git commit

違った!そういえば、platformio_override.ini で lib_extra_dirs を違うディレクトリを指定してあり、IRremoteESP8266 の Git ディレクトリにシンボリックを張ってあった。

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
[env:tasmota-ircustom]
build_flags             = ${common.build_flags} ${irremoteesp_full.build_flags} -DFIRMWARE_IR_CUSTOM
 
[env:ir_jema_bridge]
extends                     = env:tasmota-ircustom
lib_extra_dirs              = lib/lib.bak
 
[env:ir_jema_bridge_ccs811]
extends                     = env:tasmota-ircustom
lib_extra_dirs              = lib/lib.bak, lib/lib_i2c
;build_flags                 = ${env:tasmota-ircustom.build_flags} -DUSE_CCS811_V2
;build_flags                 = ${env:tasmota-ircustom.build_flags} -DUSE_CCS811_V2_10SEC
build_flags                 = ${env:tasmota-ircustom.build_flags} -DUSE_CCS811_V2_60SEC

xdrv_05_irremote_full.ino をカスタマイズした、xdrv_05_irremote_full_custom.ino をビルドに使っているので、内容を確認してカスタマイズ分が反映されているか確認する。

今回は Settings.param が Settings->param に変更になっていたので、それを WinMerge でさくっと修正した。

同様に、カスタマイズで使用している xsns_31_ccs811_v2_10sec.ino と xsns_31_ccs811_v2_60sec.ino も確認。
今回、こちらは大丈夫だった。

lib/lib_basic/IRremoteESP8266 を nao-pon/IRremoteESP8266 の mitsu_pana_custom で上書きする。

git commit

これで OK かな。

とりあえず、

pio run

でビルドしてみる、大丈夫っぽい。

OTA で更新可能にしてるので、試しに一台アップデートしてみたところ、問題ないようだったので全台アップデートした。

  • OTA URL は下記で公開しています。よろしければ使ってください。ただし、自己責任でお願いします。

    Panasonic, Mitsubishi, Toshiba のエアコンが有効になっています。

    HomeAssistant との統合は、Tasmota-IRHVAC をこの拡張分に対応させた nao-pon/Tasmota-IRHVAC を使用してください。

    • http://hypweb.net/tasmota/firmware/ir_jema_bridge.bin.gz
    • http://hypweb.net/tasmota/firmware/ir_jema_bridge_ccs811.bin.gz (CCS811 1分間隔更新)


*1 価格は購入時のもの
*2 Aliexpress で買ったけど、技適マークはついていました。

トップ 印刷に適した表示   ページ新規作成 全ページ一覧 単語検索 最新ページの一覧   ヘルプ   最新ページのRSS 1.0 最新ページのRSS 2.0 最新ページのRSS Atom Powered by xpWiki
このページのTopへ
メインメニュー
ログイン

ユーザー名:


パスワード:





パスワード紛失  |新規登録
最近の更新
オンライン状況
393 人のユーザが現在オンラインです。 (10 人のユーザが UsersWiki を参照しています。)

登録ユーザ: 0
ゲスト: 393

もっと...
サイト情報