{% set raw_value = states('sensor.waze_travail') %}
{% set entity_value = raw_value | int %}
{% if entity_value <= 14 %}
{% set color = '#05DF72' %}
{% elif entity_value > 14 and entity_value <= 20 %}
{% set color = '#FDC745' %}
{% elif entity_value > 20 and entity_value <= 25 %}
{% set color = '#FB2C36' %}
{% else %}
{% set color = '#0C0A09' %}
{% endif %}
Trajet travail
{{ entity_value }} min {{ state_attr('sensor.waze_travail', 'distance') }} km
===== UPS USB =====
Paramètres -> Modules complémentaires -> Network UPS Tools
Dans configuration, mettez un nom d'utilisateur et un mot de passe.
Ensuite, il est important de redémarrer complètement la VM (et pas juste redémarrer HA)
Ajouter une intégration **Network UPS Tools (NUT)** et renseignez le hostname comme il est écrit sur la page du module (ex: a0d7b954-nut ) et renseignez votre user password
===== Objets à acheter =====
==== Concentrateur Zigbee/Thread/Matter ====
* SMLIGHT MR1U -> https://www.domadoo.fr/fr/produits-de-domotique/8370-smlight-adaptateur-usb-ethernet-poe-zigbee-et-thread-cc2652p-efr32mg21-slzb-mr1u.html
==== Commutateur ====
* Sonoff ZBMINIL2 (sans neutre) 11€ -> https://www.domadoo.fr/fr/peripheriques/6619-sonoff-commutateur-intelligent-sans-neutre-zigbee-30-zbminil2-6920075778298.html?domid=117
* Sonoff ZBMINIR2 (module 10A) 7.50€ -> https://www.domadoo.fr/fr/peripheriques/7474-sonoff-module-zigbee-commutateur-onoff-10a-zbminir2-compatible-zigbee2mqtt-et-home-assistant.html?domid=117
* Nous (simple) 10€ -> https://www.domadoo.fr/fr/objets-communicants/6797-nous-module-connecte-zigbee-tuya-et-zigbee2mqtt-onoff-10a-5905072800266.html
==== Ampoules =====
* IKEA (meilleur qualité/prix)
* innr -> https://www.domadoo.fr/fr/peripheriques/6612-innr-ampoule-connectee-e27-zigbee-30-rgbw-blanc-reglable.html?domid=117
* Hue essential
* Hue (top mais cher)
* Tuya 29€ les 5 -> https://fr.aliexpress.com/item/1005006266102655.html?spm=a2g0o.order_list.order_list_main.20.21ef5e5bPzvGsa&gatewayAdapt=glo2fra#nav-specification
==== Prises connectées ====
* IKEA (+ consommation) 10€ -> https://www.ikea.com/fr/fr/p/inspelning-fiche-connecte-compteur-denergie-40569839/
* NOUS (compact) + consommation 17€ -> https://www.domadoo.fr/fr/prises-connectees/6165-nous-prise-intelligente-zigbee-30-mesure-de-consommation-5907772033517.html?domid=117
==== Capteurs ====
* Température / humidité
* IKEA avec affichage 8€ -> https://www.ikea.com/fr/fr/p/timmerflotte-capteur-dhumidite-temperature-connecte-30597606/
* Sonoff avec écran, 4 pour 50€ (12€ seul) -> https://www.domadoo.fr/fr/suivi-energie/6968-sonoff-pack-4x-capteurs-de-temperature-et-d-humidite-zigbee-ecran.html
* Fuite d'eau
* IKEA 8€ -> https://www.ikea.com/fr/fr/p/klippbok-detecteur-de-fuites-deau-connecte-30604193/
* Ouverture porte
* IKEA 8€ -> https://www.ikea.com/fr/fr/p/myggbett-capteur-fenetre-porte-connecte-00603864/
* Détecteur de présence humaine (différent de mouvement)
* Sonoff 12€ -> https://www.domadoo.fr/fr/alarme-connectee/6827-sonoff-capteur-de-presence-humaine-zigbee-30-technologie-radar.html
===== intégration à Google Home =====
https://www.youtube.com/watch?v=goNB9Cgh_Fk&t=5s
===== Neato =====
Reprendre le controle sur son robot aspirateur -> https://github.com/Philip2809/neato-connected
===== ZHA Device Handlers =====
Les gestionnaires de périphériques ZHA sont des implémentations personnalisées de particularités pour Zigpy , la bibliothèque qui fournit la prise en charge Zigbee pour le composant ZHA dans Home Assistant.
https://github.com/zigpy/zha-device-handlers/tree/dev
ça m'a sauvé la vie pour mon module **Sone Smart One Variateur Zigbee 200W – Micromodule Dimmer Éclairage TRIAC 39×39×18 mm, Compatible Tuya Smart Life, Alexa, Google Home, Home Assistant (Zigbee2MQTT)**
Il suffit de rajouter ça dans le fichier de configuration.yaml
zha:
custom_quirks_path: /config/custom_zha_quirks/
De créer le répertoire ''/custom_zha_quirks'' et de créer le fichier suivant à l'intérieur
"""Tuya Dimmer TS110E Custom Quirk."""
from typing import Any, Final, Union
from zigpy.profiles import zgp, zha
import zigpy.types as t
from zigpy.zcl import foundation
from zigpy.zcl.clusters.general import (
Basic,
GreenPowerProxy,
Groups,
LevelControl,
OnOff,
Ota,
Scenes,
Time,
)
from zigpy.zcl.foundation import ZCLAttributeDef
from zhaquirks.const import (
DEVICE_TYPE,
ENDPOINTS,
INPUT_CLUSTERS,
MODELS_INFO,
OUTPUT_CLUSTERS,
PROFILE_ID,
)
from zhaquirks.tuya import (
NoManufacturerCluster,
TuyaDimmerSwitch,
TuyaZBExternalSwitchTypeCluster,
)
TUYA_LEVEL_ATTRIBUTE = 0xF000
TUYA_BULB_TYPE_ATTRIBUTE = 0xFC02
TUYA_MIN_LEVEL_ATTRIBUTE = 0xFC03
TUYA_MAX_LEVEL_ATTRIBUTE = 0xFC04
TUYA_CUSTOM_LEVEL_COMMAND = 0x00F0
class TuyaLevelPayload(t.Struct):
"""Tuya Level payload."""
level: t.uint16_t
transtime: t.uint16_t
class TuyaBulbType(t.enum8):
"""Tuya bulb type."""
LED = 0x00
INCANDESCENT = 0x01
HALOGEN = 0x02
class F000LevelControlCluster(NoManufacturerCluster, LevelControl):
"""LevelControlCluster that reports to attrid 0xF000."""
class ServerCommandDefs(LevelControl.ServerCommandDefs):
"""Server command definitions."""
moveToLevelTuya = foundation.ZCLCommandDef( # noqa: N815
id=TUYA_CUSTOM_LEVEL_COMMAND,
schema={"payload": TuyaLevelPayload},
is_manufacturer_specific=False,
)
class AttributeDefs(LevelControl.AttributeDefs):
"""Attribute definitions."""
manufacturer_current_level: Final = ZCLAttributeDef(
id=TUYA_LEVEL_ATTRIBUTE, type=t.uint16_t
)
bulb_type: Final = ZCLAttributeDef(
id=TUYA_BULB_TYPE_ATTRIBUTE, type=TuyaBulbType
)
manufacturer_min_level: Final = ZCLAttributeDef(
id=TUYA_MIN_LEVEL_ATTRIBUTE, type=t.uint16_t
)
manufacturer_max_level: Final = ZCLAttributeDef(
id=TUYA_MAX_LEVEL_ATTRIBUTE, type=t.uint16_t
)
def _update_attribute(self, attrid, value):
if attrid == TUYA_LEVEL_ATTRIBUTE:
self.debug("Getting brightness %s", value)
value = (value + 4 - 10) * 254 // (1000 - 10)
attrid = 0x0000
super()._update_attribute(attrid, value)
async def command(
self,
command_id: Union[foundation.GeneralCommand, int, t.uint8_t],
*args,
manufacturer: Union[int, t.uint16_t] | None = None,
expect_reply: bool = True,
tsn: Union[int, t.uint8_t] | None = None,
**kwargs: Any,
):
if command_id in (0x0000, 0x0001, 0x0004):
if kwargs and "level" in kwargs:
level = kwargs["level"]
elif args:
level = args[0]
else:
level = 0
brightness = level * (1000 - 10) // 254 + 10
self.debug("Setting brightness to %s", brightness)
return await super().command(
TUYA_CUSTOM_LEVEL_COMMAND,
TuyaLevelPayload(level=brightness, transtime=0),
manufacturer=manufacturer,
expect_reply=expect_reply,
tsn=tsn,
)
return super().command(
command_id, *args, manufacturer, expect_reply, tsn, **kwargs
)
class DimmerSwitchWithNeutral1Gang(TuyaDimmerSwitch):
"""Tuya Dimmer Switch Module With Neutral 1 Gang."""
signature = {
MODELS_INFO: [("_TZ3210_ngqk6jia", "TS110E")],
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.DIMMABLE_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id, # 0x0000
0x0003, # Identify (Ajouté)
Groups.cluster_id, # 0x0004
Scenes.cluster_id, # 0x0005
OnOff.cluster_id, # 0x0006
LevelControl.cluster_id, # 0x0008
0x1000, # LightLink (Ajouté)
TuyaZBExternalSwitchTypeCluster.cluster_id, # 0xe001
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
242: {
PROFILE_ID: zgp.PROFILE_ID,
DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
},
}
replacement = {
ENDPOINTS: {
1: {
PROFILE_ID: zha.PROFILE_ID,
DEVICE_TYPE: zha.DeviceType.DIMMABLE_LIGHT,
INPUT_CLUSTERS: [
Basic.cluster_id,
0x0003,
Groups.cluster_id,
Scenes.cluster_id,
OnOff.cluster_id,
F000LevelControlCluster, # Applique le traitement spécifique Tuya
0x1000,
TuyaZBExternalSwitchTypeCluster,
],
OUTPUT_CLUSTERS: [Time.cluster_id, Ota.cluster_id],
},
242: {
PROFILE_ID: zgp.PROFILE_ID,
DEVICE_TYPE: zgp.DeviceType.PROXY_BASIC,
INPUT_CLUSTERS: [],
OUTPUT_CLUSTERS: [GreenPowerProxy.cluster_id],
},
},
}
Redémarrer Home Assistant, supprimer le module et le reintégrer.