Integración con openHAB
A continuación se describe la integración en openHAB para que pueda procesar fácilmente la información de residuos en su smart home.
Instalar dependencias
¡Para la conexión se necesitan dos cosas! En primer lugar, el HTTP Binding y, en segundo lugar (para el procesamiento de datos), el servicio JSONPATH Data Transformation. HTTP Binding (se abre en una nueva pestaña) / JSONPATH Data Transformation (se abre en una nueva pestaña).
Crear Thing
Cree un HTTP Thing y configúrelo de la siguiente manera (código). Tenga en cuenta que no se pueden transmitir diéresis/caracteres especiales en las cabeceras. Escriba, por ejemplo, "ue" en lugar de "ü".
UID: http:url:xxxxxxx
label: Binable
thingTypeUID: http:url
configuration:
authMode: BASIC
ignoreSSLErrors: false
baseURL: https://binable.app/api/fetch
delay: 0
stateMethod: POST
refresh: 21600
commandMethod: POST
contentType: text/plain
timeout: 6000
bufferSize: 2048
headers:
- "X-Address-Street=XXX"
- "X-Address-HouseNumber=XXX"
- "X-Address-Zip=XXX"
- "X-Address-City=XXXX"
- "X-Address-Country=DE"
channels:
- id: residual_waste_last
channelTypeUID: http:datetime
label: Restmüll (letzte)
description: ""
configuration:
mode: READONLY
stateTransformation: JSONPATH:$.residualWaste.last
- id: residual_waste_next
channelTypeUID: http:datetime
label: Restmüll (nächste)
description: null
configuration:
mode: READONLY
stateTransformation: JSONPATH:$.residualWaste.next
- id: residual_waste_next_days
channelTypeUID: http:number
label: Restmüll (nächste) relative
description: null
configuration:
mode: READONLY
stateTransformation: JSONPATH:$.residualWaste.nextDays
- id: paper_last
channelTypeUID: http:datetime
label: Papier (letzte)
description: null
configuration:
mode: READONLY
stateTransformation: JSONPATH:$.paper.last
- id: paper_next
channelTypeUID: http:datetime
label: Papier (nächste)
description: null
configuration:
mode: READONLY
stateTransformation: JSONPATH:$.paper.next
- id: paper_next_days
channelTypeUID: http:number
label: Papier (nächste) relative
description: null
configuration:
mode: READONLY
stateTransformation: JSONPATH:$.paper.nextDays
- id: reusable_materials_last
channelTypeUID: http:datetime
label: Wertstoffe (letzte)
description: null
configuration:
mode: READONLY
stateTransformation: JSONPATH:$.reusableMaterials.last
- id: reusable_materials_next
channelTypeUID: http:datetime
label: Wertstoffe (nächste)
description: null
configuration:
mode: READONLY
stateTransformation: JSONPATH:$.reusableMaterials.next
- id: reusable_materials_next_days
channelTypeUID: http:number
label: Wertstoffe (nächste) relative
description: null
configuration:
mode: READONLY
stateTransformation: JSONPATH:$.reusableMaterials.nextDays
- id: bio_last
channelTypeUID: http:datetime
label: Bio (letzte)
description: null
configuration:
mode: READONLY
stateTransformation: JSONPATH:$.bio.last
- id: bio_next
channelTypeUID: http:datetime
label: Bio (nächste)
description: null
configuration:
mode: READONLY
stateTransformation: JSONPATH:$.bio.next
- id: bio_next_days
channelTypeUID: http:number
label: Bio (nächste) relative
description: null
configuration:
mode: READONLY
stateTransformation: JSONPATH:$.bio.nextDays
# - id: christmas_tree_last
# channelTypeUID: http:datetime
# label: Weihnachtsbaum (letzte)
# description: null
# configuration:
# mode: READONLY
# stateTransformation: JSONPATH:$.christmasTree.last
# - id: christmas_tree_next
# channelTypeUID: http:datetime
# label: Weihnachtsbaum (nächste)
# description: null
# configuration:
# mode: READONLY
# stateTransformation: JSONPATH:$.christmasTree.next
# - id: christmas_tree_next_days
# channelTypeUID: http:number
# label: Weihnachtsbaum (nächste) relative
# description: null
# configuration:
# mode: READONLY
# stateTransformation: JSONPATH:$.christmasTree.nextDays
Nota: actualmente están disponibles los siguientes tipos de residuos (etiqueta / clave): papel (paper), residuos orgánicos (bio), residuos (residualWaste), materiales reciclables (reusableMaterials), árboles de Navidad (christmasTree), residuos peligrosos (toxic), pañales (diaper) y restos de poda de setos (hedgeTreeTrimming)
Items
Cree items basados en los canales correspondientes.
Opcional: formato de fecha
Puede formatear correctamente la fecha creando una State Description, por ejemplo, con la forma "%1$td.%1$tm.%1$tY". Para días relativos, también puede usarse esta State Description: "%.0f día(s)".
¡Listo!
Eso es todo. No reduzca el "delay", ya que no es necesario realizar solicitudes frecuentes.