558 lines
11 KiB
Org Mode
558 lines
11 KiB
Org Mode
#+TITLE: IoT
|
|
#+SETUPFILE: ./setup/org-setup-file.org
|
|
|
|
* Smart Bulbs
|
|
https://www.amazon.fr/Ecologique-Compatible-T%C3%A9l%C3%A9commande-Smartphone-%C3%A9nerg%C3%A9tique/dp/B07KWPQMHH/ref=sr_1_4?dchild=1&keywords=Anoopsyche&qid=1626991095&sr=8-4
|
|
|
|
* Smart Plugs
|
|
https://sonoff.tech/product/smart-plug/s26/
|
|
|
|
https://www.jannikarndt.de/blog/2018/01/how_to_install_tasmota_on_a_sonoff_device_without_opening_it/
|
|
https://www.youtube.com/watch?v=ONFhXM5R-t4
|
|
|
|
* ESPHome
|
|
** Sonoff S26 - Smart Socket
|
|
https://www.amazon.fr/Connect%C3%A9e-Intelligente-Compatible-Assistant-T%C3%A9l%C3%A9command%C3%A9e/dp/B07Y1N5J6Y/
|
|
|
|
*** Sonoff S26 1
|
|
#+begin_src yaml :noweb yes :tangle ~/.local/data/esphome/config/sonoff_S26_1.yaml
|
|
esphome:
|
|
name: sonoffs26_1
|
|
platform: ESP8266
|
|
board: esp01_1m
|
|
board_flash_mode: dout
|
|
|
|
wifi:
|
|
ssid: 'Freebox-11A882'
|
|
password: '<<get-password(passname="wifi/Freebox-11A882")>>'
|
|
ap:
|
|
ssid: 'Sonoff S26 1 Fallback Hotspot'
|
|
password: '<<get-password(passname="sonoff_s26/ap")>>'
|
|
|
|
status_led:
|
|
pin:
|
|
number: GPIO13
|
|
inverted: false
|
|
logger:
|
|
|
|
api:
|
|
password: '<<get-password(passname="sonoff_s26/api")>>'
|
|
|
|
ota:
|
|
password: '<<get-password(passname="sonoff_s26/ota")>>'
|
|
|
|
web_server:
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO0
|
|
mode: INPUT_PULLUP
|
|
inverted: True
|
|
name: "Sonoff S26_1 Button"
|
|
on_press:
|
|
- switch.toggle: relay
|
|
- platform: status
|
|
name: "Sonoff S26_1 Status"
|
|
|
|
sensor:
|
|
- platform: wifi_signal
|
|
name: "sonoffs26_1 WiFi Signal"
|
|
update_interval: 60s
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: "Sonoff S26_1 Relay"
|
|
pin: GPIO12
|
|
id: 'relay'
|
|
- platform: restart
|
|
name: "sonoffs26_1 Restart"
|
|
#+end_src
|
|
|
|
*** Sonoff S26 2
|
|
#+begin_src yaml :noweb yes :tangle ~/.local/data/esphome/config/sonoff_S26_2.yaml
|
|
esphome:
|
|
name: sonoffs26_2
|
|
platform: ESP8266
|
|
board: esp01_1m
|
|
board_flash_mode: dout
|
|
|
|
wifi:
|
|
ssid: 'Freebox-11A882'
|
|
password: '<<get-password(passname="wifi/Freebox-11A882")>>'
|
|
ap:
|
|
ssid: 'Sonoff S26 2 Fallback Hotspot'
|
|
password: '<<get-password(passname="sonoff_s26/ap")>>'
|
|
|
|
status_led:
|
|
pin:
|
|
number: GPIO13
|
|
inverted: false
|
|
logger:
|
|
|
|
api:
|
|
password: '<<get-password(passname="sonoff_s26/api")>>'
|
|
|
|
ota:
|
|
password: '<<get-password(passname="sonoff_s26/ota")>>'
|
|
|
|
web_server:
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO0
|
|
mode: INPUT_PULLUP
|
|
inverted: True
|
|
name: "Sonoff S26_2 Button"
|
|
on_press:
|
|
- switch.toggle: relay
|
|
- platform: status
|
|
name: "Sonoff S26_2 Status"
|
|
|
|
sensor:
|
|
- platform: wifi_signal
|
|
name: "sonoffs26_2 WiFi Signal"
|
|
update_interval: 60s
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: "Sonoff S26_2 Relay"
|
|
pin: GPIO12
|
|
id: 'relay'
|
|
- platform: restart
|
|
name: "sonoffs26_2 Restart"
|
|
#+end_src
|
|
|
|
*** Sonoff S26 3
|
|
#+begin_src yaml :noweb yes :tangle ~/.local/data/esphome/config/sonoff_S26_3.yaml
|
|
esphome:
|
|
name: sonoffs26_3
|
|
platform: ESP8266
|
|
board: esp01_1m
|
|
board_flash_mode: dout
|
|
|
|
wifi:
|
|
ssid: 'Freebox-11A882'
|
|
password: '<<get-password(passname="wifi/Freebox-11A882")>>'
|
|
ap:
|
|
ssid: 'Sonoff S26 3 Fallback Hotspot'
|
|
password: '<<get-password(passname="sonoff_s26/ap")>>'
|
|
|
|
status_led:
|
|
pin:
|
|
number: GPIO13
|
|
inverted: false
|
|
logger:
|
|
|
|
api:
|
|
password: '<<get-password(passname="sonoff_s26/api")>>'
|
|
|
|
ota:
|
|
password: '<<get-password(passname="sonoff_s26/ota")>>'
|
|
|
|
web_server:
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO0
|
|
mode: INPUT_PULLUP
|
|
inverted: True
|
|
name: "Sonoff S26_3 Button"
|
|
on_press:
|
|
- switch.toggle: relay
|
|
- platform: status
|
|
name: "Sonoff S26_3 Status"
|
|
|
|
sensor:
|
|
- platform: wifi_signal
|
|
name: "sonoffs26_3 WiFi Signal"
|
|
update_interval: 60s
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: "Sonoff S26_3 Relay"
|
|
pin: GPIO12
|
|
id: 'relay'
|
|
- platform: restart
|
|
name: "sonoffs26_3 Restart"
|
|
#+end_src
|
|
|
|
*** Sonoff S26 4
|
|
#+begin_src yaml :noweb yes :tangle ~/.local/data/esphome/config/sonoff_S26_4.yaml
|
|
esphome:
|
|
name: sonoffs26_4
|
|
platform: ESP8266
|
|
board: esp01_1m
|
|
board_flash_mode: dout
|
|
|
|
wifi:
|
|
ssid: 'Freebox-11A882'
|
|
password: '<<get-password(passname="wifi/Freebox-11A882")>>'
|
|
ap:
|
|
ssid: 'Sonoff S26 4 Fallback Hotspot'
|
|
password: '<<get-password(passname="sonoff_s26/ap")>>'
|
|
|
|
status_led:
|
|
pin:
|
|
number: GPIO13
|
|
inverted: false
|
|
logger:
|
|
|
|
api:
|
|
password: '<<get-password(passname="sonoff_s26/api")>>'
|
|
|
|
ota:
|
|
password: '<<get-password(passname="sonoff_s26/ota")>>'
|
|
|
|
web_server:
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO0
|
|
mode: INPUT_PULLUP
|
|
inverted: True
|
|
name: "Sonoff S26_4 Button"
|
|
on_press:
|
|
- switch.toggle: relay
|
|
- platform: status
|
|
name: "Sonoff S26_4 Status"
|
|
|
|
sensor:
|
|
- platform: wifi_signal
|
|
name: "sonoffs26_4 WiFi Signal"
|
|
update_interval: 60s
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: "Sonoff S26_4 Relay"
|
|
pin: GPIO12
|
|
id: 'relay'
|
|
- platform: restart
|
|
name: "sonoffs26_4 Restart"
|
|
#+end_src
|
|
|
|
** Anoopsyche SB14 - E27 Smart Bulb (Cold White / Warm White)
|
|
https://www.amazon.fr/Ecologique-Compatible-T%C3%A9l%C3%A9commande-Smartphone-%C3%A9nerg%C3%A9tique/dp/B07KWPQMHH/
|
|
|
|
*** Anoopsyche CWWW 1
|
|
#+begin_src yaml :noweb yes :tangle ~/.local/data/esphome/config/anoopsyche_cwww_1.yaml
|
|
esphome:
|
|
name: anoopsyche_cwww_1
|
|
platform: ESP8266
|
|
board: esp01_1m
|
|
|
|
wifi:
|
|
ssid: 'Freebox-11A882'
|
|
password: '<<get-password(passname="wifi/Freebox-11A882")>>'
|
|
|
|
ap:
|
|
ssid: 'Anoopsyche CWWW 1'
|
|
password: '<<get-password(passname="anoopsyche_cwww/ap")>>'
|
|
|
|
captive_portal:
|
|
|
|
# Enable logging
|
|
logger:
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
password: '<<get-password(passname="anoopsyche_cwww/api")>>'
|
|
|
|
ota:
|
|
password: '<<get-password(passname="anoopsyche_cwww/ota")>>'
|
|
|
|
output:
|
|
- platform: esp8266_pwm
|
|
id: output_cold_white
|
|
pin: GPIO5
|
|
- platform: esp8266_pwm
|
|
id: output_warm_white
|
|
pin: GPIO13
|
|
|
|
light:
|
|
- platform: cwww
|
|
name: 'Anoopsyche CWWW 1'
|
|
default_transition_length: 1s
|
|
warm_white: output_warm_white
|
|
cold_white: output_cold_white
|
|
cold_white_color_temperature: 6000 K
|
|
warm_white_color_temperature: 2700 K
|
|
#+end_src
|
|
|
|
*** Anoopsyche CWWW 2
|
|
#+begin_src yaml :noweb yes :tangle ~/.local/data/esphome/config/anoopsyche_cwww_2.yaml
|
|
esphome:
|
|
name: anoopsyche_cwww_2
|
|
platform: ESP8266
|
|
board: esp01_1m
|
|
|
|
wifi:
|
|
ssid: 'Freebox-11A882'
|
|
password: '<<get-password(passname="wifi/Freebox-11A882")>>'
|
|
|
|
ap:
|
|
ssid: 'Anoopsyche CWWW 2'
|
|
password: '<<get-password(passname="anoopsyche_cwww/ap")>>'
|
|
|
|
captive_portal:
|
|
|
|
# Enable logging
|
|
logger:
|
|
|
|
# Enable Home Assistant API
|
|
api:
|
|
password: '<<get-password(passname="anoopsyche_cwww/api")>>'
|
|
|
|
ota:
|
|
password: '<<get-password(passname="anoopsyche_cwww/ota")>>'
|
|
|
|
output:
|
|
- platform: esp8266_pwm
|
|
id: output_cold_white
|
|
pin: GPIO5
|
|
- platform: esp8266_pwm
|
|
id: output_warm_white
|
|
pin: GPIO13
|
|
|
|
light:
|
|
- platform: cwww
|
|
name: 'Anoopsyche CWWW 2'
|
|
default_transition_length: 1s
|
|
warm_white: output_warm_white
|
|
cold_white: output_cold_white
|
|
cold_white_color_temperature: 6000 K
|
|
warm_white_color_temperature: 2700 K
|
|
#+end_src
|
|
|
|
** Sonoff BasicR2 - DIY Smart Socket
|
|
- [[https://esphome.io/devices/sonoff_basic.html][ESPHome documentation]]
|
|
- [[https://sonoff.tech/product/diy-smart-switch/basicr2/][Sonoff Website]]
|
|
|
|
*** Sonoff Basic 1
|
|
#+begin_src yaml :noweb yes :tangle ~/.local/data/esphome/config/sonoff_basic_1.yaml
|
|
esphome:
|
|
name: sonoffbasic_1
|
|
platform: ESP8266
|
|
board: esp8285
|
|
arduino_version: 2.4.2
|
|
|
|
wifi:
|
|
ssid: 'Freebox-11A882'
|
|
password: '<<get-password(passname="wifi/Freebox-11A882")>>'
|
|
|
|
api:
|
|
password: '<<get-password(passname="sonoff_basic/api")>>'
|
|
|
|
logger:
|
|
|
|
ota:
|
|
password: '<<get-password(passname="sonoff_basic/ota")>>'
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO0
|
|
mode: INPUT_PULLUP
|
|
inverted: True
|
|
name: "Sonoff Basic Button 1"
|
|
on_press:
|
|
- switch.toggle: relay
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: "Sonoff Basic Relay 1"
|
|
pin: GPIO12
|
|
id: relay
|
|
|
|
status_led:
|
|
pin:
|
|
number: GPIO13
|
|
inverted: yes
|
|
#+end_src
|
|
|
|
*** Sonoff Basic 2
|
|
#+begin_src yaml :noweb yes :tangle ~/.local/data/esphome/config/sonoff_basic_2.yaml
|
|
esphome:
|
|
name: sonoffbasic_2
|
|
platform: ESP8266
|
|
board: esp8285
|
|
arduino_version: 2.4.2
|
|
|
|
wifi:
|
|
ssid: 'Freebox-11A882'
|
|
password: '<<get-password(passname="wifi/Freebox-11A882")>>'
|
|
|
|
api:
|
|
password: '<<get-password(passname="sonoff_basic/api")>>'
|
|
|
|
logger:
|
|
|
|
ota:
|
|
password: '<<get-password(passname="sonoff_basic/ota")>>'
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO0
|
|
mode: INPUT_PULLUP
|
|
inverted: True
|
|
name: "Sonoff Basic Button 2"
|
|
on_press:
|
|
- switch.toggle: relay
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: "Sonoff Basic Relay 2"
|
|
pin: GPIO12
|
|
id: relay
|
|
|
|
status_led:
|
|
pin:
|
|
number: GPIO13
|
|
inverted: yes
|
|
#+end_src
|
|
*** Sonoff Basic 3
|
|
#+begin_src yaml :noweb yes :tangle ~/.local/data/esphome/config/sonoff_basic_3.yaml
|
|
esphome:
|
|
name: sonoffbasic_3
|
|
platform: ESP8266
|
|
board: esp8285
|
|
arduino_version: 2.4.2
|
|
|
|
wifi:
|
|
ssid: 'Freebox-11A882'
|
|
password: '<<get-password(passname="wifi/Freebox-11A882")>>'
|
|
|
|
api:
|
|
password: '<<get-password(passname="sonoff_basic/api")>>'
|
|
|
|
logger:
|
|
|
|
ota:
|
|
password: '<<get-password(passname="sonoff_basic/ota")>>'
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO0
|
|
mode: INPUT_PULLUP
|
|
inverted: True
|
|
name: "Sonoff Basic Button 3"
|
|
on_press:
|
|
- switch.toggle: relay
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: "Sonoff Basic Relay 3"
|
|
pin: GPIO12
|
|
id: relay
|
|
|
|
status_led:
|
|
pin:
|
|
number: GPIO13
|
|
inverted: yes
|
|
#+end_src
|
|
*** Sonoff Basic 4
|
|
#+begin_src yaml :noweb yes :tangle ~/.local/data/esphome/config/sonoff_basic_4.yaml
|
|
esphome:
|
|
name: sonoffbasic_4
|
|
platform: ESP8266
|
|
board: esp8285
|
|
arduino_version: 2.4.2
|
|
|
|
wifi:
|
|
ssid: 'Freebox-11A882'
|
|
password: '<<get-password(passname="wifi/Freebox-11A882")>>'
|
|
|
|
api:
|
|
password: '<<get-password(passname="sonoff_basic/api")>>'
|
|
|
|
logger:
|
|
|
|
ota:
|
|
password: '<<get-password(passname="sonoff_basic/ota")>>'
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO0
|
|
mode: INPUT_PULLUP
|
|
inverted: True
|
|
name: "Sonoff Basic Button 4"
|
|
on_press:
|
|
- switch.toggle: relay
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: "Sonoff Basic Relay 4"
|
|
pin: GPIO12
|
|
id: relay
|
|
|
|
status_led:
|
|
pin:
|
|
number: GPIO13
|
|
inverted: yes
|
|
#+end_src
|
|
|
|
** Sonoff POWR2 - DIY Power Monitoring Smart Socket
|
|
- [[https://sonoff.tech/product/diy-smart-switch/powr2/][Sonoff Website]]
|
|
|
|
*** Sonoff POWR2 1
|
|
#+begin_src yaml :noweb yes :tangle ~/.local/data/esphome/config/sonoff_powr2_1.yaml
|
|
esphome:
|
|
name: sonoffpowr2_1
|
|
platform: ESP8266
|
|
board: esp01_1m
|
|
board_flash_mode: dout
|
|
|
|
wifi:
|
|
ssid: 'Freebox-11A882'
|
|
password: '<<get-password(passname="wifi/Freebox-11A882")>>'
|
|
ap:
|
|
ssid: 'Sonoff POWR2 1 Fallback Hotspot'
|
|
password: 'gmHu3rQHZHwH'
|
|
|
|
mqtt:
|
|
broker: '192.168.1.11'
|
|
|
|
logger:
|
|
|
|
api:
|
|
password: '<<get-password(passname="sonoff_powr2/api")>>'
|
|
|
|
ota:
|
|
password: '<<get-password(passname="sonoff_powr2/ota")>>'
|
|
|
|
uart:
|
|
rx_pin: RX
|
|
baud_rate: 4800
|
|
|
|
sensor:
|
|
- platform: cse7766
|
|
current:
|
|
name: "Sonoff POWR2_1 Current"
|
|
voltage:
|
|
name: "Sonoff POWR2_1 Voltage"
|
|
power:
|
|
name: "Sonoff POWR2_1 Power"
|
|
|
|
binary_sensor:
|
|
- platform: gpio
|
|
pin:
|
|
number: GPIO0
|
|
mode: INPUT_PULLUP
|
|
inverted: True
|
|
name: "Sonoff POWR2_1 Button"
|
|
on_press:
|
|
- switch.toggle: relay
|
|
|
|
switch:
|
|
- platform: gpio
|
|
name: "Sonoff POWR2_1 Relay"
|
|
pin: GPIO12
|
|
id: 'relay'
|
|
#+end_src
|