<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	
	xmlns:georss="http://www.georss.org/georss"
	xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#"
	>

<channel>
	<title>Archives des Home Assistant - La programmation sur le web</title>
	<atom:link href="https://programmation.surleweb-france.fr/tag/home-assistant/feed/" rel="self" type="application/rss+xml" />
	<link>https://programmation.surleweb-france.fr/tag/home-assistant/</link>
	<description>La programmation gratuite pour tous</description>
	<lastBuildDate>Sun, 03 Apr 2022 08:46:20 +0000</lastBuildDate>
	<language>fr-FR</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.0.2</generator>

<image>
	<url>https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2023/08/cropped-19518430-icone-de-programmation-pour-votre-site-web-mobile-presentation-et-conception-de-logo-gratuit-vectoriel.jpg?fit=32%2C32&#038;ssl=1</url>
	<title>Archives des Home Assistant - La programmation sur le web</title>
	<link>https://programmation.surleweb-france.fr/tag/home-assistant/</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">176210735</site>	<item>
		<title>Home Assistant, installation sur disque dur externe</title>
		<link>https://programmation.surleweb-france.fr/home-assistant-installation-sur-disque-dur-externe/</link>
					<comments>https://programmation.surleweb-france.fr/home-assistant-installation-sur-disque-dur-externe/#respond</comments>
		
		<dc:creator><![CDATA[Zigomato]]></dc:creator>
		<pubDate>Tue, 05 Apr 2022 14:48:00 +0000</pubDate>
				<category><![CDATA[Domotique]]></category>
		<category><![CDATA[HAOS]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<guid isPermaLink="false">https://programmation.surleweb-france.fr/?p=1361</guid>

					<description><![CDATA[<p>Comment bénéficier des avantages du SSD sur son Raspberry pour son installation domotique avec Home Assistant</p>
<p class="continue-reading-button"> <a class="continue-reading-link" href="https://programmation.surleweb-france.fr/home-assistant-installation-sur-disque-dur-externe/">Continuer la lecture<i class="crycon-right-dir"></i></a></p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-installation-sur-disque-dur-externe/">Home Assistant, installation sur disque dur externe</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Une fois son installation d&rsquo;Home Assistant fonctionnelle, on se rend rapidement compte que la lecture et l&rsquo;écriture sur la carte SD peut poser des soucis. Sur Raspberry, il peut être utile voire indispensable d&rsquo;installer l&rsquo;OS sur un support externe. </p>



<p class="wp-block-paragraph">Cela aura plusieurs avantages :</p>



<ul class="wp-block-list"><li>supprimer les défaut liés à la durée de vie des cartes SD</li><li>accélérer l&rsquo;accès au système en utilisant la vitesse du SSD</li><li>bénéficier de la vitesse de l&rsquo;USB 3</li></ul>



<h2 class="wp-block-heading">Création d&rsquo;un sauvegarde</h2>



<p class="wp-block-paragraph">Avant tout, pour ne pas à avoir à tout refaire sur home assistant, il est indispensable de faire une sauvegarde de HAOS</p>



<h2 class="wp-block-heading">Démarrer sur le disque dur</h2>



<p class="wp-block-paragraph">Pour faire simple, j&rsquo;ai déjà fait un article pour booter sur le disque dur brancher sur l&rsquo;USB du Raspberry, je t&rsquo;invite à lire cet article : démarrer sur <a href="https://programmation.surleweb-france.fr/raspberry-pi-4-demarrer-sur-un-disque-externe/" target="_blank" rel="noreferrer noopener">un support externe</a>.</p>



<p class="wp-block-paragraph">Il te faudra simplement l&rsquo;image d&rsquo;HAOS que tu pourras trouver sur le git officiel, <a href="https://github.com/home-assistant/operating-system/releases" target="_blank" rel="noreferrer noopener">ici</a>. Tu utilisera cette image pour créer ton disque dur.</p>



<h2 class="wp-block-heading">Restaurer son installation</h2>



<p class="wp-block-paragraph">Lors de ton premier démarrage, tu auras le choix de créer un compte ou bien de restaurer à partir d&rsquo;une sauvegarde, bien entendu, tu choisiras cette option :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img fetchpriority="high" decoding="async" width="434" height="584" src="//i1.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2022/04/image-10.png" alt="" class="wp-image-1362" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2022/04/image-10.png?w=434&amp;ssl=1 434w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2022/04/image-10.png?resize=223%2C300&amp;ssl=1 223w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2022/04/image-10.png?resize=111%2C150&amp;ssl=1 111w" sizes="(max-width: 434px) 100vw, 434px" /></figure></div>



<p class="wp-block-paragraph">Une fois que tu auras choisis ta sauvegarde (complète), il te faudra attendre quelques minutes.</p>



<h2 class="wp-block-heading">Problèmes rencontrés</h2>



<p class="wp-block-paragraph">J&rsquo;utilise la PiZigate comme passerelle pour tous mes modules Zigbee, malheureusement, il y a un soucis d&rsquo;interférences connues avec le disque dur branché sur l&rsquo;USB 3. Pour régler ça :</p>



<ul class="wp-block-list"><li>éloigner le disque dur SSD du Raspberry</li><li>brancher le disque dur SSD sur l&rsquo;USB2</li></ul>



<p class="wp-block-paragraph">Dans les deux cas, il faut éloigner fortement le SSD. Pas de distance précise à te donner.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Le fonctionnement avec la PiZigate ou Zigate (vu sur les forums) n&rsquo;est pas optimal avec un disque SSD. Mais si l&rsquo;on arrive à supprimer les interférences, le fonctionnement de Home Assistant est bien plus efficace.</p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-installation-sur-disque-dur-externe/">Home Assistant, installation sur disque dur externe</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programmation.surleweb-france.fr/home-assistant-installation-sur-disque-dur-externe/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1361</post-id>	</item>
		<item>
		<title>Home assistant, modifier le type d&#8217;un module</title>
		<link>https://programmation.surleweb-france.fr/home-assistant-modifier-le-type-dun-module/</link>
					<comments>https://programmation.surleweb-france.fr/home-assistant-modifier-le-type-dun-module/#respond</comments>
		
		<dc:creator><![CDATA[Zigomato]]></dc:creator>
		<pubDate>Sun, 19 Dec 2021 16:47:41 +0000</pubDate>
				<category><![CDATA[Domotique]]></category>
		<category><![CDATA[device]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<category><![CDATA[light]]></category>
		<category><![CDATA[mini]]></category>
		<category><![CDATA[modifier]]></category>
		<category><![CDATA[sonoff]]></category>
		<category><![CDATA[switch]]></category>
		<category><![CDATA[type]]></category>
		<category><![CDATA[zigbee]]></category>
		<guid isPermaLink="false">https://programmation.surleweb-france.fr/?p=1290</guid>

					<description><![CDATA[<p>La modification d'un type de module pour qu'il soit reconnu différemment que son module par défaut est rapidesur Home Assistant.</p>
<p class="continue-reading-button"> <a class="continue-reading-link" href="https://programmation.surleweb-france.fr/home-assistant-modifier-le-type-dun-module/">Continuer la lecture<i class="crycon-right-dir"></i></a></p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-modifier-le-type-dun-module/">Home assistant, modifier le type d&rsquo;un module</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Afin de mettre en place ma gestion automatique de mon chauffage électrique d&rsquo;appoint dans la maison, j&rsquo;ai dû utiliser des modules Sonoff accompagnés de diode pour gestion du fil pilote, cela fera l&rsquo;objet d&rsquo;un article.</p>



<p class="wp-block-paragraph">Une de mes difficultés lors de la mise en place de cela a été que mon module, une fois ajouté à Home Assistant était déclaré comme une lumière. J&rsquo;ai cherché sur le net (pas mal de temps) pour modifier le type du module dans ZHA.</p>



<p class="wp-block-paragraph">Cet article est valable si tu utilises l&rsquo;intégration <a href="https://www.home-assistant.io/integrations/zha/" target="_blank" rel="noreferrer noopener">ZHA </a>et une passerelle <a href="https://www.inpact-hardware.com/article/2300/domotique-a-decouverte-protocole-zigbee" target="_blank" rel="noreferrer noopener">Zigbee</a>. Dans mon cas, avec mon <a href="https://raspberry-pi.fr/" target="_blank" rel="noreferrer noopener">Raspberry</a>, j&rsquo;utilise une PiGate.</p>



<h2 class="wp-block-heading">Ce dont tu as besoin</h2>



<p class="wp-block-paragraph">J&rsquo;imagine qu&rsquo;en venant ici, soit tu as déjà ce qu&rsquo;il faut, soit tu cherches, je mets de côté le Raspberry, qui peut être remplacé par une toute autre solution.</p>



<p class="wp-block-paragraph">J&rsquo;ai pris le module interrupteur Zigbee de Sonoff sur ce <a href="https://amzn.to/3mespDq" target="_blank" rel="noreferrer noopener">site</a>. </p>



<h2 class="wp-block-heading">Ajout du module avec ZHA</h2>



<p class="wp-block-paragraph">ZHA est une intégration permettant de gérer les équipements Zigbee accessible à partir d&rsquo;une passerelle. Tu peux suivre ce <a href="https://programmation.surleweb-france.fr/installer-et-configurer-la-pizigate-sur-pi-4/" target="_blank" rel="noreferrer noopener">lien</a>. </p>



<p class="wp-block-paragraph">L&rsquo;intégration se fait comme tout autre équipement.</p>



<h2 class="wp-block-heading">Modifier le type du module</h2>



<p class="wp-block-paragraph">Comme je l&rsquo;ai dit au début de page, une fois installé, mon module était considéré comme une lumière. Pour mes automatisations, j&rsquo;avais besoin d&rsquo;interrupteur.</p>



<p class="wp-block-paragraph">Dans le fichier <em>configuration.yaml</em>, tu ajouteras :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">zha:
  device_config:
    00:12:4b:00:24:c2:03:4e-1:    
      type: "switch"</pre>



<p class="wp-block-paragraph">Pour l&rsquo;explication, l&rsquo;adresse est constituée de deux parties, la première est l&rsquo;identifiant et la seconde le <em>endpoint</em>.</p>



<p class="wp-block-paragraph">Pour trouver l&rsquo;identifiant, dans Home Assistant, recherche ton appareil, dans <strong><em>Zigbee Info</em></strong>, tu trouveras <em>IEEE </em>(l&rsquo;identifiant) :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img decoding="async" width="311" height="339" src="//i1.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/12/image.png" alt="" class="wp-image-1291" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/12/image.png?w=311&amp;ssl=1 311w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/12/image.png?resize=275%2C300&amp;ssl=1 275w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/12/image.png?resize=138%2C150&amp;ssl=1 138w" sizes="(max-width: 311px) 100vw, 311px" /></figure></div>



<p class="wp-block-paragraph">Pour le <strong><em>endpoint</em></strong>, cliques sur Informations Zigbee, dans le popup qui s&rsquo;affichera, tu trouveras le <strong><em>endpoint </em></strong>:</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img decoding="async" width="333" height="185" src="//i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/12/image-1.png" alt="" class="wp-image-1292" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/12/image-1.png?w=333&amp;ssl=1 333w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/12/image-1.png?resize=300%2C167&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/12/image-1.png?resize=150%2C83&amp;ssl=1 150w" sizes="(max-width: 333px) 100vw, 333px" /></figure></div>



<p class="wp-block-paragraph">La dernière ligne permet d&rsquo;indiquer comment Home Assistant doit utiliser le module, dans mon cas <strong><em>Switch</em></strong>.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Voici comment modifier le type d&rsquo;un module installé.</p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-modifier-le-type-dun-module/">Home assistant, modifier le type d&rsquo;un module</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programmation.surleweb-france.fr/home-assistant-modifier-le-type-dun-module/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1290</post-id>	</item>
		<item>
		<title>Home assistant, automatiser une action des jours précis</title>
		<link>https://programmation.surleweb-france.fr/home-assistant-automatiser-une-action-des-jours-precis/</link>
					<comments>https://programmation.surleweb-france.fr/home-assistant-automatiser-une-action-des-jours-precis/#respond</comments>
		
		<dc:creator><![CDATA[Zigomato]]></dc:creator>
		<pubDate>Mon, 29 Nov 2021 16:18:33 +0000</pubDate>
				<category><![CDATA[Domotique]]></category>
		<category><![CDATA[alexa]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[condition]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<category><![CDATA[notification]]></category>
		<category><![CDATA[sensor_binary]]></category>
		<category><![CDATA[template]]></category>
		<category><![CDATA[workday]]></category>
		<guid isPermaLink="false">https://programmation.surleweb-france.fr/?p=1277</guid>

					<description><![CDATA[<p>Mise en place d'une automatisation des notifications en fonction de l'heure et du jour de la semaine dans Home Assistant</p>
<p class="continue-reading-button"> <a class="continue-reading-link" href="https://programmation.surleweb-france.fr/home-assistant-automatiser-une-action-des-jours-precis/">Continuer la lecture<i class="crycon-right-dir"></i></a></p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-automatiser-une-action-des-jours-precis/">Home assistant, automatiser une action des jours précis</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Le rôle de la domotique est de simplifier le quotidien bien que la mise en place peut être fastidieuse. Sans chercher à faire des actions compliquées, gérer une alarme, une notification avec Home Assistant, si celle-ci est récurrente, est très simple.</p>



<p class="wp-block-paragraph">Dans ma commune, les déchets sont ramassés deux jours par semaine :</p>



<ul class="wp-block-list"><li>le mercredi matin, ce sont les déchets non recyclables (poubelle bleue)</li><li>le jeudi matin, il s&rsquo;agit des déchets recyclacles (poubelle jaune)</li></ul>



<p class="wp-block-paragraph">Voilà, le petit script afin d&rsquo;automatiser une notification sur mes enceintes Alexa la veille au soir.</p>



<h2 class="wp-block-heading">Prérequis</h2>



<p class="wp-block-paragraph">Pour cet article simple, il faudra tout de même avoir les notifications sur les enceintes Alexa d&rsquo;activer, si ce n&rsquo;est pas le cas, tu peux te rendre sur <a href="https://programmation.surleweb-france.fr/home-assistant-ajouter-les-enceintes-alexa/" target="_blank" rel="noreferrer noopener">Donner de la voix à Home Assistant avec Alexa</a>.</p>



<h2 class="wp-block-heading">Création des sensors</h2>



<p class="wp-block-paragraph">Une fois que tu arrives à faire parler tes enceintes, nous allons créer 2 sensors, nous pourrions faire autrement mais je trouve cette manière plus esthétique et cela permet d&rsquo;appréhender les capteurs binaires avec la plateforme <strong>workday</strong>. La documentation sur <strong>Workday </strong>est disponible sur le <a href="https://www.home-assistant.io/integrations/workday/" target="_blank" rel="noreferrer noopener">wiki de HA</a>.</p>



<p class="wp-block-paragraph">Tout d&rsquo;abord, dans le fichier <em>configuration.yaml</em>, j&rsquo;ai ajouté cette ligne :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">binary_sensor: !include binary_sensors.yaml</pre>



<p class="wp-block-paragraph">Le fichier<em> binary_sensors.yaml</em> contient l&rsquo;ensemble de mes capteurs de ce type.</p>



<p class="wp-block-paragraph">Nous allons créer nos deux capteurs :</p>



<ul class="wp-block-list"><li>le premier pour la veille du ramassage des poubelles bleues</li><li>le second pour la veille du ramassage des poubelles jaunes</li></ul>



<p class="wp-block-paragraph">Mon fichier contient donc cela :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># sensor pour le jour de ramassage de poubelle bleu
- platform: workday
  country: FR
  name: jour_poubelle_bleu
  workdays: [tue]

# sensor pour le jour de ramassage de poubelle jaune
- platform: workday
  country: FR
  name: jour_poubelle_jaune
  workdays: [wed]</pre>



<p class="wp-block-paragraph">Rien de très compliqué, il est à noter que <strong>country </strong>est obligatoire. La liste <strong>workdays </strong>contient les jours pour lesquels nous voulons que notre sensor soit à <strong>on</strong>.</p>



<p class="wp-block-paragraph">Avec ce type de sensor, nous pourrions exclure des jours, des périodes (par exemple de vacances) ou des évenements déjà définis (Noël &#8230;) dans mon cas, je ne les utilise pas.</p>



<p class="wp-block-paragraph">S&rsquo;en est fini pour les sensors, prochaine étape, l&rsquo;automatisation.</p>



<h2 class="wp-block-heading">Automatisation des notifications</h2>



<p class="wp-block-paragraph">Maintenant, nous allons simplement créer 2 automations, une pour le mardi soir et une autre pour le mercredi soir.</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Ramassage des poubelles
- alias: rammassage_poubelle
  trigger:
    - platform: time
      at: '20:00:00'
  condition: 
    - condition: or
      conditions:
      - condition: and
        conditions:
          - condition: state
            entity_id: binary_sensor.jour_poubelle_bleu
            state: "on"
          - condition: state
            entity_id: input_boolean.vacances
            state: "off"
      - condition: and
        conditions:
          - condition: state
            entity_id: binary_sensor.jour_poubelle_jaune
            state: "on"
          - condition: state
            entity_id: input_boolean.vacances
            state: "off"
  action:
    - service: notify.alexa_media_dot_parent
      data_template:
        data:
          type: tts
        message: >-
          {% if states.binary_sensor.jour_poubelle_bleu.state == "on" %}
            "Pense à sortir la poubelle bleu"
          {% elif states.binary_sensor.jour_poubelle_jaune.state == "on" %}
            "Pense à sortir la poubelle jaune"
          {% endif %}</pre>



<p class="wp-block-paragraph">Il n&rsquo;y a rien de compliqué, le déclencheur est l&rsquo;heure (à 20h00) et il y a une des conditions imbriquées, en effet pas besoin que la notification soit émise, si personne est présent. Il y a bien moins lourd à faire sur les conditions, je reviendrai dessus plus tard.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Dorénavant, je n&rsquo;aurai plus d&rsquo;excuses pour avoir oublié de sortir les poubelles.</p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-automatiser-une-action-des-jours-precis/">Home assistant, automatiser une action des jours précis</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programmation.surleweb-france.fr/home-assistant-automatiser-une-action-des-jours-precis/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1277</post-id>	</item>
		<item>
		<title>Home Assistant, ajouter une caméra EZVIZ</title>
		<link>https://programmation.surleweb-france.fr/home-assistant-ajouter-une-camera-ezviz/</link>
					<comments>https://programmation.surleweb-france.fr/home-assistant-ajouter-une-camera-ezviz/#respond</comments>
		
		<dc:creator><![CDATA[Zigomato]]></dc:creator>
		<pubDate>Thu, 25 Nov 2021 15:51:00 +0000</pubDate>
				<category><![CDATA[Domotique]]></category>
		<category><![CDATA[alarme]]></category>
		<category><![CDATA[C6N]]></category>
		<category><![CDATA[caméra]]></category>
		<category><![CDATA[détéction]]></category>
		<category><![CDATA[ezviz]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<category><![CDATA[infrarouge]]></category>
		<category><![CDATA[intégration]]></category>
		<category><![CDATA[ip]]></category>
		<category><![CDATA[mouvement]]></category>
		<category><![CDATA[sécurité]]></category>
		<category><![CDATA[surveillance]]></category>
		<guid isPermaLink="false">https://programmation.surleweb-france.fr/?p=1225</guid>

					<description><![CDATA[<p>L'ajout d'une caméra EZVIZ C6N pour mettre en place une surveillance chez soi avec l'intégration officielle</p>
<p class="continue-reading-button"> <a class="continue-reading-link" href="https://programmation.surleweb-france.fr/home-assistant-ajouter-une-camera-ezviz/">Continuer la lecture<i class="crycon-right-dir"></i></a></p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-ajouter-une-camera-ezviz/">Home Assistant, ajouter une caméra EZVIZ</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Même si la vocation d&rsquo;Home Assistant n&rsquo;est pas de servir de système d&rsquo;alarme, nous pouvons néanmoins ajouter des caméras, celles-ci pourront également avec des commandes ou des retours d&rsquo;état s&rsquo;intégrer dans des automatisations.</p>



<p class="wp-block-paragraph">Pour cette article, j&rsquo;ai utilisé ma caméra EZVIZ modèle : C6N. Depuis quelques mois l&rsquo;intégration est parfaitement compatible avec les fonctions de la caméra et Home Assistant.</p>



<p class="wp-block-paragraph">Tu peux trouver cette caméra <a href="https://amzn.to/3kYX3A3" target="_blank" rel="noreferrer noopener">ici</a>. Je m&rsquo;étais arrêté sur ce modèle car son prix n&rsquo;est pas élevé et en cas d&rsquo;échec, je n&rsquo;aurai pas perdu toute ma fortune. Il s&rsquo;agit d&rsquo;une caméra IP</p>



<h2 class="wp-block-heading">La caméra C6N</h2>



<p class="wp-block-paragraph">Mon but n&rsquo;est pas de la vendre, simplement de montrer son intégration et son utilisation, j&rsquo;imagine que les autres modèles de chez EZVIZ fonctionneront.</p>



<p class="wp-block-paragraph">Tout d&rsquo;abord, voilà à quoi elle ressemble :</p>



<figure class="wp-block-image size-large"><img data-recalc-dims="1" decoding="async" src="https://i0.wp.com/s3.amazonaws.com/mfs.ezvizlife.com/3008542df2db5f5e4ef2c01ef56b8060.jpg?w=900&#038;ssl=1" alt=""/></figure>



<p class="wp-block-paragraph">Son gabarit est un peu élevé. Donc, on ne le choisira pour rester discret.</p>



<p class="wp-block-paragraph">Elle dispose des fonctions suivantes :</p>



<ul class="wp-block-list"><li>full HD</li><li>Vision nocturne</li><li>Motorisée dans les deux axes</li><li>Détection de mouvements</li><li>Suivi intelligent</li><li>Conversation bidirectionnelle</li></ul>



<p class="wp-block-paragraph">IL y a bien d&rsquo;autres fonctions, je te laisse la page de la caméra sur le site : <a href="https://www.ezvizlife.com/fr/fr/product/c6n/22073" target="_blank" rel="noreferrer noopener">EZVIZ</a>.</p>



<p class="wp-block-paragraph">Si tu veux l&rsquo;acquérir, tu peux la trouver sur le site <a href="https://amzn.to/3oHeNRC" target="_blank" rel="noreferrer noopener">Amazon</a>.</p>



<h2 class="wp-block-heading">Installation sur mobile</h2>



<p class="wp-block-paragraph">Je ne vais pas détailler l&rsquo;installation sur l&rsquo;application et la création du compte. Mais cette étape est indispensable, il s&rsquo;agit d&rsquo;une solution on cloud.</p>



<p class="wp-block-paragraph">Mais tu peux mettre dès maintenant le mot de passe de la caméra de côté, tu en auras besoin pour l&rsquo;installation de la caméra.</p>



<p class="wp-block-paragraph">L&rsquo;application est disponible :</p>



<ul class="wp-block-list"><li>Play store sur cette page : <a href="https://play.google.com/store/apps/details?id=com.ezviz&amp;hl=fr&amp;gl=US" target="_blank" rel="noreferrer noopener">EZVIZ App pour android</a>.</li><li>Sur le Apple Store sur celle-ci : <a href="https://apps.apple.com/fr/app/ezviz/id886947564" target="_blank" rel="noreferrer noopener">EZVIZ pour iphone</a>.</li></ul>



<h2 class="wp-block-heading">Installation sur Home Assistant</h2>



<p class="wp-block-paragraph">EZVIZ possède une intégration officielle, rends-toi dans <strong>Configuration </strong>puis <strong>Intégrations </strong>et cliques sur A<strong>jouter une intégration</strong>.</p>



<p class="wp-block-paragraph">Recherches EZVIZ et installes la :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="535" height="359" src="//i2.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-23.png" alt="" class="wp-image-1226" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-23.png?w=535&amp;ssl=1 535w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-23.png?resize=300%2C201&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-23.png?resize=150%2C101&amp;ssl=1 150w" sizes="auto, (max-width: 535px) 100vw, 535px" /></figure></div>



<p class="wp-block-paragraph">Une fois que tu te seras connecté avec ton identifiant et ton mot de passe EZVIZ, tu auras le droit à une nouvelle intégration que tu devras configurer et ta caméra sera découverte.</p>



<p class="wp-block-paragraph">La caméra n&rsquo;est pas encore fonctionnelle, lors de la configuration, tu devras saisir le mot de passe correspondant à ta caméra. Le mot de passe est présent sur la boite ou bien en allant sur l&rsquo;application et en allant chercher les informations de ta caméra.</p>



<p class="wp-block-paragraph">Maintenant, ta caméra est bien disponible dans Home Assistant :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="359" height="207" src="//i3.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-26.png" alt="" class="wp-image-1229" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-26.png?w=359&amp;ssl=1 359w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-26.png?resize=300%2C173&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-26.png?resize=150%2C86&amp;ssl=1 150w" sizes="auto, (max-width: 359px) 100vw, 359px" /></figure></div>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="720" height="446" src="//i1.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-27.png" alt="" class="wp-image-1230" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-27.png?w=720&amp;ssl=1 720w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-27.png?resize=300%2C186&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-27.png?resize=150%2C93&amp;ssl=1 150w" sizes="auto, (max-width: 720px) 100vw, 720px" /></figure></div>



<p class="wp-block-paragraph">Pour donner une idée du nombre d&rsquo;entité utilisable :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">type: entities
entities:
  - entity: switch.camera_salon_alarm_light
    name: Alarm_Light
  - entity: switch.camera_salon_alarm_light_relevance
    name: Alarm_Light_Relevance
  - entity: switch.camera_salon_alarm_tone
    name: Alarm_Tone
  - entity: switch.camera_salon_all_day_video
    name: All_Day_Video
  - entity: switch.camera_salon_auto_sleep
    name: Auto_Sleep
  - entity: switch.camera_salon_cruise_tracking
    name: Cruise_Tracking
  - entity: switch.camera_salon_feature_tracking
    name: Feature_Tracking
  - entity: switch.camera_salon_human_intelligent_detection
    name: Human_Intelligent_Detection
  - entity: switch.camera_salon_infrared_light
    name: Infrared_Light
  - entity: switch.camera_salon_light
    name: Light
  - entity: switch.camera_salon_light_flicker
    name: Light_Flicker
  - entity: switch.camera_salon_mobile_tracking
    name: Mobile_Tracking
  - entity: switch.camera_salon_partial_image_optimize
    name: Partial_Image_Optimize
  - entity: switch.camera_salon_privacy
    name: Privacy
  - entity: switch.camera_salon_sleep
    name: Sleep
  - entity: switch.camera_salon_sound
    name: Sound
  - entity: switch.camera_salon_sound_localization
    name: Sound_Localization
  - entity: switch.camera_salon_stream_adaptive
    name: Stream_Adaptive
  - entity: switch.camera_salon_tracking
    name: Tracking
title: Caméra salon
</pre>



<p class="wp-block-paragraph">On possède tous les contrôles disponibles sur l&rsquo;application via son interface Home Assistant.</p>



<p class="wp-block-paragraph"></p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-ajouter-une-camera-ezviz/">Home Assistant, ajouter une caméra EZVIZ</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programmation.surleweb-france.fr/home-assistant-ajouter-une-camera-ezviz/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1225</post-id>	</item>
		<item>
		<title>Home Assistant, ajouter les enceintes Alexa</title>
		<link>https://programmation.surleweb-france.fr/home-assistant-ajouter-les-enceintes-alexa/</link>
					<comments>https://programmation.surleweb-france.fr/home-assistant-ajouter-les-enceintes-alexa/#respond</comments>
		
		<dc:creator><![CDATA[Zigomato]]></dc:creator>
		<pubDate>Tue, 23 Nov 2021 19:04:00 +0000</pubDate>
				<category><![CDATA[Domotique]]></category>
		<category><![CDATA[alexa]]></category>
		<category><![CDATA[domotique]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<category><![CDATA[media]]></category>
		<category><![CDATA[player]]></category>
		<category><![CDATA[text to speech]]></category>
		<category><![CDATA[tts]]></category>
		<guid isPermaLink="false">https://programmation.surleweb-france.fr/?p=1154</guid>

					<description><![CDATA[<p>Avoir un système domotique, c'est bien, en avoir un qui parle ou qui peut jouer de la musique, c'est mieux. Voici la procédure le faire</p>
<p class="continue-reading-button"> <a class="continue-reading-link" href="https://programmation.surleweb-france.fr/home-assistant-ajouter-les-enceintes-alexa/">Continuer la lecture<i class="crycon-right-dir"></i></a></p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-ajouter-les-enceintes-alexa/">Home Assistant, ajouter les enceintes Alexa</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Envie de donner un peu de voix à votre configuration pour t&rsquo;informer avec des messages personnalisés, jouer des playlists quand tu rentres, nous allons voir ici qu&rsquo;il est facile d&rsquo;ajouter vos enceintes Alexa à ta configuration Home Assistant.</p>



<p class="wp-block-paragraph">Si tu recherches à piloter à la voix tes équipements, tu peux suivre <a href="https://programmation.surleweb-france.fr/home-assistant-utiliser-alexa/">Lier Alexa avec Home Assistant</a>.</p>



<h2 class="wp-block-heading">Les prérequis</h2>



<p class="wp-block-paragraph">Bien entendu, je ne vais pas te dire d&rsquo;avoir une installation fonctionnelle d&rsquo;Home Assistant mais, sait-on jamais, si tu as besoin d&rsquo;en installer une, je t&rsquo;invite à suivre ce lien : <a href="https://programmation.surleweb-france.fr/installer-home-assistant-sur-raspberry/" target="_blank" rel="noreferrer noopener">Installer Home Assistant</a>.</p>



<p class="wp-block-paragraph">Tu auras besoin d&rsquo;avoir HACS (pour Home Assistant Community Store), son installation est disponible ici, <a href="https://programmation.surleweb-france.fr/home-assistant-installation-de-hacs/" target="_blank" rel="noreferrer noopener">Installer HACS</a>.</p>



<h2 class="wp-block-heading">Téléchargement d&rsquo;Alexa Media Player</h2>



<p class="wp-block-paragraph">Rends toi dans <strong>HACS </strong>puis dans <strong>Intégrations </strong>et cliques <strong>Explorer et ajouter des dépôts</strong> :</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="342" src="//i3.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-5-1024x342.png" alt="" class="wp-image-1166" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-5.png?resize=1024%2C342&amp;ssl=1 1024w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-5.png?resize=300%2C100&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-5.png?resize=768%2C257&amp;ssl=1 768w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-5.png?resize=150%2C50&amp;ssl=1 150w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-5.png?w=1346&amp;ssl=1 1346w" sizes="auto, (max-width: 900px) 100vw, 900px" /></figure></div>



<p class="wp-block-paragraph">Dans le champs de recherche, saisis <strong>Alexa </strong>et choisis <strong>Alexa Media Player</strong> :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="500" height="325" src="//i1.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-6.png" alt="" class="wp-image-1167" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-6.png?w=500&amp;ssl=1 500w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-6.png?resize=300%2C195&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-6.png?resize=150%2C98&amp;ssl=1 150w" sizes="auto, (max-width: 500px) 100vw, 500px" /></figure></div>



<p class="wp-block-paragraph">Dans la fenêtre nouvellement ouverte, cliques sur <strong>Installer ce dépôt dans HACS</strong> puis sur <strong>Télécharger</strong>.</p>



<p class="wp-block-paragraph">Redémarres Home Assistant et vide le cache.</p>



<h2 class="wp-block-heading">Installation d&rsquo;Alexa Media Player</h2>



<p class="wp-block-paragraph">Une fois Home Assistant redémarré et le cache du navigateur vidé, ajoutes l&rsquo;intégration en passant par <strong>Configuration </strong>puis <strong>Intégrations </strong>et <strong>Ajouter l&rsquo;intégration</strong> :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="515" height="135" src="//i1.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-7.png" alt="" class="wp-image-1168" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-7.png?w=515&amp;ssl=1 515w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-7.png?resize=300%2C79&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-7.png?resize=150%2C39&amp;ssl=1 150w" sizes="auto, (max-width: 515px) 100vw, 515px" /></figure></div>



<p class="wp-block-paragraph">Cliques sur l&rsquo;intégration, l&rsquo;installation prend un peu de temps, patientes.</p>



<p class="wp-block-paragraph">Une fois qu&rsquo;on te donne la possibilité, saisis les informations demandées :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="602" height="573" src="//i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-8.png" alt="" class="wp-image-1169" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-8.png?w=602&amp;ssl=1 602w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-8.png?resize=300%2C286&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-8.png?resize=150%2C143&amp;ssl=1 150w" sizes="auto, (max-width: 602px) 100vw, 602px" /></figure></div>



<p class="wp-block-paragraph">Saisis ton compte et ton mot de passe et changes le <strong>Domaine de la région </strong>en plaçant <strong>amazon.fr</strong> (si tu as un compte français). En bas, cliques sur <strong>Soumettre</strong>.</p>



<p class="wp-block-paragraph">Une demande d&rsquo;authentification te sera demandée.</p>



<p class="wp-block-paragraph">Ton installation est finalisée, tu verras tout tes appareils listés :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="602" height="595" src="//i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-9.png" alt="" class="wp-image-1170" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-9.png?w=602&amp;ssl=1 602w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-9.png?resize=300%2C297&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-9.png?resize=150%2C148&amp;ssl=1 150w" sizes="auto, (max-width: 602px) 100vw, 602px" /></figure></div>



<p class="wp-block-paragraph">Cliques sur <strong>Terminer </strong>en bas de la page, tu verras tes appareils ainsi que les entités correspondantes :</p>



<h2 class="wp-block-heading">Faire apparaître les appareils sur le tableau de bord</h2>



<p class="wp-block-paragraph">Sur ton tableau de bord, ajoutes une carte <strong>Contrôle des médias</strong> :</p>



<p class="wp-block-paragraph"> </p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="966" height="421" src="//i3.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-10.png" alt="" class="wp-image-1171" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-10.png?w=966&amp;ssl=1 966w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-10.png?resize=300%2C131&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-10.png?resize=768%2C335&amp;ssl=1 768w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-10.png?resize=150%2C65&amp;ssl=1 150w" sizes="auto, (max-width: 900px) 100vw, 900px" /></figure></div>



<p class="wp-block-paragraph">Puis choisis l&rsquo;entité (l&rsquo;appareil) que tu souhaites voir apparaître et cliques sur <strong>Enregistrer</strong> :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="993" height="358" src="//i2.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-11.png" alt="" class="wp-image-1172" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-11.png?w=993&amp;ssl=1 993w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-11.png?resize=300%2C108&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-11.png?resize=768%2C277&amp;ssl=1 768w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-11.png?resize=150%2C54&amp;ssl=1 150w" sizes="auto, (max-width: 900px) 100vw, 900px" /></figure></div>



<p class="wp-block-paragraph">Voilà ce que cela donne :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="513" height="420" src="//i3.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-12.png" alt="" class="wp-image-1173" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-12.png?w=513&amp;ssl=1 513w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-12.png?resize=300%2C246&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-12.png?resize=150%2C123&amp;ssl=1 150w" sizes="auto, (max-width: 513px) 100vw, 513px" /></figure></div>



<h2 class="wp-block-heading">Faire parler son enceinte</h2>



<p class="wp-block-paragraph">Nous allons faire parler notre enceinte, pour cela, rends toi dans <strong>Outils de développement </strong>puis dans <strong>Service</strong>,.</p>



<p class="wp-block-paragraph">Dans service, choisis : <strong><em>notify.TON_APPAREIL</em></strong>, puis en mode YAML, saisie ce qui suit :</p>



<p class="wp-block-paragraph">Dans <strong>Actions </strong>(tout en bas de la page), choisir<strong> Appeler un service</strong>, ce sera une notification sur l&rsquo;appareil désiré :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">service: notify.alexa_media_dot_parent
data:
  data:
    type: tts
  message: bonjour
  
</pre>



<p class="wp-block-paragraph">Finis par cliquer <strong>Appeler le service</strong>.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Tu as maintenant un système de notification utilisant tes belles enceintes Alexa.</p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-ajouter-les-enceintes-alexa/">Home Assistant, ajouter les enceintes Alexa</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programmation.surleweb-france.fr/home-assistant-ajouter-les-enceintes-alexa/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1154</post-id>	</item>
		<item>
		<title>Home Assistant, gestion avancée du chauffage</title>
		<link>https://programmation.surleweb-france.fr/home-assistant-gestion-avancee-du-chauffage/</link>
					<comments>https://programmation.surleweb-france.fr/home-assistant-gestion-avancee-du-chauffage/#respond</comments>
		
		<dc:creator><![CDATA[Zigomato]]></dc:creator>
		<pubDate>Sat, 20 Nov 2021 23:07:58 +0000</pubDate>
				<category><![CDATA[Domotique]]></category>
		<category><![CDATA[chauffage]]></category>
		<category><![CDATA[climate]]></category>
		<category><![CDATA[datetime]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<category><![CDATA[input]]></category>
		<category><![CDATA[input_boolean]]></category>
		<category><![CDATA[input_number]]></category>
		<category><![CDATA[input_select]]></category>
		<category><![CDATA[sensor]]></category>
		<category><![CDATA[thermostat]]></category>
		<guid isPermaLink="false">https://programmation.surleweb-france.fr/?p=1190</guid>

					<description><![CDATA[<p>Mise en place pas à pas de la gestion du chauffage en fonction de plage horaire, de mode de fonctionnement en auto et manuel sur Home Assistant</p>
<p class="continue-reading-button"> <a class="continue-reading-link" href="https://programmation.surleweb-france.fr/home-assistant-gestion-avancee-du-chauffage/">Continuer la lecture<i class="crycon-right-dir"></i></a></p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-gestion-avancee-du-chauffage/">Home Assistant, gestion avancée du chauffage</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Avoir un système domotique est avant tout un moyen de gérer de manière centralisée ses équipements de la maison. La majorité des débutants commencent par contrôler les lumières en mettant des temporisations ou bien des capteurs de présence ou d&rsquo;ouverture.</p>



<p class="wp-block-paragraph">Nous avons vu dans un précédent article : <a href="https://programmation.surleweb-france.fr/home-assistant-utiliser-le-thermostat-generique/" target="_blank" rel="noreferrer noopener">utiliser le thermostat générique d&rsquo;Home Assistant</a>, les bases pour la gestion d&rsquo;un chauffage, il est temps de passer un cran au-dessus.</p>



<p class="wp-block-paragraph">Cet article représente beaucoup de travail, je vais décrire les différentes étapes pour la mise en place d&rsquo;un système complet de chauffage de la maison.</p>



<p class="wp-block-paragraph">N&rsquo;ayant pas encore ce qu&rsquo;il faut pour domotiser l&rsquo;ensemble de ma maison, j&rsquo;ai fait les automatisations avec une seule pièce en anticipant au maximum mes futurs besoins.</p>



<p class="wp-block-paragraph">Je mets l&rsquo;ensemble des scripts nécessaires, en effet, beaucoup de sites n&rsquo;ont pas mis l&rsquo;intégralité de leur configuration.</p>



<p class="wp-block-paragraph">J&rsquo;ai trouvé pas mal de piste sur le site de <a href="https://www.canaletto.fr/post/de-jeedom-a-home-assistant-le-chauffage" target="_blank" rel="noreferrer noopener">My Canaletto</a>.</p>



<h2 class="wp-block-heading">Objectifs</h2>



<p class="wp-block-paragraph">Mon but était de réaliser un système me permettant :</p>



<ul class="wp-block-list"><li>gérer des absences prolongées de toutes les personnes ou bien de quelques une</li><li>avoir un fonctionnement manuel ou automatique</li><li>gérer différentes plages horaires en fonction des moments clés de la journée</li><li>pouvoir modifier les plages horaires</li><li>avoir différents modes de chauffage (éco, normal, confort)</li><li>pouvoir modifier les consignes de température de chaque mode</li></ul>



<h2 class="wp-block-heading">Les prérequis</h2>



<p class="wp-block-paragraph">Je sais que je me répète beaucoup, j&rsquo;imagine que tu as une installation d&rsquo;Home Assistant fonctionnelle sinon tu peux te rendre sur cet article : <a href="https://programmation.surleweb-france.fr/installer-home-assistant-sur-raspberry/" target="_blank" rel="noreferrer noopener">Installation d&rsquo;Home Assistant</a>.</p>



<p class="wp-block-paragraph">Côté matériel, j&rsquo;ai réutilisé un chauffage électrique (j&rsquo;avoue, il y a mieux en terme de consommation) que j&rsquo;ai branché sur une prise connecté, voici un lien pour l&rsquo;acquérir : <a href="https://amzn.to/3oBEpiI" target="_blank" rel="noreferrer noopener">prise connectée</a>.</p>



<p class="wp-block-paragraph">Concernant le capteur de température, j&rsquo;avais un<a href="https://amzn.to/30CNiAs" target="_blank" rel="noreferrer noopener"> capteur xiaomi</a>.</p>



<p class="wp-block-paragraph">Durant tout cette lecture, tu auras besoin de l&rsquo;add-on <strong>File Editor</strong>, voir <a href="https://programmation.surleweb-france.fr/les-add-on-indispensables-pour-home-assistant/" target="_blank" rel="noreferrer noopener">l&rsquo;installation</a>.</p>



<p class="wp-block-paragraph">Pour la partie visuel, tu auras besoin d&rsquo;avoir <strong>HACS</strong>, <a href="https://programmation.surleweb-france.fr/home-assistant-installation-de-hacs/" target="_blank" rel="noreferrer noopener">Installer HACS</a>.</p>



<h2 class="wp-block-heading">Préparation</h2>



<p class="wp-block-paragraph">Avant de commencer le gros du sujet, on va définir mes différents fichiers, voici mon fichier <strong>configuration.yaml</strong> :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">automation: !include_dir_merge_list automation/

sensor: !include sensors.yaml

binary_sensor: !include binary_sensors.yaml

climate: !include_dir_merge_list climate/
# les entrées
input_boolean: !include input_booleans.yaml
input_number: !include input_numbers.yaml
input_select: !include input_selects.yaml
input_datetime: !include input_datetimes.yaml</pre>



<p class="wp-block-paragraph">Si dans le dossier <strong>config</strong>, tu n&rsquo;as pas ces fichiers, commences par les créer. </p>



<p class="wp-block-paragraph">Pour <strong>climate</strong>, j&rsquo;ai créé un dossier <strong>climate</strong> puis y ait placé le fichier chauffage_parents.yaml. </p>



<p class="wp-block-paragraph">Pour les automation, j&rsquo;ai également créer un dossier <strong>automation </strong>et y ait créer 3 fichiers :</p>



<ul class="wp-block-list"><li><em>chauffage_absent.yaml</em></li><li><em>chauffage_parents.yaml</em></li><li><em>demarrage.yaml</em></li></ul>



<h2 class="wp-block-heading">Le thermostat générique</h2>



<p class="wp-block-paragraph">J&rsquo;ai repris le thermostat que j&rsquo;ai créé dans mon précédent article : <a href="https://programmation.surleweb-france.fr/home-assistant-utiliser-le-thermostat-generique/" target="_blank" rel="noreferrer noopener">Utiliser un thermostat générique d&rsquo;Home Assistant</a>.</p>



<p class="wp-block-paragraph">Voici le contenu du fichier <em>chauffage_parents.yaml</em> (présent dans le dossier <strong>climate</strong>) :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># configuration du chauffage de la chambre des parents
- platform: generic_thermostat
  name: chauffage_parents
  heater: switch.prise_chauffage_parent_on_off
  target_sensor: sensor.tz3000_i8jfiezr_ts0201_9ff5c019_temperature
  min_temp: 16
  max_temp: 22
  ac_mode: false
  target_temp: 18
  cold_tolerance: 0
  hot_tolerance: 0
  initial_hvac_mode: "off"
  away_temp: 16
  precision: 0.1
  min_cycle_duration:
    seconds: 5
  keep_alive:
    minutes: 3
</pre>



<p class="wp-block-paragraph">Je n&rsquo;irai pas plus loin, si besoin, relis l&rsquo;article précédent.</p>



<h2 class="wp-block-heading">Les plages horaires</h2>



<p class="wp-block-paragraph">Commençons par les plages horaires, j&rsquo;ai choisi de découper ma journée en 4 parties :</p>



<ul class="wp-block-list"><li>le levée car madame (ma dame) ne souhaite pas avoir froid en sorti du lit =&gt; <strong>mode confort</strong></li><li>la journée, de manière générale, nous sommes actifs ou peu présent, le but est de maintenir une température agréable =&gt; <strong>mode normal</strong></li><li>la soirée, en rentrant du boulot ou d&rsquo;une sortie, il est agréable de retrouver un cocon chaud et douillé =&gt; <strong>mode confort</strong></li><li>la nuit, la température n&rsquo;a pas besoin d&rsquo;être élevée, un petit 16°C lorsque l&rsquo;on dort est tout à fait agréable =&gt; <strong>mode eco</strong></li></ul>



<p class="wp-block-paragraph">Pour la gestion de ses plages, j&rsquo;ai choisi de créer une variable binaire que je pourrais ré-utiliser facilement sans alourdir mes automatisations. </p>



<p class="wp-block-paragraph">En premier lieu, on définit les différentes heures en tant que <a href="https://www.home-assistant.io/integrations/input_datetime/" target="_blank" rel="noreferrer noopener">input_datetime</a> dans le fichier input_datetimes.yaml :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># réglage des heures de la journée par défaut au démarrage
heure_chauffage_debut_levee:
  has_date: false
  has_time: true
  initial: '06:00'
heure_chauffage_fin_levee: # est aussi l'heure de début de journée
  has_date: false
  has_time: true
  initial: '08:30'
heure_chauffage_fin_journee: # est aussi l'heure de début de soirée
  has_date: false
  has_time: true
  initial: '17:30'
heure_chauffage_fin_soiree: # est aussi l'heure de début de nuit
  has_date: false
  has_time: true
  initial: '22:00'
</pre>



<p class="wp-block-paragraph">J&rsquo;ai définit seulement 4 variables, une heure de fin de période correspondant au début de la période suivante. Cela permettra d&rsquo;éviter que des plages se superposent ou bien des trous dans la journée.</p>



<p class="wp-block-paragraph">Pour les variables binaire représentant chaque période, je crée donc 4 <a href="https://www.home-assistant.io/integrations/sensor/" target="_blank" rel="noreferrer noopener">sensors </a>voici le fichier <em>binary_sensors.yaml</em> :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># sensor pour la gestion de l'heure du thermostat
- platform: template
  sensors:
    chauffage_moment_levee:
      friendly_name: "Chauffage moment du levée"
      value_template: >
        {% if states.sensor.time.state > states.input_datetime.heure_chauffage_debut_levee.state %}
          {% if states.sensor.time.state &lt; states.input_datetime.heure_chauffage_fin_levee.state %}
            on
          {% else %}
            off
          {% endif %}
        {% else %}
          off
        {% endif %}
- platform: template
  sensors:
    chauffage_moment_journee:
      friendly_name: "Chauffage moment du la journée"
      value_template: >
        {% if states.sensor.time.state > states.input_datetime.heure_chauffage_fin_levee.state %}
          {% if states.sensor.time.state &lt; states.input_datetime.heure_chauffage_fin_journee.state %}
            on
          {% else %}
            off
          {% endif %}
        {% else %}
          off
        {% endif %}
- platform: template
  sensors:
    chauffage_moment_soiree:
      friendly_name: "Chauffage moment de la soiree"
      value_template: >
        {% if states.sensor.time.state > states.input_datetime.heure_chauffage_fin_journee.state %}
          {% if states.sensor.time.state &lt; states.input_datetime.heure_chauffage_fin_soiree.state %}
            on
          {% else %}
            off
          {% endif %}
        {% else %}
          off
        {% endif %}
- platform: template
  sensors:
    chauffage_moment_nuit:
      friendly_name: "Chauffage moment de la nuit"
      value_template: >
        {% if( states.sensor.time.state > states.input_datetime.heure_chauffage_fin_soiree.state and states.sensor.time.state &lt; '23:59:59') or ( states.sensor.time.state > '00:00:00' and states.sensor.time.state &lt; states.input_datetime.heure_chauffage_debut_levee.state ) %}
            on
        {% else %}
          off
        {% endif %}
  </pre>



<p class="wp-block-paragraph">Ici, j&rsquo;utilise mes variables <strong>datetime</strong>, représentant mes débuts et fins de plage.</p>



<p class="wp-block-paragraph">Pour finir avec les heures, dans le fichier sensors.yaml, écrire :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># utiliser pour la gestion du temps
- platform: time_date
  display_options:
  - 'time'
  - 'date'
  - 'date_time'
  - 'date_time_utc'
  - 'date_time_iso'
  - 'time_date'
  - 'time_utc'
  - 'beat'
  </pre>



<p class="wp-block-paragraph">J&rsquo;avoue ne pas savoir pourquoi on doit l&rsquo;écrire mais il le faut (désolé, pas d&rsquo;explication).</p>



<h2 class="wp-block-heading">Les consignes de température</h2>



<p class="wp-block-paragraph">Nous allons créer nos 3 consignes de température pour nos plages (eco, confort et normal), ce sont des <a href="https://www.home-assistant.io/integrations/input_number/" target="_blank" rel="noreferrer noopener">nombres</a>, voici le fichier <em>input_numbers.yaml</em> :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Réglage des consignes de température par défaut au démarrage
consigne_confort:
  name: 'Température de confort'
  initial: 20
  min: 15
  max: 25
  step: 0.1
  unit_of_measurement: °C
  
consigne_normal:
  name: 'Température normale'
  initial: 19
  min: 15
  max: 25
  step: 0.1
  unit_of_measurement: °C

consigne_eco:
  name: 'Température économique'
  initial: 16
  min: 15
  max: 25
  step: 0.1
  unit_of_measurement: °C
</pre>



<p class="wp-block-paragraph">Le nommage que j&rsquo;ai choisi est important, il sera réutilisé dans mes automatisations.</p>



<h2 class="wp-block-heading">Les modes de chauffage</h2>



<p class="wp-block-paragraph">Pour les 3 modes de chauffage :</p>



<ul class="wp-block-list"><li>eco</li><li>normal</li><li>confort</li></ul>



<p class="wp-block-paragraph">J&rsquo;ai choisi d&rsquo;utiliser un <a href="https://www.home-assistant.io/integrations/input_select/" target="_blank" rel="noreferrer noopener">select</a>, je l&rsquo;ai définit dans le fichier <a href="https://www.home-assistant.io/integrations/input_select/" target="_blank" rel="noreferrer noopener">input_selects.yaml</a> :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Les différents modes de chauffage
mode_chauffage:
  name: "Mode de chauffage"
  options:
    - eco
    - normal
    - confort
  initial: eco
</pre>



<p class="wp-block-paragraph">Pareil que précédemment, le nommage est important, chaque nom est identique à la fin du nom de la consigne.</p>



<h2 class="wp-block-heading">Mode de fonctionnent</h2>



<p class="wp-block-paragraph">Pour pouvoir choisir entre le mode de fonctionnement <strong>auto </strong>ou <strong>manuel</strong>, nous allons utiliser des <a href="https://www.home-assistant.io/integrations/input_boolean/" target="_blank" rel="noreferrer noopener">booléens</a>, voici le fichier<em> input_booleans.yaml</em> :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># entrée pour le choix de mode  
chauffage_auto:
  name: "Mode de chauffage auto"
  initial: false

chauffage_manuel:
  name: "Mode de chauffage manuel"
  initial: false
</pre>



<p class="wp-block-paragraph">Au démarrage, les deux modes sont éteints.</p>



<h2 class="wp-block-heading">Les absences</h2>



<p class="wp-block-paragraph">Pour représenter les absences, toujours dans le fichier <em>input_booleans.yaml</em>, nous allons ajouter :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Présence des personnes
vacances:
  name: Vacances
  icon: mdi:airplane
  
absence_parents:
  name: "Absence des parents"
  icon: mdi:human-male-female
  
absence_noemie:
  name: "Absence de Noémie"
  icon: mdi:face-woman
  
absence_raphael:
  name: "Absence de Raphael"
  icon: mdi:face-man</pre>



<p class="wp-block-paragraph">L&rsquo;entrée <strong>Vacances </strong>signifie que tous le monde est absent.</p>



<h2 class="wp-block-heading">Automatisation pour la gestion de la présence</h2>



<p class="wp-block-paragraph">Maintenant que toutes nos entités sont créées, attaquons la gestion de la présence, dans le fichier <em>chauffage_absent.yaml</em> :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># met tous les personnes absentes
- alias: chauffage_maison_vacances_depart
  trigger:
    - platform: state
      entity_id: input_boolean.vacances
      from: "off"
      to: "on"
  action:
    - service: input_boolean.turn_on
      target:
        entity_id:
          - input_boolean.absence_parents
          - input_boolean.absence_noemie
          - input_boolean.absence_raphael

# Met toutes les personnes présentes
- alias: chauffage_maison_vacances_retour
  trigger:
    - platform: state
      entity_id: input_boolean.vacances
      from: "on"
      to: "off"
  action:
    - service: input_boolean.turn_off
      target:
        entity_id:
          - input_boolean.absence_parents
          - input_boolean.absence_noemie
          - input_boolean.absence_raphael

# mets les parents absents
- alias: chauffage_absence_parent
  trigger:
    - platform: state
      entity_id: input_boolean.absence_parents
      from: "off"
      to: "on"
  action:
    - service: input_boolean.turn_off
      target:
        entity_id:
          - input_boolean.chauffage_auto
          - input_boolean.chauffage_manuel

# Empêche la mise "on" du mode auto et manu, les replace en off
- alias: chauffage_annulation
  trigger:
    - platform: state
      entity_id: input_boolean.chauffage_manuel
      from: "off"
      to: "on"
    - platform: state
      entity_id: input_boolean.chauffage_auto
      from: "off"
      to: "on"
  condition:
    - condition: or
      conditions:
      - condition: state
        entity_id: input_boolean.absence_parents
        state: "on"
      - condition: state
        entity_id: input_boolean.vacances
        state: "on"
  action:
    - service: input_boolean.turn_off
      target:
        entity_id:
          - input_boolean.chauffage_auto
          - input_boolean.chauffage_manuel
      
      </pre>



<p class="wp-block-paragraph">Les 3 premières automations permettent de mettre à jour le statut de moi et ma femme et des enfants que ce soit pour le départ ou le retour.</p>



<p class="wp-block-paragraph">La dernière automatisation permet d&rsquo;éviter la mise en route du chauffage (quelque-soit le mode fonctionnement) en cas d&rsquo;absence.</p>



<h2 class="wp-block-heading">Au démarrage de Home Assistant</h2>



<p class="wp-block-paragraph">En cas de reboot du système, je réinitialise mon chauffage qui est un chauffage électrique branché sur une prise connectée. Voici le fichier <em>demarrage.yaml</em> :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">- alias: "Démarrage d'Home Assistant"
  trigger:
    - platform: homeassistant
      event: start
  action:
    # éteint le chauffage si celui-ci est activé au démarrage
    - service: switch.turn_off
      entity_id: switch.prise_chauffage_parent_on_off
</pre>



<h2 class="wp-block-heading">La gestion du chauffage</h2>



<p class="wp-block-paragraph">Voici la plus grosse partie de cet article, tout ce qui suit se trouve dans le fichier <em>chauffage_parents.yaml</em> présent dans le dossier <strong>automation</strong>. Nous utiliserons les fonctions de <a href="https://www.home-assistant.io/integrations/climate/" target="_blank" rel="noreferrer noopener">climate</a>.</p>



<h3 class="wp-block-heading">Choix du mode de chauffage</h3>



<p class="wp-block-paragraph">Afin de choisir le mode de chauffage (eco, normal et confort), celui-ci ne fonctionne que si le mode de fonctionnement manuel est en cours d&rsquo;utilisation :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Modification du mode de chauffage en manuel quand celui-ci est activé
- alias: chauffage_parent_modification_mode
  trigger:
     - platform: state
       entity_id: input_select.mode_chauffage
  condition:
    - condition: state
      entity_id: input_boolean.chauffage_manuel
      state: "on"
  action:
    - service: climate.set_temperature
      data_template:
        entity_id: climate.chauffage_parents
        temperature: "{{ states('input_number.consigne_'+ states('input_select.mode_chauffage')) | float }}"</pre>



<p class="wp-block-paragraph">Si nous sommes en fonctionnement manuel, la consigne de température est modifiée. Sinon, le mode est préselectionné. </p>



<p class="wp-block-paragraph">C&rsquo;est ici que le nommage des variables a son important, la température est modifiée en prenant l&rsquo;état de la consigne en fonction du mode choisi.</p>



<h3 class="wp-block-heading">Modification de la consigne de température manuellement</h3>



<p class="wp-block-paragraph">Les trois mode de fonctionnement peuvent ne pas correspondre à un besoin ponctuelle, il est possible de modifier la température de consigne de chaque mode :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Modifie la consigne de la température eco quand le mode manuel est activé en mode éco
- alias: chauffage_parent_eco
  trigger:
    - platform: state
      entity_id: input_number.consigne_eco
  condition:
  - condition: or
    conditions:
      - condition: and
        conditions:
          - condition: state
            entity_id: input_select.mode_chauffage
            state: "eco"
          - condition: state
            entity_id: input_boolean.chauffage_manuel
            state: "on"
      - condition: and
        conditions:
          - condition: state
            entity_id: input_boolean.chauffage_auto
            state: "on"
          - condition: state
            entity_id: binary_sensor.chauffage_moment_nuit
            state: 'on'
  action:
    - service: climate.set_temperature
      data_template:
        entity_id: climate.chauffage_parents
        temperature: "{{ states('input_number.consigne_eco') | float }}"

# Modifie la consigne de la température confort quand le mode manuel ou auto est activé en mode confort
- alias: chauffage_parent_confort
  trigger:
    - platform: state
      entity_id: input_number.consigne_confort
  condition:
  - condition: or
    conditions:
      - condition: and
        conditions:
          - condition: state
            entity_id: input_select.mode_chauffage
            state: "confort"
          - condition: state
            entity_id: input_boolean.chauffage_manuel
            state: "on"
      - condition: and
        conditions:
          - condition: state
            entity_id: input_boolean.chauffage_auto
            state: "on"
          - condition: or
            conditions:
              - condition: state
                entity_id: binary_sensor.chauffage_moment_soiree
                state: 'on'
              - condition: state
                entity_id: binary_sensor.chauffage_moment_levee
                state: 'on'
  action:
    - service: climate.set_temperature
      data_template:
        entity_id: climate.chauffage_parents
        temperature: "{{ states('input_number.consigne_confort') | float }}"

# Modifie la consigne de la température normal quand le mode manuel ou auto est activé en mode normal
- alias: chauffage_parent_normal
  trigger:
    - platform: state
      entity_id: input_number.consigne_normal
  condition:
  - condition: or
    conditions:
      - condition: and
        conditions:
          - condition: state
            entity_id: input_select.mode_chauffage
            state: "normal"
          - condition: state
            entity_id: input_boolean.chauffage_manuel
            state: "on"
      - condition: and
        conditions:
          - condition: state
            entity_id: input_boolean.chauffage_auto
            state: "on"
          - condition: state
            entity_id: binary_sensor.chauffage_moment_journee
            state: 'on'
  action:
    - service: climate.set_temperature
      data_template:
        entity_id: climate.chauffage_parents
        temperature: "{{ states('input_number.consigne_normal') | float }}"
</pre>



<p class="wp-block-paragraph">Nous mettons à jours la température de consigne du thermostat seulement si le mode en cours correspond.</p>



<p class="wp-block-paragraph">Nous pouvons mettre à jour les autres modes mais les consignes seront prises seulement au redémarrage du mode.</p>



<p class="wp-block-paragraph">Il s&rsquo;agit d&rsquo;un gros pavé mais dans chaque automatisation, une seule condition change. Je verrai pour simplifier ce bout de code avec un template.</p>



<h3 class="wp-block-heading">Démarrage du mode auto</h3>



<p class="wp-block-paragraph">Voici l&rsquo;automation correspondante :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># démarre le chauffage en auto si présence des parents, le mode est pris en fonction de l'heure
- alias: chauffage_parent_auto_start
  trigger:
    - platform: state
      entity_id: input_boolean.chauffage_auto
      from: "off"
      to: "on"
  condition:
    - condition: state
      entity_id: input_boolean.absence_parents
      state: "off"
  action:
    - service: input_boolean.turn_off
      target: 
        entity_id: input_boolean.chauffage_manuel
    - service: climate.set_temperature
      data_template:
        entity_id: climate.chauffage_parents
        temperature: >
          {% if states.binary_sensor.chauffage_moment_levee.state == 'on' %}
            {{ states.input_number.consigne_confort.state | float }}
          {% elif states.binary_sensor.chauffage_moment_journee.state == 'on' %}
            {{ states.input_number.consigne_normal.state | float }}
          {% elif states.binary_sensor.chauffage_moment_soiree.state == 'on' %}
            {{ states.input_number.consigne_confort.state | float }}
          {% else %}
            {{ states.input_number.consigne_eco.state | float }}
          {% endif %}
    - service: climate.turn_on
      target:
        entity_id: climate.chauffage_parents
</pre>



<p class="wp-block-paragraph">A la sélection du mode auto, on vient vérifier si aucune absence est en cours, les parents vu que c&rsquo;est notre chambre. Lorsque le mode vacance est activé, les parents sont mis en absence également.</p>



<p class="wp-block-paragraph">Si la condition est respectée, on commence par éteindre le mode de chauffage manuel. Ensuite on récupère la consigne de température correspondant à la plage horaire.</p>



<p class="wp-block-paragraph">On finit par allumer le chauffage.</p>



<h3 class="wp-block-heading">Modification de la consigne en mode auto</h3>



<p class="wp-block-paragraph">Maintenant que notre chauffage a bien démarré en mode auto, il faut lui faire modifier sa consigne en fonction du moment de la journée :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># Modification de la consigne en fonction de l'heure
- alias: chauffage_modification_consigne_auto
  trigger:
    - platform: state
      entity_id: binary_sensor.chauffage_moment_levee
      from: "off"
      to: "on"
    - platform: state
      entity_id: binary_sensor.chauffage_moment_journee
      from: "off"
      to: "on"
    - platform: state
      entity_id: binary_sensor.chauffage_moment_soiree
      from: "off"
      to: "on"
    - platform: state
      entity_id: binary_sensor.chauffage_moment_nuit
      from: "off"
      to: "on"
  condition:
    - condition: state
      entity_id: input_boolean.chauffage_auto
      state: "on"
  action:
    - service: climate.set_temperature
      data_template:
        entity_id: climate.chauffage_parents
        temperature: >
          {% if states.binary_sensor.chauffage_moment_levee.state == 'on' %}
            {{ states.input_number.consigne_confort.state | float }}
          {% elif states.binary_sensor.chauffage_moment_journee.state == 'on' %}
            {{ states.input_number.consigne_normal.state | float }}
          {% elif states.binary_sensor.chauffage_moment_soiree.state == 'on' %}
            {{ states.input_number.consigne_confort.state | float }}
          {% else %}
            {{ states.input_number.consigne_eco.state | float }}
          {% endif %}
</pre>



<p class="wp-block-paragraph">Lorsque que le moment de la journée change (en fonction de l&rsquo;état des capteurs binaires créés), nous modifions la consigne en prenant celle correspondant au mode de fonctionnement :</p>



<ul class="wp-block-list"><li>eco pour la nuit</li><li>normal pour la journée</li><li>confort pour le levée et la soirée</li></ul>



<h3 class="wp-block-heading">Démarrage du mode manuel</h3>



<p class="wp-block-paragraph">Pour ce qui est du mode manuel, voici son script :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># démarre le chauffage manuel si les parents sont présent en fonction du mode de chauffage choisi (eco, normal, confort)
- alias: chauffage_parent_manuel_start
  trigger:
    - platform: state
      entity_id: input_boolean.chauffage_manuel
      from: "off"
      to: "on"
  condition:
    - condition: state
      entity_id: input_boolean.absence_parents
      state: "off"
  action:
    - service: input_boolean.turn_off
      target: 
        entity_id: input_boolean.chauffage_auto
    - service: climate.set_temperature
      data_template:
        entity_id: climate.chauffage_parents
        temperature: "{{ states('input_number.consigne_'+ states('input_select.mode_chauffage')) | float }}"
    - service: climate.turn_on
      target:
        entity_id: climate.chauffage_parents
</pre>



<p class="wp-block-paragraph">A la mise en route du mode manuel, si il n&rsquo;y pas pas d&rsquo;absence des parents, on commence par éteindre le mode auto.</p>



<p class="wp-block-paragraph">On récupère la température de consigne correspondante au mode de chauffage sélectionné et on démarre le chauffage.</p>



<h3 class="wp-block-heading">Les arrêts de fonctionnement</h3>



<p class="wp-block-paragraph">Voilà les deux automations pour l&rsquo;arrêt du chauffage (mode auto et manuel) :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group=""># stoppe le chauffage manuel
- alias: chauffage_parent_manuel_stop
  trigger:
    - platform: state
      entity_id: input_boolean.chauffage_manuel
      from: "on"
      to: "off"
  action:
    - service: climate.turn_off
      target:
        entity_id: climate.chauffage_parents

# stop le chauffage en mode auto
- alias: chauffage_parent_auto_stop
  trigger:
    - platform: state
      entity_id: input_boolean.chauffage_auto
      from: "on"
      to: "off"
  action:
    - service: climate.turn_off
      target:
        entity_id: climate.chauffage_parents</pre>



<p class="wp-block-paragraph">A présent, toutes nos automatisations fonctionnent.</p>



<h2 class="wp-block-heading">Le tableau de bord</h2>



<p class="wp-block-paragraph">Commencer par installer le plugin <a href="https://github.com/benct/lovelace-multiple-entity-row" target="_blank" rel="noreferrer noopener">Multiple Entity Row</a>, cela permettra de mettre sur une même ligne plusieurs entités, notamment les heures pour les plages horaires. Rends toi dans <strong>HACS </strong>puis Frontend, recherches et installes<strong> Multiple Entity Row</strong> :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="924" height="397" src="//i1.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-19.png" alt="" class="wp-image-1199" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-19.png?w=924&amp;ssl=1 924w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-19.png?resize=300%2C129&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-19.png?resize=768%2C330&amp;ssl=1 768w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-19.png?resize=150%2C64&amp;ssl=1 150w" sizes="auto, (max-width: 900px) 100vw, 900px" /></figure></div>



<h3 class="wp-block-heading">Gestion de la présence</h3>



<p class="wp-block-paragraph">Créer une première carte en allant sur ton tableau de bord, puis modifier et ajouter une carte manuelle, en mode <strong>YAML</strong>, ajoutes :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">type: entities
entities:
  - entity: input_boolean.vacances
  - entity: input_boolean.absence_parents
  - entity: input_boolean.absence_noemie
  - entity: input_boolean.absence_raphael
state_color: true</pre>



<p class="wp-block-paragraph">Pour bien comprendre où mettre le script (méthode utilisée pour tous les autres visuels), voici une capture :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1001" height="401" src="//i1.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-20.png" alt="" class="wp-image-1203" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-20.png?w=1001&amp;ssl=1 1001w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-20.png?resize=300%2C120&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-20.png?resize=768%2C308&amp;ssl=1 768w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-20.png?resize=150%2C60&amp;ssl=1 150w" sizes="auto, (max-width: 900px) 100vw, 900px" /></figure></div>



<h3 class="wp-block-heading">Visualisation de l&rsquo;état du thermostat</h3>



<p class="wp-block-paragraph">On ajoute une seconde carte permettant de voir l&rsquo;état du thermostat ainsi que la température de consigne et la température mesurée mais aussi le statut du chauffage (dans mon cas la prise) :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">type: entities
entities:
  - entity: climate.chauffage_parents
  - entity: switch.prise_chauffage_parent_on_off
state_color: true</pre>



<p class="wp-block-paragraph">Ce que cela donne :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="354" height="109" src="//i1.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-22.png" alt="" class="wp-image-1205" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-22.png?w=354&amp;ssl=1 354w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-22.png?resize=300%2C92&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-22.png?resize=150%2C46&amp;ssl=1 150w" sizes="auto, (max-width: 354px) 100vw, 354px" /></figure></div>



<h3 class="wp-block-heading">Carte des réglages du chauffage</h3>



<p class="wp-block-paragraph">C&rsquo;est ici que l&rsquo;add-on <strong>Multiple Entity Row</strong> est utilisé (sur les plages horaires) :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">type: entities
title: Réglages chauffage
state_color: true
entities:
  - entity: input_boolean.chauffage_auto
    name: Chauffage automatique
  - type: section
  - entity: input_boolean.chauffage_manuel
    name: Chauffage manuel
  - entity: input_select.mode_chauffage
    name: Mode de chauffage Manuel
  - type: section
  - entity: input_datetime.heure_chauffage_debut_levee
    type: custom:multiple-entity-row
    name: Levée (confort)
    show_state: false
    entities:
      - entity: input_datetime.heure_chauffage_debut_levee
        name: Début
      - entity: input_datetime.heure_chauffage_fin_levee
        name: Fin
  - entity: input_datetime.heure_chauffage_debut_levee
    type: custom:multiple-entity-row
    name: Journée (normal)
    show_state: false
    entities:
      - entity: input_datetime.heure_chauffage_fin_levee
        name: Début
      - entity: input_datetime.heure_chauffage_fin_journee
        name: Fin
  - entity: input_datetime.heure_chauffage_debut_levee
    type: custom:multiple-entity-row
    name: Soirée (confort)
    show_state: false
    entities:
      - entity: input_datetime.heure_chauffage_fin_journee
        name: Début
      - entity: input_datetime.heure_chauffage_fin_soiree
        name: Fin
  - entity: input_datetime.heure_chauffage_debut_levee
    type: custom:multiple-entity-row
    name: Nuit (eco)
    show_state: false
    entities:
      - entity: input_datetime.heure_chauffage_fin_soiree
        name: Début
      - entity: input_datetime.heure_chauffage_debut_levee
        name: Fin
  - type: section
  - entity: input_number.consigne_confort
  - entity: input_number.consigne_normal
  - entity: input_number.consigne_eco
show_header_toggle: false
</pre>



<p class="wp-block-paragraph">Voici le rendu :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="354" height="580" src="//i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-21.png" alt="" class="wp-image-1204" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-21.png?w=354&amp;ssl=1 354w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-21.png?resize=183%2C300&amp;ssl=1 183w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-21.png?resize=92%2C150&amp;ssl=1 92w" sizes="auto, (max-width: 354px) 100vw, 354px" /></figure></div>



<p class="wp-block-paragraph">Bien entendu, libre à toi d&rsquo;imaginer ton propre tableau de bord.</p>



<h2 class="wp-block-heading">Les futures pistes d&rsquo;amélioration</h2>



<p class="wp-block-paragraph">N&rsquo;ayant pas de thermomètre extérieur, je n&rsquo;ai pas pu ajouter une condition au démarrage du chauffage en mode automatique en fonction de la température extérieure (avec un bouton pour activer ou désactiver cette option).</p>



<p class="wp-block-paragraph">Toujours à cause du même manque de matériel, il peut être utile de désactiver le chauffage si une fenêtre ou une porte est ouverte.</p>



<p class="wp-block-paragraph">Il est également possible de gérer la ventilation en fonction de l&rsquo;humidité (avec une VMC par exemple).</p>



<p class="wp-block-paragraph">Dans mon automatisation, j&rsquo;ai quelques améliorations à faire, notamment pour éviter de répéter le choix des consignes en créant un sensor que j&rsquo;appelera à la place : </p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">{% if states.binary_sensor.chauffage_moment_levee.state == 'on' %}
  {{ states.input_number.consigne_confort.state | float }}
{% elif states.binary_sensor.chauffage_moment_journee.state == 'on' %}
  {{ states.input_number.consigne_normal.state | float }}
{% elif states.binary_sensor.chauffage_moment_soiree.state == 'on' %}
  {{ states.input_number.consigne_confort.state | float }}
{% else %}
  {{ states.input_number.consigne_eco.state | float }}
{% endif %}</pre>



<p class="wp-block-paragraph">Ce sont des points que je mettrai en place dans un second temps.</p>



<p class="wp-block-paragraph">Je mettrai à jour cet article au fur et à mesure que je rajouterai les chauffages dans les 2 autres chambres.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Voilà qui est fait, tu es arrivé au bout et j&rsquo;espère que j&rsquo;ai pu répondre à un maximum de tes interrogations, j&rsquo;ai passé beaucoup de temps à mettre en place cette automatisation, internet contenant que des bribes d&rsquo;éléments.</p>



<p class="wp-block-paragraph">N&rsquo;hésites pas à me faire part de tes commentaires.</p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-gestion-avancee-du-chauffage/">Home Assistant, gestion avancée du chauffage</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programmation.surleweb-france.fr/home-assistant-gestion-avancee-du-chauffage/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1190</post-id>	</item>
		<item>
		<title>Home assistant, utiliser le thermostat générique</title>
		<link>https://programmation.surleweb-france.fr/home-assistant-utiliser-le-thermostat-generique/</link>
					<comments>https://programmation.surleweb-france.fr/home-assistant-utiliser-le-thermostat-generique/#respond</comments>
		
		<dc:creator><![CDATA[Zigomato]]></dc:creator>
		<pubDate>Thu, 18 Nov 2021 17:00:00 +0000</pubDate>
				<category><![CDATA[Domotique]]></category>
		<category><![CDATA[chauffage]]></category>
		<category><![CDATA[climate]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<category><![CDATA[température]]></category>
		<category><![CDATA[thermostat]]></category>
		<guid isPermaLink="false">https://programmation.surleweb-france.fr/?p=1178</guid>

					<description><![CDATA[<p>Voici la mise en place d'un thermostat simple dans Home Assistant pour commander un chauffage à partir d'un capteur de température</p>
<p class="continue-reading-button"> <a class="continue-reading-link" href="https://programmation.surleweb-france.fr/home-assistant-utiliser-le-thermostat-generique/">Continuer la lecture<i class="crycon-right-dir"></i></a></p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-utiliser-le-thermostat-generique/">Home assistant, utiliser le thermostat générique</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Mon premier hiver dans la maison fait que je commence à regarder la configuration et l&rsquo;optimisation de la chauffe mais aussi la mise en place de moyen de faire des économies en chauffant que si c&rsquo;est nécessaire :</p>



<ul class="wp-block-list"><li>la journée</li><li>le week-end</li><li>au réveil</li><li>en soirée</li><li>la nuit</li><li>en cas d&rsquo;absence prolongé</li></ul>



<p class="wp-block-paragraph">Ce qui est super avec Home Assistant, c&rsquo;est qu&rsquo;il y a déjà plein d&rsquo;outils pour réaliser cela.</p>



<p class="wp-block-paragraph">Dans cet article, je ne vais pas détailler la mise ne place complète de toutes les règles mais seulement le fonctionnement du thermostat générique présent dans Home Assistant. Je choisis de procéder en plusieurs articles tout simplement pour que la mise en place soit clair et que l&rsquo;article ne mélange pas trop de concept. Beaucoup d&rsquo;articles sur le net (même des très bons) fournissent beaucoup d&rsquo;informations qui peuvent être difficiles d&rsquo;appréhender pour un néophyte (tu peux jetter un oeil <a href="https://siytek.com/the-ultimate-home-assistant-diy-thermostat-guide-for-single-or-multiple-zone-heating/" target="_blank" rel="noreferrer noopener">ici</a>).</p>



<h2 class="wp-block-heading">Les prérequis</h2>



<p class="wp-block-paragraph">Je me répète mais tout d&rsquo;abord, il te faudra un système opérationnel, si tu pars de zéro, je t&rsquo;invite à suivre ce lien : <a href="https://programmation.surleweb-france.fr/installer-home-assistant-sur-raspberry/" target="_blank" rel="noreferrer noopener">Installation d&rsquo;Home Assistant sur un Raspberry</a>.</p>



<p class="wp-block-paragraph">Ensuite, tu auras besoin d&rsquo;un système de chauffe et d&rsquo;un thermomètre, bien sûr que tout devra être connecté.</p>



<p class="wp-block-paragraph">Je ne parlerai pas de thermostat connecté, je n&rsquo;en ai pas, j&rsquo;ai réutilisé un chauffage électrique (j&rsquo;avoue, il y a mieux en terme de consommation) que j&rsquo;ai branché sur une prise connecté, voici un lien pour l&rsquo;acquérir : <a href="https://amzn.to/3oBEpiI" target="_blank" rel="noreferrer noopener">prise connectée</a>.</p>



<p class="wp-block-paragraph">Concernant le capteur de température, j&rsquo;avais un<a href="https://amzn.to/30CNiAs" target="_blank" rel="noreferrer noopener"> capteur xiaomi</a>.</p>



<h2 class="wp-block-heading">Configuration</h2>



<p class="wp-block-paragraph">Je n&rsquo;aborderai pas l&rsquo;installation d&rsquo;un nouvel appareil, nous allons directement attaquer la mise en place du thermostat pour ce couple prise chauffage et capteur de température.</p>



<p class="wp-block-paragraph">Home Assistant a mis à disposition un thermostat générique avec lequel, nous allons pouvoir définir les plages de température, le chauffage et le capteur.</p>



<p class="wp-block-paragraph">Nous allons donc utiliser l&rsquo;intégration <a href="https://www.home-assistant.io/integrations/climate/" target="_blank" rel="noreferrer noopener">Climate </a>intégrée à HA et la plateforme <a href="https://www.home-assistant.io/integrations/generic_thermostat/" target="_blank" rel="noreferrer noopener">generic_thermostat</a>.</p>



<p class="wp-block-paragraph">Dans le fichier <strong>configuration.yaml</strong>, on va ajouter un lien vers un dossier <strong>climate </strong>qui contiendra notre configuration :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">climate: !include_dir_merge_list climate/</pre>



<p class="wp-block-paragraph">Avec <strong>File Editor</strong> (pour l&rsquo;installer, rends toi sur <a href="https://programmation.surleweb-france.fr/les-add-on-indispensables-pour-home-assistant/" target="_blank" rel="noreferrer noopener">Les Add-ons indispensables</a>), nous allons ajouter dans <strong>config </strong>le dossier <strong>climate</strong>.</p>



<p class="wp-block-paragraph">Dans le dossier <strong>climate</strong>, on va créer un fichier <strong>generic_thermostat.yaml</strong>. L&rsquo;arborescence doit ressembler à ça : <em>/config/climate/generic_thermostat.yaml</em>.</p>



<p class="wp-block-paragraph">Maintenant, nous allons écrire ce qui suit dans ce nouveau fichier :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">- platform: generic_thermostat
  # Nom de notre thermostat
  name: Chauffage de la chambre des parents
  # entité du chauffage
  heater: switch.prise_chauffage_parent_on_off
  # entité du capteur de température
  target_sensor: sensor.temperature_parent_temperature
  # la température réglable minimum du thermostat
  min_temp: 16
  # la température réglable maximum du thermostat
  max_temp: 20
  # mode de fonctionnement du système "heater"
  ac_mode: false
  # la température cible
  target_temp: 18
  # il s'agit de la tolérance de température basse pour l'activation de la chauffe
  cold_tolerance: 0
  # tolérance de la température avant que la chauffe ne soit activer
  hot_tolerance: 0.3
  # il s'agit du mode dans lequel le thermostat démarre la première fois
  initial_hvac_mode: "off"
  # température en cas de mode absent
  away_temp: 16
  # Il s'agit de la précision pour le réglage de la température
  precision: 0.1
  # le temps minimum d'un cycle de fonctionnement
  min_cycle_duration:
    seconds: 5
  " maintient en chauffe au moins 3 minutes si le thermostat ne reçoit pas de commande
  keep_alive:
    minutes: 3</pre>



<p class="wp-block-paragraph">Voilà pour la configuration de l&rsquo;intégration <strong>climate</strong>.</p>



<p class="wp-block-paragraph">Dans notre cas,<strong> cold_tolerance</strong> et<strong> hot_tolerance</strong> ne sont pas réellement utiles, ils sont indispensable si <strong>ac_mode</strong> est <strong>true</strong>, ce qui signifie que l&rsquo;on fonctionne en climatisation.</p>



<h2 class="wp-block-heading">Visualisation sur le tableau de bord</h2>



<p class="wp-block-paragraph">Pour être sûr que le thermostat soit bien pris en compte, redémarres Home Assistant et efface le cache du navigateur.</p>



<p class="wp-block-paragraph">Nous allons créer deux cartes qui permettront de bien visualiser notre thermostat, ce qui donnera cela :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="520" height="464" src="//i3.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-16.png" alt="" class="wp-image-1179" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-16.png?w=520&amp;ssl=1 520w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-16.png?resize=300%2C268&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-16.png?resize=150%2C134&amp;ssl=1 150w" sizes="auto, (max-width: 520px) 100vw, 520px" /></figure></div>



<p class="wp-block-paragraph">Pour la première carte, nous allons créer une carte entité en intégrant nos deux entités :</p>



<ul class="wp-block-list"><li>le capteur</li><li>le chauffage</li></ul>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="987" height="395" src="//i3.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-17.png" alt="" class="wp-image-1180" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-17.png?w=987&amp;ssl=1 987w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-17.png?resize=300%2C120&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-17.png?resize=768%2C307&amp;ssl=1 768w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-17.png?resize=150%2C60&amp;ssl=1 150w" sizes="auto, (max-width: 900px) 100vw, 900px" /></figure></div>



<p class="wp-block-paragraph">Sélectionnes tes deux entités, cliques sur Continuer puis sur Ajouter au tableau de bord.</p>



<p class="wp-block-paragraph">Pour la seconde carte, ajoutes une nouvelle carte en recherchant thermostat :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="550" height="492" src="//i2.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-18.png" alt="" class="wp-image-1181" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-18.png?w=550&amp;ssl=1 550w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-18.png?resize=300%2C268&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-18.png?resize=150%2C134&amp;ssl=1 150w" sizes="auto, (max-width: 550px) 100vw, 550px" /></figure></div>



<p class="wp-block-paragraph">Dans la nouvelle fenêtre, sélectionnes l&rsquo;entité qui correspond à la configuration du thermostat (de la première partie) puis enregistres.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Te voilà maintenant un thermostat basique gérer dans Home Assistant.</p>



<p class="wp-block-paragraph">Reviens dans quelques jours, il devrait y avoir une gestion plus précise du thermostat.</p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-utiliser-le-thermostat-generique/">Home assistant, utiliser le thermostat générique</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programmation.surleweb-france.fr/home-assistant-utiliser-le-thermostat-generique/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1178</post-id>	</item>
		<item>
		<title>Home Assistant, installer HACS</title>
		<link>https://programmation.surleweb-france.fr/home-assistant-installation-de-hacs/</link>
					<comments>https://programmation.surleweb-france.fr/home-assistant-installation-de-hacs/#respond</comments>
		
		<dc:creator><![CDATA[Zigomato]]></dc:creator>
		<pubDate>Tue, 16 Nov 2021 17:57:42 +0000</pubDate>
				<category><![CDATA[Domotique]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[HACS]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<category><![CDATA[intégration]]></category>
		<category><![CDATA[samba]]></category>
		<guid isPermaLink="false">https://programmation.surleweb-france.fr/?p=1155</guid>

					<description><![CDATA[<p>HACS permet d'accéder à une bibliothèque d'intégrations développées par la communauté, son installation dans le système est très simple</p>
<p class="continue-reading-button"> <a class="continue-reading-link" href="https://programmation.surleweb-france.fr/home-assistant-installation-de-hacs/">Continuer la lecture<i class="crycon-right-dir"></i></a></p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-installation-de-hacs/">Home Assistant, installer HACS</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Bien qu&rsquo;il y ait un nombre important d&rsquo;intégration disponible sur le store officiel, tu auras certainement besoin d&rsquo;installer des intégrations ou ressources qui ne sont pas officielles mais qui seront tout de même très sérieuses et parfois plus complête que certaines intégrations officielles.</p>



<p class="wp-block-paragraph"><strong>HACS </strong>pour <strong>Home Assistant Community Store</strong> est une intégration qui te permettra d&rsquo;ajouter un nombre très important de modules non officiels.</p>



<h2 class="wp-block-heading">Les prérequis</h2>



<p class="wp-block-paragraph">De base, tu auras besoin d&rsquo;avoir un Home Assistant d&rsquo;installer et fonctionnel, tu peux suivre cet article pour l&rsquo;avoir : <a href="https://programmation.surleweb-france.fr/installer-home-assistant-sur-raspberry/" target="_blank" rel="noreferrer noopener">Installer Home Assistant sur un Raspberry</a>.</p>



<p class="wp-block-paragraph">Une fois cela fait, il est indispensable d&rsquo;avoir un compte <a href="https://github.com/" target="_blank" rel="noreferrer noopener">GitHub</a>. L&rsquo;inscription et l&rsquo;utilisation que tu vas en faire ici sont entièrement gratuites</p>



<p class="wp-block-paragraph">Tu devras avoir accès aux fichiers de ton installation, <strong>Samba Share</strong> et <strong>File Editor</strong>, le premier permet le transfert de fichiers sur ta configuration et le second permet d&rsquo;écrire dans les fichiers. Pour leur installation, tu peux lire cette page : <a href="https://programmation.surleweb-france.fr/les-add-on-indispensables-pour-home-assistant/" target="_blank" rel="noreferrer noopener">Installer les add-ons indispensables</a>.</p>



<p class="wp-block-paragraph">Une fois tout cela disponible, on peut commencer.</p>



<h2 class="wp-block-heading">Récupération de HACS</h2>



<p class="wp-block-paragraph">Commences par te rendre sur le GitHub de Hacs pour télécharger la dernière version, <a href="https://github.com/hacs/integration" target="_blank" rel="noreferrer noopener">HACS</a>.</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="385" height="303" src="//i3.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image.png" alt="" class="wp-image-1156" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image.png?w=385&amp;ssl=1 385w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image.png?resize=300%2C236&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image.png?resize=150%2C118&amp;ssl=1 150w" sizes="auto, (max-width: 385px) 100vw, 385px" /></figure></div>



<p class="wp-block-paragraph">Cliques sur <strong>Code </strong>et sur <strong>Download ZIP</strong>.</p>



<p class="wp-block-paragraph">Uns fois téléchargé, décompresses le dossier.<br></p>



<h2 class="wp-block-heading">Créer le fichier custom_components</h2>



<p class="wp-block-paragraph">Si ce n&rsquo;est pas déjà fait, avec <strong>File Editor</strong>, crées un dossier <em>custom_components</em> dans le dossier <strong>config</strong>.</p>



<h2 class="wp-block-heading">Copie des dossiers de HACS</h2>



<p class="wp-block-paragraph">Dans le dossier que tu as téléchargé, il y a un dossier <strong>custom_components</strong>. A l&rsquo;intérieur, il y a le dossier <strong>hacs </strong>que tu copies et que tu colles dans le dossier précédemment créé.</p>



<p class="wp-block-paragraph">Tu peux le placer à l&rsquo;intérieur avec l&rsquo;intégration <strong>Samba Share</strong>.</p>



<p class="wp-block-paragraph">Tu dois respecter cet arborescence : <strong>/config/custom_components/hacs</strong>.</p>



<p class="wp-block-paragraph">Redémarres ton système et vides le cache de ton navigateur.</p>



<blockquote class="wp-block-quote is-layout-flow wp-block-quote-is-layout-flow"><p>Je t&rsquo;invite à vider le cache de ton navigateur à chaque fois que tu installes une nouvelle intégration.</p></blockquote>



<h2 class="wp-block-heading">Installation et configuration</h2>



<p class="wp-block-paragraph">Une fois que ton système a redémarré, sur Home Assistant, rends toi dans Configuration puis Intégrations.</p>



<p class="wp-block-paragraph">Pour ajouter une nouvelle intégration, cliques sur le plus en bas de la page :</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="262" height="87" src="//i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-2.png" alt="" class="wp-image-1158" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-2.png?w=262&amp;ssl=1 262w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-2.png?resize=150%2C50&amp;ssl=1 150w" sizes="auto, (max-width: 262px) 100vw, 262px" /></figure></div>



<p class="wp-block-paragraph">Dans le champs de recherche, saisis <strong>HACS </strong>:</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="544" height="172" src="//i1.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-3.png" alt="" class="wp-image-1159" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-3.png?w=544&amp;ssl=1 544w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-3.png?resize=300%2C95&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-3.png?resize=150%2C47&amp;ssl=1 150w" sizes="auto, (max-width: 544px) 100vw, 544px" /></figure></div>



<p class="wp-block-paragraph">Cliques sur HACS et suit les étapes de connexion.</p>



<p class="wp-block-paragraph">Redémarres ton système et vides le cache. Le premier démarrage de HACS peut être longue.</p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="1024" height="399" src="//i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-4-1024x399.png" alt="" class="wp-image-1160" srcset="https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-4.png?resize=1024%2C399&amp;ssl=1 1024w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-4.png?resize=300%2C117&amp;ssl=1 300w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-4.png?resize=768%2C300&amp;ssl=1 768w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-4.png?resize=150%2C59&amp;ssl=1 150w, https://i0.wp.com/programmation.surleweb-france.fr/wp-content/uploads/2021/11/image-4.png?w=1146&amp;ssl=1 1146w" sizes="auto, (max-width: 900px) 100vw, 900px" /></figure></div>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Tu peux désormais profiter de la bibliothèque très bien fournie par la communauté de Home Assistant.</p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-installation-de-hacs/">Home Assistant, installer HACS</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programmation.surleweb-france.fr/home-assistant-installation-de-hacs/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1155</post-id>	</item>
		<item>
		<title>Home Assistant, utiliser les groupes</title>
		<link>https://programmation.surleweb-france.fr/home-assistant-utiliser-les-groupes/</link>
					<comments>https://programmation.surleweb-france.fr/home-assistant-utiliser-les-groupes/#respond</comments>
		
		<dc:creator><![CDATA[Zigomato]]></dc:creator>
		<pubDate>Wed, 09 Jun 2021 16:37:13 +0000</pubDate>
				<category><![CDATA[Domotique]]></category>
		<category><![CDATA[group]]></category>
		<category><![CDATA[groupe]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<category><![CDATA[lumière]]></category>
		<guid isPermaLink="false">https://programmation.surleweb-france.fr/?p=1033</guid>

					<description><![CDATA[<p>L'utilisation des groupes dans Home Assistant permet de simplifier et de regrouper plusieurs éléments en un ensemble.</p>
<p class="continue-reading-button"> <a class="continue-reading-link" href="https://programmation.surleweb-france.fr/home-assistant-utiliser-les-groupes/">Continuer la lecture<i class="crycon-right-dir"></i></a></p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-utiliser-les-groupes/">Home Assistant, utiliser les groupes</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Chose que je n&rsquo;ai pas encore abordé ni utilisé sont les groupes. Les groupes vont te permettre d&rsquo;agir sur plusieurs éléments d&rsquo;un coup en les regroupant. Les groupes ne sont pas indispensables mais ils donneront bien plus de lisibilité à tes codes.</p>



<p class="wp-block-paragraph">Je vais te montrer la syntaxe de base d&rsquo;un groupe ainsi que sont utilisation.</p>



<p class="wp-block-paragraph">Je pars du principe que tu as une installation avec Home Assistant prête si ce n&rsquo;est pas le cas, tu peux suivre lire <a href="https://programmation.surleweb-france.fr/installer-home-assistant-sur-raspberry/" target="_blank" rel="noreferrer noopener">cet article</a>.</p>



<h2 class="wp-block-heading">Emplacement du groupe</h2>



<p class="wp-block-paragraph">Les groupes sont à définir dans la configurations, en théorie, tu as un <strong><em>include </em></strong>dans le fichier <strong><em>configurations.yaml</em></strong>, comme cela :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">group: !include groups.yaml</pre>



<p class="wp-block-paragraph">Il faudra donc écrire (définir) les groupes dans le fichier <strong><em>groups.yaml</em></strong>.</p>



<h2 class="wp-block-heading">Syntaxe d&rsquo;écriture d&rsquo;un groupe</h2>



<p class="wp-block-paragraph">On va simplement voir la création d&rsquo;un groupe :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">chambre:
  name: chambre
  view: yes
  entities:
    - light.chambre</pre>



<p class="wp-block-paragraph">La première ligne est le nom du groupe, à ne pas confondre avec la seconde ligne qui correspond au nom usuel, celui qui apparaîtra.</p>



<p class="wp-block-paragraph">La ligne <strong><em>view </em></strong>permet de définir si le groupe est visible ou pas.</p>



<p class="wp-block-paragraph">Enfin, <strong><em>entities </em></strong>permet de lister les entités qui font parties du groupes.</p>



<h2 class="wp-block-heading">Utilisation des groupes</h2>



<p class="wp-block-paragraph">Voici un petit exemple, je vais créer un groupe qui contiendra des groupes de lumière, cela permettra de ne pas avoir à modifier plusieurs scripts si j&rsquo;ajoute ou retire une lumière :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">lumiere_chambre_fille:
  name: 'Lumière de la chambre de la fille'
  icon: mdi:lightbulb
  entities:
    - light.lampe_rgb_fille_level_light_color_on_off

    
lumiere_chambre_garcon:
  name: 'Lumière de la chambre de garçon'
  icon: mdi:lightbulb
  entities:
    - light.lampe_rgb_garcon_level_light_color_on_off

lumieres:
  name: 'Toutes les lumières'
  icon: mdi:lightbulb
  entities:
    - gtoup.lumiere_chambre_fille
    - group.lumiere_chambre_garcon</pre>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Voilà un petit exemple d&rsquo;utilisation de groupe, bin sûr, cet article est plus un moyen de montrer l&rsquo;utilisation des groupes.</p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-utiliser-les-groupes/">Home Assistant, utiliser les groupes</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programmation.surleweb-france.fr/home-assistant-utiliser-les-groupes/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1033</post-id>	</item>
		<item>
		<title>Home Assistant, création d&#8217;un Blueprint</title>
		<link>https://programmation.surleweb-france.fr/home-assistant-creation-dun-blueprint/</link>
					<comments>https://programmation.surleweb-france.fr/home-assistant-creation-dun-blueprint/#respond</comments>
		
		<dc:creator><![CDATA[Zigomato]]></dc:creator>
		<pubDate>Tue, 04 May 2021 14:00:26 +0000</pubDate>
				<category><![CDATA[Domotique]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[automatisation]]></category>
		<category><![CDATA[blueprint]]></category>
		<category><![CDATA[condition]]></category>
		<category><![CDATA[création]]></category>
		<category><![CDATA[entité]]></category>
		<category><![CDATA[Home Assistant]]></category>
		<category><![CDATA[trigger]]></category>
		<guid isPermaLink="false">https://programmation.surleweb-france.fr/?p=938</guid>

					<description><![CDATA[<p>La création d'un blueprint pour Home Assistant est aussi simple que de créer son automation et permet de gagner du temps dans le développement de sa solution domotique</p>
<p class="continue-reading-button"> <a class="continue-reading-link" href="https://programmation.surleweb-france.fr/home-assistant-creation-dun-blueprint/">Continuer la lecture<i class="crycon-right-dir"></i></a></p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-creation-dun-blueprint/">Home Assistant, création d&rsquo;un Blueprint</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></description>
										<content:encoded><![CDATA[
<p class="wp-block-paragraph">Dans un de mes premier article sur Home Assistant, j&rsquo;avais vu comment <a href="https://programmation.surleweb-france.fr/home-assistant-creer-sa-premiere-automatisation/" target="_blank" rel="noreferrer noopener">créer une automatisation en utilisant un blueprint</a>, ensuite, j&rsquo;ai montré, en utilisant en exemple l&rsquo;allumage d&rsquo;une lampe, <a href="https://programmation.surleweb-france.fr/home-assistant-comprendre-les-automatisations-manuelles/" target="_blank" rel="noreferrer noopener">comment créer une automatisation manuellement</a>. Il est temps de montrer comment créer son propre blueprint. Le blueprint, via une interface graphique, va te permettre de sélectionner tes différents éléments pour la mise en place de l&rsquo;automatisation sans avoir à aller coder dans les fichiers YAML.</p>



<p class="wp-block-paragraph">La première question à laquelle je vais répondre est : « Pourquoi créer son Blueprint ? »</p>



<p class="wp-block-paragraph">La réponse est des plus simple, j&rsquo;ai fait un exemple pour allumer une lampe après la détection d&rsquo;un mouvement entre deux heures, j&rsquo;imagine qu&rsquo;il n&rsquo;y a pas qu&rsquo;une lampe chez toi, le blueprint va te permettre de mettre tes automatisation en place plus rapidement, que ce soit pour des lampes, des capteurs, des interrupteurs &#8230;</p>



<p class="wp-block-paragraph">Pour cet article, je vais reprendre l&rsquo;exemple de l&rsquo;automatisation créée précédemment :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">- id: Light-with-mvt 
  alias: Lumière avec mouvement 
  trigger:
  - platform: state
    entity_id: binary_sensor.lumi_lumi_sensor_motion_81807f04_ias_zone
    from: 'off'
    to: 'on'
  condition:
  - condition: time
    after: "19:00:00"
    before: "07:00:00"
  action:
  - service: light.turn_on
    target:
      entity_id: light.lumi_lumi_light_aqcn02_c4865d04_level_light_color_on_off
    data:
      color_temp: 200
      brightness_pct: 25
  - wait_for_trigger:
      platform: state
      entity_id: binary_sensor.lumi_lumi_sensor_motion_81807f04_ias_zone
      from: "on"
      to: "off"
  - delay:
      seconds: 60
  - service: light.turn_off
    target:
      entity_id: light.lumi_lumi_light_aqcn02_c4865d04_level_light_color_on_off
  mode: restart
  max_exceeded: silent</pre>



<p class="wp-block-paragraph">Je ne vais pas revenir dessus, tu peux retrouver les informations sur <a href="https://programmation.surleweb-france.fr/home-assistant-comprendre-les-automatisations-manuelles/" target="_blank" rel="noreferrer noopener">cette page</a>. D&rsquo;ailleurs, je te conseille d&rsquo;aller jeter un petit coup d&rsquo;oeil, je me concentrerai seulement sur la partie de blueprint.</p>



<h2 class="wp-block-heading">Explication</h2>



<p class="wp-block-paragraph">Je commence par fournir le blueprint, que je viendrai expliquer :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">blueprint:
  name: Lumière activée par le mouvement entre 2 heures
  description: Allume la lumière quand un mouvement est détecté entre deux heures.
  domain: automation
  input:
    motion_entity:
      name: Capteur de mouvement
      selector:
        entity:
          domain: binary_sensor
          device_class: motion
    light_target:
      name: Light
      selector:
        target:
          entity:
            domain: light
    no_motion_wait:
      name: "Temps d'attente"
      description: Temps après le dernier mouvement pour éteindre la lumière.
      default: 120
      selector:
        number:
          min: 0
          max: 3600
          unit_of_measurement: seconds
	time_after:
	  name: "Heure du début"
	  description: "Heure à laquelle commence l'allumage de la lumière"
	  selector:
	    time:
	time_before:
	  name: "Heure de fin"
	  description: "Heure à laquelle se termine le déclenchement l'allumage de la lumière"
	  selector:
	    time:

mode: restart
max_exceeded: silent

trigger:
  platform: state
  entity_id: !input motion_entity
  from: "off"
  to: "on"

condition:
  - condition: time
  after: !input time_after
  before: !input time_before

action:
  - service: light.turn_on
    target: !input light_target
  - wait_for_trigger:
      platform: state
      entity_id: !input motion_entity
      from: "on"
      to: "off"
  - delay: !input no_motion_wait
  - service: light.turn_off
    target: !input light_target
</pre>



<p class="wp-block-paragraph">Le fichier doit commencer par <strong><em>blueprint</em></strong>, afin de clairement faire comprendre à Home Assistant ce qu&rsquo;il est. Ensuite, on lui donne un nom (<strong><em>name</em></strong>), une description (<strong><em>description</em></strong>) et un domaine (<strong><em>domain</em></strong>) :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">blueprint:
  name: Lumière activée par le mouvement entre 2 heures
  description: Allume la lumière quand un mouvement est détecté entre deux heures.
  domain: automation</pre>



<p class="wp-block-paragraph">Dans la seconde partie, tu devras indiquer les entrées. Les entrées sont ce que tu devras saisir pour la mise en place de ton automatisation (capteur, zone, équipement, heure&#8230;). Pour chaque entrée, il faudra lui donner un nom (qui sera utilisé pour récupérer l&rsquo;entrée), un sélecteur (<strong><em>selector</em></strong>) qui permet de définir ce qui sera affiché sur la création de l&rsquo;automatisation pour cette entrée et les options de ce <strong><em>selector</em>. </strong>Dans cette partie, nous ne renseignons pas les entités ou groupes :</p>



<pre class="EnlighterJSRAW" data-enlighter-language="yaml" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="">input:
    motion_entity:
      name: Capteur de mouvement
      selector:
        entity:
          domain: binary_sensor
          device_class: motion
    light_target:
      name: Light
      selector:
        target:
          entity:
            domain: light
    no_motion_wait:
      name: "Temps d'attente"
      description: Temps après le dernier mouvement pour éteindre la lumière.
      default: 120
      selector:
        number:
          min: 0
          max: 3600
          unit_of_measurement: seconds
	time_after:
	  name: "Heure du début"
	  description: "Heure à laquelle commence l'allumage de la lumière"
	  selector:
	    time:</pre>



<p class="wp-block-paragraph">Dans la seconde partie du code, nous retrouvons nos déclencheurs, nos actions et nos conditions, les informations qui sont habituellement saisie sont remplacées par une phrase de ce type : <strong><em>!input no_wait_motion</em></strong>. Cela permet de signifier que cette entité sera l&rsquo;entrée avec se nom (dans notre cas <strong><em>no_wait_motion</em></strong>).</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">La création d&rsquo;un blueprint n&rsquo;est pas plus compliqué que la création d&rsquo;une automatisation, elle est à privilégier surtout si l&rsquo;on sait que plusieurs automatisations y feront référence.</p>
<p>L’article <a href="https://programmation.surleweb-france.fr/home-assistant-creation-dun-blueprint/">Home Assistant, création d&rsquo;un Blueprint</a> est apparu en premier sur <a href="https://programmation.surleweb-france.fr">La programmation sur le web</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://programmation.surleweb-france.fr/home-assistant-creation-dun-blueprint/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">938</post-id>	</item>
	</channel>
</rss>
