# Home Assistant

Le pv routeur étant compatible avec Home Assistant, voici une documentation pour passer le pas et installer une machine Home Assistant

### **Prérequis**

Il est fortement préférable d'avoir un raspberry Pi avec un disque SSD ou une VM équivalente.   
Il existe un OS dédié pour Raspberry ( HAOS ) et c'est le plus simple à installer.

### <span style="font-weight: bold;">Installation home-assistant</span>

L'installation est assez simple et il est possible de s'appuyer sur la doc suivante   
[https://www.home-assistant.io/installation/](https://www.home-assistant.io/installation/)  
[Démonstration](https://demo.home-assistant.io)

### <span style="font-weight: bold;">Installation mqtt</span>

j'ai suivis cette doc [https://devotics.fr/installer-mqtt-sur-home-assistant/](https://devotics.fr/installer-mqtt-sur-home-assistant/)

dans configuration logins:  
\- username: mosquitto  
 password: test-123  
démarrer  
  
Coté Pv routeur, la configuration est simple.   
[http://IP\_PVROUTER/mqtt.html](http://IP_PVROUTER/mqtt.html) &gt; IP\_HA &gt; bouton HA est coché&gt; application des paramètres + [http://IP\_PVROUTER/config.html](http://IP_PVROUTER/config.html) sauvegarder + [http://IP\_PVROUTER/reboot](http://IP_PVROUTER/reboot)  
[![image-1677788017723.png](https://pvrouteur.apper-solaire.org/uploads/images/gallery/2023-03/scaled-1680-/image-1677788017723.png)](https://pvrouteur.apper-solaire.org/uploads/images/gallery/2023-03/image-1677788017723.png)[![image-1665948223836.png](https://pvrouteur.apper-solaire.org/uploads/images/gallery/2022-10/scaled-1680-/image-1665948223836.png)](https://pvrouteur.apper-solaire.org/uploads/images/gallery/2022-10/image-1665948223836.png)

[http://IP\_DIMMER/mqtt.html](http://IP_DIMMER/mqtt.html) &gt; IP\_HA &gt; application des paramètres + [http://IP\_DIMMER/config.html](http://IP_DIMMER/config.html) sauvegarder + [http://IP\_DIMMER/reboot](http://IP_DIMMER/reboot)  
[http://IP\_HA:8123/config/integrations](http://IP_HA:8123/config/integrations) apparait 2 appareils et 22 entités (ils faut entre 2 et 10 minutes)

  
[![pvrouteur-mqtt_ha.png](https://pvrouteur.apper-solaire.org/uploads/images/gallery/2023-03/scaled-1680-/pvrouteur-mqtt-ha.png)](https://pvrouteur.apper-solaire.org/uploads/images/gallery/2023-03/pvrouteur-mqtt-ha.png)

### <span style="font-weight: bold;">Configuration energy</span>

W en WH en s'appuyant sur cette documentation   
[https://www.home-assistant.io/integrations/integration/](https://www.home-assistant.io/integrations/integration/)   
Integration - Riemann sum integral  
[http://IP\_HA:8123/config/helpers](http://IP_HA:8123/config/helpers)  
\+ Créer une entrée

<div class="codebox" id="bkmrk-int%C3%A9grale-de-reimann">`Intégrale de Reimann<br></br>sensor.sensor_grid_ab98_kwh<br></br>sensor.grid_ab98<br></br>`</div>  
idem avec sensor.inject\_ab98  
  
[http://IP\_HA:8123/config/energy](http://IP_HA:8123/config/energy)  
  
Réseau électrique &gt; Consommation du réseau &gt; sensor.grid\_ab98\_Kwh  
Réseau électrique &gt; Retourné au réseau &gt; ensor.inject\_ab98\_Kwh  
Panneaux solaires &gt; Production solaire &gt; Envoy Lifetime Energy Production  
[http://IP\_HA:8123/energy](http://IP_HA:8123/energy)

[![HA-energies.png](https://pvrouteur.apper-solaire.org/uploads/images/gallery/2023-03/scaled-1680-/ha-energies.png)](https://pvrouteur.apper-solaire.org/uploads/images/gallery/2023-03/ha-energies.png)

### **Configuration power-flow-card**  


  
il faut <span style="font-weight: bold;">HACS</span> suivre en ajoutant ce plugin [https://forum.hacf.fr/t/hacs-ajoutez-de ... lisees/359](https://forum.hacf.fr/t/hacs-ajoutez-des-modules-et-des-cartes-personnalisees/359)  
  
[http://IP\_HA:8123/hacs/frontend](http://IP_HA:8123/hacs/frontend) &gt; + explorer &gt; Power Flow Card  
[http://IP\_HA:8123/dashboard-jbb/default\_view](http://IP_HA:8123/dashboard-jbb/default_view) tableau de bord j'ai rajouté une carte power-flow-card  
  
type: custom:power-flow-card  
entities:  
grid: sensor.grid\_ab98  
solar: sensor.envoy\_121516040890\_current\_power\_production

[![HA-energie.png](https://pvrouteur.apper-solaire.org/uploads/images/gallery/2023-03/scaled-1680-/ha-energie.png)](https://pvrouteur.apper-solaire.org/uploads/images/gallery/2023-03/ha-energie.png)

### **Configuration Picture Elements Card plan**

  
  
[http://IP\_HA:8123/dashboard-jbb/default\_view](http://IP_HA:8123/dashboard-jbb/default_view) tableau de bord j'ai rajouté une carte

```YAML
type: picture-elements<br></br>image: local/jbb/plan-32-lafontaine-rdc-1er.png<br></br>elements:<br></br> <br></br>  - type: state-label<br></br>    entity: sensor.dimmer_temperature_2ea1<br></br>    style:<br></br>      top: 65%<br></br>      left: 55%<br></br>      color: '#000'<br></br>      border-radius: 50%<br></br>      text-align: center<br></br>      background-color: rgba(255, 255, 255, 0.3)<br></br>      font-size: 10px<br></br>      font-weight: bold<br></br>  - type: state-label<br></br>    entity: sensor.dallas_ab98<br></br>    style:<br></br>      top: 50%<br></br>      left: 80%<br></br>      color: '#000'<br></br>      border-radius: 50%<br></br>      text-align: center<br></br>      background-color: rgba(255, 255, 255, 0.3)<br></br>      font-size: 10px<br></br>      font-weight: bold<br></br>  - type: state-label<br></br>    entity: sensor.dimmer_ab98<br></br>    style:<br></br>      top: 65%<br></br>      left: 45%<br></br>      color: '#000'<br></br>      border-radius: 50%<br></br>      text-align: center<br></br>      background-color: rgba(255, 255, 255, 0.3)<br></br>      font-size: 10px<br></br>      font-weight: bold<br></br>  - type: icon<br></br>    icon: mdi:transmission-tower<br></br>    entity: sensor.grid_ab98<br></br>    style:<br></br>      top: 50%<br></br>      left: 97%<br></br>      color: blue<br></br>  - type: state-label<br></br>    entity: sensor.grid_ab98<br></br>    style:<br></br>      top: 53%<br></br>      left: 97%<br></br>      color: blue<br></br>      font-size: 8px<br></br>  - type: icon<br></br>    entity: sensor.envoy_current_power_production<br></br>    icon: mdi:solar-power<br></br>    style:<br></br>      top: 58%<br></br>      left: 97%<br></br>      color: yellow<br></br>  - type: state-label<br></br>    entity: sensor.envoy_current_power_production<br></br>    style:<br></br>      top: 61%<br></br>      left: 97%<br></br>      color: yellow<br></br>      font-size: 8px<br></br>  - type: icon<br></br>    entity: sensor.meter-gas<br></br>    icon: mdi:meter-gas<br></br>    style:<br></br>      top: 66%<br></br>      left: 97%<br></br>      color: yellow<br></br>  - type: state-label<br></br>    entity: sensor.meter-gas<br></br>    style:<br></br>      top: 69%<br></br>      left: 97%<br></br>      color: yellow<br></br>      font-size: 8px<br></br>  - type: icon<br></br>    entity: sensor.water<br></br>    icon: mdi:water<br></br>    style:<br></br>      top: 73%<br></br>      left: 97%<br></br>      color: cyan<br></br>  - type: state-label<br></br>    entity: sensor.water<br></br>    style:<br></br>      top: 76%<br></br>      left: 97%<br></br>      color: cyan<br></br>      font-size: 8px
```

[![HA-plan.png](https://pvrouteur.apper-solaire.org/uploads/images/gallery/2023-03/scaled-1680-/ha-plan.png)](https://pvrouteur.apper-solaire.org/uploads/images/gallery/2023-03/ha-plan.png)