User Tools

Site Tools


informatica:iot:home_assistant

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
informatica:iot:home_assistant [2021/03/13 15:38] joseinformatica:iot:home_assistant [2023/10/02 22:21] (current) – [Sensor humedad (Mi Flora)] jose
Line 1: Line 1:
 +https://github.com/zigbee2mqtt/hassio-zigbee2mqtt
 +
 ====== Instalación ====== ====== Instalación ======
 +===== Docker Supervised =====
 +https://www.home-assistant.io/installation/linux#install-home-assistant-supervised
 +
 +No está soportada para Raspian, solo para Debian
 +
 +
 +===== Docker =====
 +Mapeaomos con /dev/ttyACM0 el dispositivo Zigbee USB, en nuestro caso el "Conbee II"
 +  docker run -d --device /dev/ttyACM0:/dev/ttyACM0  --name homeassistant   --privileged   --restart=unless-stopped   -e TZ="Europe/Madrid"   -v /home/ruth/homeassistant:/config   --network=host   ghcr.io/home-assistant/home-assistant:stable
 +
 +Vamos a "Devices & Services"
 +{{:informatica:iot:home_assistant_01.png|}}
 +
 +Y seleccionamos ConBee II para configurarlo
 +
 +{{:informatica:iot:home_assistant_01.png|}}
 +
 +Seleccionamos "Keep radio Settings"
 +{{:informatica:iot:home_assistant_03.png|}}
 +
 +Aparece Success
 +{{:informatica:iot:home_assistant_04.png|}}
 +
 +Y ya nos aparece en "Configured" para poder usarla
 +{{:informatica:iot:home_assistant_05.png|}}
 +
 +===== Docker Antiguo=====
 +Fuente: https://github.com/home-assistant/supervised-installer
 +
 +Instalamos raspbian
 +  sudo dd if=2021-01-11-raspios-buster-armhf-lite.img of=/dev/mmcblk0 bs=4M && sync
 +
 +==== Habilitar wifi ====
 +  rootfs/etc/wpa_supplicant/wpa_supplicant.conf
 +<code>
 +country=ES
 +ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
 +update_config=1
 +
 +network={
 +scan_ssid=1
 +ssid="<mi_red_wifi>"
 +psk="<mi_contraseña_wifi>"
 +key_mgmt=WPA-PSK
 +}
 +</code>
 +
 +==== IP fija ====
 +En la partición rootfs editamos el fichero:
 +  rootfs/etc/dhcpcd.conf
 +Depende si queremos editar wifi o cable ponemos eth0 o wlan0. Por ejemplo, poner por wifi la ip 192.168.1.191
 +<code>
 +interface wlan0
 +static ip_address=192.168.1.191/24
 +static routers=192.168.1.1
 +static domain_name_servers=192.168.1.1
 +</code>
 +
 +==== Habilitar SSH ====
 +Creamos un fichero que se llame ssh en la partición boot. Da igual que esté vacio. Podemos hacer:
 +  touch boot/ssh
 +
 +==== Instalación de Docker ====
 +Como root
 +  curl -sSL https://get.docker.com | sh
 +  apt-get install -y apparmor-utils apt-transport-https avahi-daemon ca-certificates curl dbus jq network-manager socat software-properties-common
 +  curl -Lo installer.sh https://raw.githubusercontent.com/home-assistant/supervised-installer/master/installer.sh
 +  bash installer.sh --machine raspberrypi4
 +
 +Adicionalmente metemos al usuario pi para que pueda ejecutar docker:
 +    usermod -aG docker pi
 +
 +
 +
 +===== Imagen Core Home Assistant =====
  
 Fuente: https://www.home-assistant.io/installation/raspberrypi Fuente: https://www.home-assistant.io/installation/raspberrypi
Line 41: Line 118:
  
 {{:informatica:iot:home_07.png|}} {{:informatica:iot:home_07.png|}}
 +
 +==== Configuración de Wifi e IP fija ====
 +Vamos a Supervisor > System > Host
 +
  
 Para poder editar ficheros de configuración, instalamos el add-on "file editor" Para poder editar ficheros de configuración, instalamos el add-on "file editor"
Line 53: Line 134:
  
 Para poder subir ficheros, instalamos el addon de samba Para poder subir ficheros, instalamos el addon de samba
 +
 +====== MQTT ======
 +
  
 ====== Spotify ====== ====== Spotify ======
Line 170: Line 254:
  
  
-Seleccionamos Other. Abrimos el cubo y apretamos el botón de link hasta que se apague la luz azul. Después de unos 10 segundos, se ha emparejado y nos aparece esto en la pantalla. Pulsamos Ready+Seleccionamos Other. Abrimos el cubo y apretamos el botón de link hasta que se apague la luz azul, primero parpadea pero se apaga en seguida. Después de unos 10 segundos, se ha emparejado y nos aparece esto en la pantalla. Pulsamos Ready
  
 {{:informatica:iot:home_26.png|}} {{:informatica:iot:home_26.png|}}
Line 215: Line 299:
 3 - C4:7C:8D:6C:0A:98 3 - C4:7C:8D:6C:0A:98
 4 - C4:7C:8D:6C:16:60 4 - C4:7C:8D:6C:16:60
 +5 - C4:7C:8D:6C:07:3A
 +6 - C4:7C:8D:6C:0A:8E
 + 
 +
 </code> </code>
-Vamos a deCONZ > Phoscon > Sensors > Add New Sensors > Other +Son sensores bluetooth no Zigbee
- +
-Ponemos el sensor muy cerca del Gateway para buscarlo +
- +
-{{:informatica:iot:sensor_00.png|}} +
- +
-Cuando lo encuentre, nos pondrá Sensor Ready +
- +
-{{:informatica:iot:sensor_01.png|}}+
  
-Para sabes la MAC lanzamos el comando bluetoothctl:+Para sabes la MAC lanzamos el comando para scanear: 
 +  bluetoothctl scan on
 <code> <code>
 $ bluetoothctl  $ bluetoothctl 
-Agent registered +Discovery started 
-[DEL] Device 56:60:BB:D0:56:D1 Comedor +[CHG] Device 56:60:BB:D0:56:D1 Comedor 
-[DEL] Device C4:7C:8D:6C:13:75 Flower care +[NEW] Device C4:7C:8D:6C:13:75 Flower care 
-[DEL] Device B8:78:2E:1E:90:2A B8-78-2E-1E-90-2A +[NEW] Device B8:78:2E:1E:90:2A B8-78-2E-1E-90-2A
-[bluetooth]# +
 </code> </code>
  
Line 240: Line 320:
 Añadimos lo siguiente en configuration.yml: Añadimos lo siguiente en configuration.yml:
 <code> <code>
-sensor:                                                                                                                                                                          +sensor: 
-  - platform: miflora                                                                                                                                                            +  - platform: miflora 
-    mac: "C4:7C:8D:6C:13:75 "                                                                                                                                                    +    mac: "C4:7C:8D:6C:13:75" 
-    name: Flower 2                                                                                                                                                               +    name: Flower 2 
-    force_update: true                                                                                                                                                           +    force_update: true 
-#    median: 3                                                                                                                                                                   +#    median: 3 
-    monitored_conditions:                                                                                                                                                        +    monitored_conditions: 
-      - moisture                                                                                                                                                                 +      - moisture 
-      - light                                                                                                                                                                    +      - light 
-      - temperature                                                                                                                                                              +      - temperature 
-      - conductivity                                                                                                                                                             +      - conductivity 
-      - battery                                                                                                                                                                 +      - battery
     scan_interval: 60     scan_interval: 60
 </code> </code>
informatica/iot/home_assistant.1615649912.txt.gz · Last modified: 2021/03/13 15:38 by jose