Neoom Beeam Rest API

Hi HA community,

I am very new to the topic and I am struggling a bit with creating sensors via
configuration.yaml

I just tried to get information from a local device called “Neoom Beeam” wich is a local device for accessing real time data of my PV system via the REST api.

According to the API Documentation “/api/v1/site/state

I am trying to get all the basic information from the site/state.
Therefore I tried the curl command

curl -k \
-H "Authorization: Bearer skxxxx" \
-H "Content-Type: application/json" \
http://192.168.0.x/api/v1/site/state

this is the result

{"energyFlow":{"states":[
{"dataPointId":"befa18bd-7c07-5871-90a2-29f1c51fa368","key":"SELF_SUFFICIENCY","value":100,"ts":1718621135003},
{"dataPointId":"2339a8b3-db1e-5b63-9a6f-a11787c8f905","key":"POWER_PRODUCTION","value":7206,"ts":1718633200003},
{"dataPointId":"24a8122b-d2cc-5374-b5b4-bf22f51dd511","key":"POWER_CONSUMPTION","value":null,"ts":1718621100003},
{"dataPointId":"371d81cc-a0b6-510f-b02d-819adbed7011","key":"POWER_GRID","value":-5973,"ts":1718633200003},
{"dataPointId":"6e5e9fcc-f81b-59b7-8a40-93916ed199a0","key":"POWER_STORAGE","value":37,"ts":1718633180002},
{"dataPointId":"ad7c9711-e91c-5a56-85b2-7de4c6a7ad10","key":"ENERGY_PRODUCED","value":18006700,"ts":1718633200003},
{"dataPointId":"db4e07e8-657c-51b5-9f45-ea48c5dd0a9e","key":"ENERGY_CONSUMED","value":null,"ts":1718621100003},
{"dataPointId":"3b327d89-825a-59f7-b956-4ccdd89f125a","key":"ENERGY_IMPORTED","value":4932816.486869225,"ts":1718621100003},
{"dataPointId":"bee32e2c-f01a-5cff-8252-d2f09e06c9dc","key":"ENERGY_EXPORTED","value":7452677.600188415,"ts":1718633200003},
{"dataPointId":"d46d9e71-d227-5295-8ca5-6957472fa111","key":"ENERGY_CHARGED","value":4558500,"ts":1718631955003},
{"dataPointId":"e25f2c9a-25e7-528e-bab2-9f85f51ec440","key":"ENERGY_DISCHARGED","value":3385000,"ts":1718632635004},
{"dataPointId":"6b73c34d-f868-5792-b9d5-ef92348d202f","key":"STATE_OF_CHARGE","value":100,"ts":1718632000002},
{"dataPointId":"d5461d1f-1b80-5aac-9e15-e020a26aebf3","key":"POWER_CONSUMPTION_CALC","value":1270,"ts":1718633200003},
{"dataPointId":"60341e65-6c4b-5424-b091-f4286512cb94","key":"POWER_GRID_REMAINING","value":null,"ts":1718621100003},
{"dataPointId":"2869f5fc-7737-57d3-a64e-c15c7e084c97","key":"ENERGY_CONSUMED_CALC","value":14313338.886680812,"ts":1718633200003}]}
}

Next step → just putting some code in the configuration.yaml

sensor:
  - platform: rest
    name: Neoom Beeam Energy State
    resource: http://192.168.0.x/api/v1/site/state
    method: GET
    verify_ssl: false
    headers:
      Authorization: !secret beeam_bearer_token
      Content-Type: application/json
    value_template: >
          {% set state = value_json.energyFlow.states[0] %}
            Key: {{ state.key }}, Value: {{ state.value }}, DataPointId: {{ state.dataPointId }}, Timestamp: {{ state.ts }}
    json_attributes_path: "$.energyFlow.states"
    json_attributes:
      - states
    scan_interval: 10

template:
  - sensor:
      - name: "Neoom Autarkie"
        unit_of_measurement: "%"
        device_class: "power"
        state_class: "measurement"
        state: >
          {% set state_data = state_attr('sensor.neoom_beeam_energy_state', 'states') %}
          {% if state_data %}
            {{ state_data | selectattr('key', 'eq', 'SELF_SUFFICIENCY') | map(attribute='value') | first | default('unavailable') }}
          {% else %}
            unavailable
          {% endif %}

      - name: "Neoom Strom Netz"
        unit_of_measurement: "W"
        device_class: "energy"
        state_class: "measurement"
        state: >
          {% set state_data = state_attr('sensor.neoom_beeam_energy_state', 'states') %}
          {% if state_data %}
            {{ state_data | selectattr('key', 'eq', 'POWER_GRID') | map(attribute='value') | first | default('unavailable') }}
          {% else %}
            unavailable
          {% endif %}

But when I look now in the entity state it shows me “unknown”.

Please can you help me.

Thank you very much

Hi community,

just got it working.

Please give me feedback if it is working for you too?



# Loads default set of integrations. Do not remove.
default_config:

# Load frontend themes from the themes folder
frontend:
  themes: !include_dir_merge_named themes

automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
knx: !include knx.yaml



rest:
  - resource: http://IP-Adress/api/v1/site/state  # BEAAM API URL
    headers:
      Authorization: "Bearer hereyourtoken" #do not delete Bearer at the start
      Content-Type: "application/json"
    method: GET
    scan_interval: 10  # Intervall für API-Aufrufe in Sekunden
    sensor:
      - name: "neoom_self_sufficiency"
        value_template: "{{ value_json['energyFlow']['states'] | selectattr('key', 'eq', 'SELF_SUFFICIENCY') | map(attribute='value') | first }}"
        unit_of_measurement: "%"
        device_class: power
        state_class: measurement

      - name: "neoom_power_production"
        value_template: "{{ value_json['energyFlow']['states'] | selectattr('key', 'eq', 'POWER_PRODUCTION') | map(attribute='value') | first }}"
        unit_of_measurement: "W"
        device_class: power
        state_class: measurement

      - name: "neoom_power_consumption"
        value_template: "{{ value_json['energyFlow']['states'] | selectattr('key', 'eq', 'POWER_CONSUMPTION') | map(attribute='value') | first }}"
        unit_of_measurement: "W"
        device_class: power
        state_class: measurement

      - name: "neoom_power_grid"
        value_template: "{{ value_json['energyFlow']['states'] | selectattr('key', 'eq', 'POWER_GRID') | map(attribute='value') | first }}"
        unit_of_measurement: "W"
        device_class: power
        state_class: measurement

      - name: "neoom_power_storage"
        value_template: "{{ value_json['energyFlow']['states'] | selectattr('key', 'eq', 'POWER_STORAGE') | map(attribute='value') | first }}"
        unit_of_measurement: "W"
        device_class: power
        state_class: measurement

      - name: "neoom_energy_produced"
        value_template: "{{ value_json['energyFlow']['states'] | selectattr('key', 'eq', 'ENERGY_PRODUCED') | map(attribute='value') | first }}"
        unit_of_measurement: "Wh"
        device_class: energy
        state_class: total_increasing

      - name: "neoom_energy_consumed"
        value_template: "{{ value_json['energyFlow']['states'] | selectattr('key', 'eq', 'ENERGY_CONSUMED') | map(attribute='value') | first }}"
        unit_of_measurement: "Wh"
        device_class: energy
        state_class: total_increasing

      - name: "neoom_energy_imported"
        value_template: "{{ value_json['energyFlow']['states'] | selectattr('key', 'eq', 'ENERGY_IMPORTED') | map(attribute='value') | first }}"
        unit_of_measurement: "Wh"
        device_class: energy
        state_class: total_increasing

      - name: "neoom_energy_exported"
        value_template: "{{ value_json['energyFlow']['states'] | selectattr('key', 'eq', 'ENERGY_EXPORTED') | map(attribute='value') | first }}"
        unit_of_measurement: "Wh"
        device_class: energy
        state_class: total_increasing

      - name: "neoom_energy_charged"
        value_template: "{{ value_json['energyFlow']['states'] | selectattr('key', 'eq', 'ENERGY_CHARGED') | map(attribute='value') | first }}"
        unit_of_measurement: "Wh"
        device_class: energy
        state_class: total_increasing

      - name: "neoom_energy_discharged"
        value_template: "{{ value_json['energyFlow']['states'] | selectattr('key', 'eq', 'ENERGY_DISCHARGED') | map(attribute='value') | first }}"
        unit_of_measurement: "Wh"
        device_class: energy
        state_class: total_increasing

      - name: "neoom_state_of_charge"
        value_template: "{{ value_json['energyFlow']['states'] | selectattr('key', 'eq', 'STATE_OF_CHARGE') | map(attribute='value') | first }}"
        unit_of_measurement: "%"
        device_class: battery
        state_class: measurement

      - name: "neoom_power_consumption_calc"
        value_template: "{{ value_json['energyFlow']['states'] | selectattr('key', 'eq', 'POWER_CONSUMPTION_CALC') | map(attribute='value') | first }}"
        unit_of_measurement: "W"
        device_class: power
        state_class: measurement

      - name: "neoom_energy_consumed_calc"
        value_template: "{{ value_json['energyFlow']['states'] | selectattr('key', 'eq', 'ENERGY_CONSUMED_CALC') | map(attribute='value') | first }}"
        unit_of_measurement: "Wh"
        device_class: energy
        state_class: total_increasing

Hi Dominik,

Thank you very much for posting your Solution! I’m new at Home Assistant and have no idea of programming and i looking for this “integration” since i’ve got my PV. Last Week I found a working Solution with the Neoom Connect Cloud, but i prefer the direct Way. I’ve just testing five sensors and four of them working fine, only “neoom_power_consumption” doesn’t produces me an Entity, but it doesnt matter.