Skip to content

NigiNagiNu/ESPHome-Components

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ESPHome Components

This repository contains custom ESPHome components for devices developed by IoTLabs.

socket_transmitter

This component is used to send data to a remote server using a socket connection. It supports both TCP and UDP protocols. Especially is made for sending wM-Bus packets to a remote server for further processing.

Example configuration:

socket_transmitter:
  id: transmitter
  ip_address: <remote_host>
  port: <remote_port>
  protocol: <tcp|udp>

interval:
  - interval: 10s
    then:
      - socket_transmitter.send:
          id: transmitter
          data: "Hello, World!"

wmbus_common

This component is a port of wmbusmeters library to ESPHome. It provides common functionality for working with wM-Bus devices, including parsing and handling wM-Bus packets.

Example configuration:

wmbus_common:
    drivers: all
    # or specify specific drivers
    drivers:
      - apator162
      - amiplus

wmbusmeters is included as a git subtree. To sync version from upstream repository, run:

./scripts/pull_wmbusmeters.py [GIT_REF]

wmbus_meter

This component provides abstraction for Meter object for wM-Bus devices. Attaching instance to the wmbus_radio component allows to receive, decrypt and parse wM-Bus packets from the radio interface.

Example configuration:

wmbus_meter:
  id: my_water_meter
  radio_id: radio_component
  meter_id: 12345678
  type: apator162
  key: "00000000000000000000000000000000"
  mode: T1
  on_telegram:
    - socket_transmitter.send:
        id: transmitter
        data: !lambda return meter.as_json();
    - wmbus_meter.send_telegram_with_mqtt:
        topic: test/topic

mode parameter is optional and allows to filter received packets by mode. It can be set to T1 or C1. If not set, all packets will be processed. key parameter is optional and allows to decrypt packets using AES-128-CBC encryption. It should be provided as hexadecimal or ASCII encoded string. If not set, packets will be processed as unencrypted.

Component provides on_telegram trigger that can be used to send data to a remote server or process it in any other way. It can be used to send data to MQTT broker, HTTP server, or any other service. meter variable is available in the following lambdas. Additionally, wmbus_meter.send_telegram_with_mqtt action can be used to send JSON-encoded meter data to MQTT broker. It requires mqtt component to be configured in ESPHome.

On the wmbus_meter platform, you can use the following sensors to provide data to Home Assistant/MQTT:

  • sensor: as abstraction for numerical values from the meter, such as consumption, volume, etc.

    sensor:
      - platform: wmbus_meter
        id: my_water_meter_consumption
        parent_id: my_water_meter
        name: "Water Meter Total Consumption"
        field: total_m3

    By default, unit of measurement is picked from the field name, but you can override it by specifying unit_of_measurement parameter. Especially, if you want to do this, ESPHome's multiply filter may be useful to change numerical value to the desired unit.

  • text_sensor

    text_sensor:
      - platform: wmbus_meter
        id: some_sensor
        parent_id: my_water_meter
        name: My Water Meter Timestamp
        field: timestamp

For both sensor and text_sensor, all config from generic Sensor and Text Sensor components is available, so you can use filters, icons, etc.

wmbus_radio

This component provides a radio interface LoRa 868MHz transceivers allowing to receive wM-Bus packets. At the moment it support only Semtech SX1276 (RFM95/RFM96). As a dependency, it requires spi component to be configured in ESPHome.

Example configuration:

spi:
  clk_pin: GPIO1
  miso_pin: GPIO2
  mosi_pin: GPIO3
  id: spi_bus

wmbus_radio:
  id: radio_component
  radio_type: SX1276
  reset_pin: GPIO4
  irq_pin: GPIO5
  on_frame:
    - wmbus_radio.send_frame_with_socket:
        id: transmitter
        format: rtlwmbus

For SX1276, reset_pin should be connected to the reset pin and irq_pin should be connected to the DIO1 pin of the radio module.

The on_frame trigger can be used to send received wM-Bus packets to a remote server using socket_transmitter component. It can also be used to process packets in any other way, such as sending them to MQTT broker or HTTP server.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • C++ 89.5%
  • C 9.5%
  • Python 1.0%