Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A simpler option without any extension #4

Open
fulup-bzh opened this issue Oct 21, 2022 · 0 comments
Open

A simpler option without any extension #4

fulup-bzh opened this issue Oct 21, 2022 · 0 comments

Comments

@fulup-bzh
Copy link

It is in fact possible to get Linky information without using any extension by simply using HA templating.

# add following line within your configuration.yaml
# reference: https://www.enedis.fr/media/2035/download

sensor:
  - platform: serial
    name: Enedis
    serial_port: /dev/ttyAMA0
    baudrate: 9600
    parity: E
    bytesize: 7
    value_template: >-
      {% set slots = value.split('\t') %}
      {{ slots[0] }},{{ slots[1] }}

  - platform: template
    sensors:

      #debug_enedis:
      #   unique_id: enedis:teleinfo:debug
      #   friendly_name: "Debug Input"
      #   icon_template: mdi:current-ac
      #   device_class: current  
      #   value_template: "{{ states('sensor.enedis') }}"

      enedis_watt:
        unique_id: enedis:teleinfo:watt
        friendly_name: "Conso-VA"
        unit_of_measurement: "VA"
        icon_template: mdi:current-ac
        device_class: current
        value_template: >-
          {% if states('sensor.enedis').startswith('SINSTS') %}
            {{ states('sensor.enedis').split(',')[1] }}
          {% else %}
            {{ states('sensor.enedis_watt') }}
          {% endif %}

      enedis_amp:
        unique_id: enedis:teleinfo:amp
        friendly_name: "Conso-Amp"
        unit_of_measurement: "A"
        icon_template: mdi:current-ac
        device_class: current
        value_template: >-
          {% if states('sensor.enedis').startswith('IRMS1') %}
            {{ states('sensor.enedis').split(',')[1] }}
          {% else %}
            {{ states('sensor.enedis_amp') }}
          {% endif %}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant