Wiki Pv routeur
Hors sujet
Ici est regroupé ce qui tourne autour de l’environnement, mais pas classable :
Afficheur Wemos
un wemos et un afficheur Oled, et le tout tourne sous ESPHOME
connectique en GPIO 4 et 5 + GND et VCC ( mais 3.3V semble mieux )
et le STL : https://www.thingiverse.com/thing:2884823
esphome:
  name: esphome-web-b9f898
  friendly_name: ESPHome retour Oled 2
esp8266:
  board: esp01_1m
# Enable logging
logger:
# Enable Home Assistant API
api:
  encryption:
    key: "xxxxx"
ota:
wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Esphome-Web-"
    password: "xxxx"
###rajouté une font dans le répertoire de home assistant
font:
  - file: "fonts/ArialCE.ttf"
    id: my_font
    size: 14
mqtt:
  topic_prefix: esphome/e5406
  id: mqtt_client
  broker: !secret mqtt_broker
  username: !secret mqtt_username
  password: !secret mqtt_password
text_sensor:
  - platform: mqtt_subscribe
    name: "Prod"
    id: Prod_sign_text
    topic: domoticz/in/29
    #Pzem/29
    #radiateur/temp
    on_value:
      then:
        lambda: |
          id(Prod_text).publish_state(x);
  - platform: mqtt_subscribe
    name: "Conso"
    id: Conso_sign_text
    topic: domoticz/in/100
    #Pzem/29
    #radiateur/temp
    on_value:
      then:
        lambda: id(Conso_text).publish_state(x); 
  - platform: mqtt_subscribe
    name: "Ballon Temp"
    id: Lixee_sign_text
    topic: domoticz/in/200
    #Pzem/29
    #radiateur/temp
    on_value:
      then:
        lambda: id(Lixee_text).publish_state(x); 
  - platform: mqtt_subscribe
    name: "Dimmer Power"
    id: dimmer_sign_text
    topic: domoticz/in/110
    on_value:
      then:
        lambda: id(dimmer_text).publish_state(x); 
  - platform: template
    id: Prod_text
    internal: true   
  - platform: template
    id: Conso_text
    internal: true
  - platform: template
    id: Lixee_text
    internal: true
  - platform: template
    id: dimmer_text
    internal: true
i2c:
  sda: GPIO5
  scl: GPIO4
  scan: false
  id: bus_a
display:
  - platform: ssd1306_i2c
    model: "SSD1306 128x64"
    address: 0x3C
    id: mydisplay
    update_interval: 15s
    lambda: |-
      const char * text = id(Conso_text).state.c_str();
      const char * textprod = id(Prod_text).state.c_str();
      const char * textlixee = id(Lixee_text).state.c_str();     
      const char * textdimmer = id(dimmer_text).state.c_str();
      it.printf(0, 0, id(my_font), "Conso: %s", text);
      it.printf(0, 16, id(my_font), "Prod: %s", textprod);
      it.printf(0, 32, id(my_font), "ECS: %s", textlixee);
      it.printf(0, 48, id(my_font), "Dim: %s", textdimmer);
Installation sous HAOS
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.
Installation home-assistant
L’installation est assez simple et il est possible de s’appuyer sur
la doc suivante
https://www.home-assistant.io/installation/
Démonstration
Installation mqtt
j’ai suivis cette doc 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
> IP_HA > bouton HA est coché> application des paramètres + http://IP_PVROUTER/config.html
sauvegarder + http://IP_PVROUTER/reboot


http://IP_DIMMER/mqtt.html
> IP_HA > application des paramètres + http://IP_DIMMER/config.html
sauvegarder + http://IP_DIMMER/reboot
http://IP_HA:8123/config/integrations
apparait 2 appareils et 22 entités (ils faut entre 2 et 10 minutes)
Configuration energy
W en WH en s’appuyant sur cette documentation
https://www.home-assistant.io/integrations/integration/
Integration - Riemann sum integral
http://IP_HA:8123/config/helpers
+ Créer une entrée
Intégrale de Reimann<br></br>sensor.sensor_grid_ab98_kwh<br></br>sensor.grid_ab98<br></br>
idem avec sensor.inject_ab98
http://IP_HA:8123/config/energy
Réseau électrique > Consommation du réseau >
sensor.grid_ab98_Kwh
Réseau électrique > Retourné au réseau >
ensor.inject_ab98_Kwh
Panneaux solaires > Production solaire > Envoy Lifetime Energy
Production
http://IP_HA:8123/energy
Configuration power-flow-card
il faut HACS suivre en ajoutant ce plugin https://forum.hacf.fr/t/hacs-ajoutez-de … lisees/359
http://IP_HA:8123/hacs/frontend
> + explorer > Power Flow Card
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
Configuration Picture Elements Card plan
http://IP_HA:8123/dashboard-jbb/default_view tableau de bord j’ai rajouté une carte
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



