> For the complete documentation index, see [llms.txt](https://documentacion.smartnest.cz/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://documentacion.smartnest.cz/integracion-con-homebridge.md).

# 11. Integración con Homebridge

Para controlar tus dispositivos usando Siri y la API de HomeKit, necesitarás:

1. Instalar [Homebridge](https://github.com/homebridge/homebridge) en tu Windows, Linux, Mac, or Raspberry&#x20;
2. Instalar el Plugin [Homebridge Mqttthing](https://github.com/arachnetech/homebridge-mqttthing#readme)
3. Agregar la configuración del dispositivo como aparece abajo, dependiendo del tipo.
4. Abre tu aplicación Home en tu dispositivo iOS y vincula escaneando el código QR del el portal de administración de Homebridge.
5. Renombra tus dispositivos en la aplicación the Home.
6. Listo!

### Configuraciones de dispositivos:

1. **Switch or Light (No Tasmota)**

```javascript
{
    "type": "switch",
    "name": "31141235efb12D367",      //YOUR DEVICE ID
    "url": "smartnest.cz",
    "username": "USERNAME",
    "password": "PASSWORD or API KEY",
    "topics": {
        "getOnline": "31141235efb12D367/report/connected",    //CHANGE HERE TOO
        "getOn": "31141235efb12D367/report/powerState",
        "setOn": "31141235efb12D367/directive/powerState"
    },
    "onlineValue": "Online",
    "offlineValue": "Offline",
    "onValue": "ON",
    "offValue": "OFF",
    "accessory": "mqttthing"
}
```

2\. **Switch or Light (Tasmota)**

```javascript
 {
    "type": "switch",
    "name": "31141235efb12D367",     //YOUR DEVICE ID
    "url": "smartnest.cz",
    "username": "USERNAME",
    "password": "PASSWORD or API KEY",
    "topics": {
        "getOnline": "31141235efb12D367/tele/LWT",         //CHANGE HERE TOO
        "getOn": "31141235efb12D367/stat/POWER",
        "setOn": "31141235efb12D367/cmnd/POWER"
    },
    "onlineValue": "Online",
    "offlineValue": "Offline",
    "onValue": "ON",
    "offValue": "OFF",
    "accessory": "mqttthing"
}
```

3\. **Door or Lock**

```javascript
{
    "type": "lockMechanism",
    "name": "31141235efb12D367",         //YOUR DEVICE ID
    "url": "smartnest.cz",
    "username": "USERNAME",
    "password": "PASSWORD or API KEY",
    "topics": {
        "getOnline": "31141235efb12D367/report/online",        //CHANGE HERE TOO
        "getLockCurrentState": "31141235efb12D367/report/lockedState",
        "getLockTargetState": "31141235efb12D367/report/lockedState",
        "setLockTargetState": "31141235efb12D367/directive/lockedState"
    },
    "lockValues": [
        "false",
        "true",
        "Jammed",
        "Unknown"
    ],
    "accessory": "mqttthing"
}
```

4\. **Thermostat**

```javascript
{
    "accessory": "mqttthing",
    "type": "thermostat",
    "name": "31141235efb12D367",     //YOUR DEVICE ID
    "url": "smartnest.cz",
    "username": "USERNAME",
    "password": "PASSWORD or API KEY",
    "topics": {                                                //CHANGE HERE TOO
        "getCurrentHeatingCoolingState": "31141235efb12D367/report/mode",
        "setTargetHeatingCoolingState": "31141235efb12D367/directive/mode",
        "getTargetHeatingCoolingState": "31141235efb12D367/report/mode",
        "getCurrentTemperature": "31141235efb12D367/report/temperature",
        "setTargetTemperature": "31141235efb12D367/directive/setpoint",
        "getTargetTemperature": "31141235efb12D367/report/setpoint",
        "setTemperatureDisplayUnits": "31141235efb12D367/directive/scale",
        "getTemperatureDisplayUnits": "31141235efb12D367/directive/scale"
    },
    "heatingCoolingStateValues": [
        "Heat",
        "Cool",
        "Auto"
    ],
    "temperatureDisplayUnitsValues": [
        "C",
        "F"
    ],
    "minTemperature": 10,        //Change if you use Fahrenheit
    "maxTemperature": 30,        //Change if you use Fahrenheit
    "restrictHeatingCoolingState": [
        0,
        1
    ]
}
```

5\. **Temperature Sensor**

```javascript
{
    "accessory": "mqttthing",
    "type": "temperatureSensor",    
    "name": "31141235efb12D367",     //YOUR DEVICE ID
    "url": "smartnest.cz",
    "username": "USERNAME",
    "password": "PASSWORD or API KEY",
    "caption": "Temperature",
    "topics": {                                                //CHANGE HERE TOO
        "getCurrentTemperature": "31141235efb12D367/report/temperature"
    },
    "history": true,
    "minTemperature": 10,        //Change if you use Fahrenheit
    "maxTemperature": 30        //Change if you use Fahrenheit
}
```

**6. Fan**

```javascript
 {
    "accessory": "mqttthing",
    "type": "fan",
    "name": "31141235efb12D367",     //YOUR DEVICE ID
    "url": "smartnest.cz",
    "username": "USERNAME",
    "password": "PASSWORD or API KEY",
    "caption": "Fan",
    "topics": {                                    //CHANGE HERE TOO
        "getOn": "31141235efb12D367/report/powerState",
        "setOn": "31141235efb12D367/directive/powerState",
        "getRotationSpeed": "31141235efb12D367/report/percentage",
        "setRotationSpeed": "31141235efb12D367/directive/percentage"
    },
    "integerValue": false,
    "onValue": "ON",
    "offValue": "OFF",
    "turnOffAfterms": 3600000
}
```

## Si quieres agregar un dispositivo diferente puedes consultar la página de [Accesorios soportados en homebridge-mqttthing](https://github.com/arachnetech/homebridge-mqttthing#supported-accessories)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://documentacion.smartnest.cz/integracion-con-homebridge.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
