Code Monkey home page Code Monkey logo

Comments (9)

kellerza avatar kellerza commented on July 27, 2024

Hi @northalpha this might be more related to #5 - can you try the legacy addon?

It uses SMA-EM directly for a connection

from hassio-sma-em.

northalpha avatar northalpha commented on July 27, 2024

Nice, we are one step further to getting this working. Using the legacy 0.5.5 i get:

[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] done.
[services.d] starting services
[services.d] done.
ic| topic: 'homeassistant/sensor/300xxxxxxxxx/pconsume/config'
    payload: ('{"name": "pconsume", "dev_cla": "power", "stat_t": '
              '"SMA-EM/status/300xxxxxxxxx/pconsume", "unit_of_meas": "W", "uniq_id": '
              '"300xxxxxxxxx_pconsume", "dev": {"ids": ["sma_em_300xxxxxxxxx"], "name": "SMA '
              'Energy Meter", "mdl": "Energy Meter", "mf": "SMA"}}')
ic| topic: 'homeassistant/sensor/300xxxxxxxxx/pconsumecounter/config'
    payload: ('{"name": "pconsumecounter", "dev_cla": "energy", "stat_t": '
              '"SMA-EM/status/300xxxxxxxxx/pconsumecounter", "unit_of_meas": "kWh", '
              '"uniq_id": "300xxxxxxxxx_pconsumecounter", "dev": {"ids": '
              '["sma_em_300xxxxxxxxx"], "name": "SMA Energy Meter", "mdl": "Energy Meter", '
              '"mf": "SMA"}}')
ic| topic: 'homeassistant/sensor/300xxxxxxxxx/u1/config'
    payload: ('{"name": "u1", "dev_cla": "voltage", "stat_t": '
              '"SMA-EM/status/300xxxxxxxxx/u1", "unit_of_meas": "V", "uniq_id": '
              '"300xxxxxxxxx_u1", "dev": {"ids": ["sma_em_300xxxxxxxxx"], "name": "SMA Energy '
              'Meter", "mdl": "Energy Meter", "mf": "SMA"}}')
ic| topic: 'homeassistant/sensor/300xxxxxxxxx/psupply/config'
    payload: ('{"name": "psupply", "dev_cla": "power", "stat_t": '
              '"SMA-EM/status/300xxxxxxxxx/psupply", "unit_of_meas": "W", "uniq_id": '
              '"300xxxxxxxxx_psupply", "dev": {"ids": ["sma_em_300xxxxxxxxx"], "name": "SMA '
              'Energy Meter", "mdl": "Energy Meter", "mf": "SMA"}}')
ic| topic: 'homeassistant/sensor/300xxxxxxxxx/sconsume/config'
    payload: ('{"name": "sconsume", "dev_cla": "energy", "stat_t": '
              '"SMA-EM/status/300xxxxxxxxx/sconsume", "unit_of_meas": "", "uniq_id": '
              '"300xxxxxxxxx_sconsume", "dev": {"ids": ["sma_em_300xxxxxxxxx"], "name": "SMA '
              'Energy Meter", "mdl": "Energy Meter", "mf": "SMA"}}')
ic| topic: 'homeassistant/sensor/300xxxxxxxxx/ssupply/config'
    payload: ('{"name": "ssupply", "dev_cla": "energy", "stat_t": '
              '"SMA-EM/status/300xxxxxxxxx/ssupply", "unit_of_meas": "", "uniq_id": '
              '"300xxxxxxxxx_ssupply", "dev": {"ids": ["sma_em_300xxxxxxxxx"], "name": "SMA '
              'Energy Meter", "mdl": "Energy Meter", "mf": "SMA"}}')
ic| topic: 'homeassistant/sensor/300xxxxxxxxx/cosphi/config'
    payload: ('{"name": "cosphi", "dev_cla": "energy", "stat_t": '
              '"SMA-EM/status/300xxxxxxxxx/cosphi", "unit_of_meas": "", "uniq_id": '
              '"300xxxxxxxxx_cosphi", "dev": {"ids": ["sma_em_300xxxxxxxxx"], "name": "SMA '
              'Energy Meter", "mdl": "Energy Meter", "mf": "SMA"}}')
ic| topic: 'homeassistant/sensor/300xxxxxxxxx/frequency/config'
    payload: ('{"name": "frequency", "dev_cla": null, "stat_t": '
              '"SMA-EM/status/300xxxxxxxxx/frequency", "unit_of_meas": "Hz", "uniq_id": '
              '"300xxxxxxxxx_frequency", "dev": {"ids": ["sma_em_300xxxxxxxxx"], "name": "SMA '
              'Energy Meter", "mdl": "Energy Meter", "mf": "SMA"}}')
ic| topic: 'homeassistant/sensor/300xxxxxxxxx/psupplycounter/config'
    payload: ('{"name": "psupplycounter", "dev_cla": "energy", "stat_t": '
              '"SMA-EM/status/300xxxxxxxxx/psupplycounter", "unit_of_meas": "kWh", "uniq_id": '
              '"300xxxxxxxxx_psupplycounter", "dev": {"ids": ["sma_em_300xxxxxxxxx"], "name": '
              '"SMA Energy Meter", "mdl": "Energy Meter", "mf": "SMA"}}')

So far, nice! But these Sensors are in "unknown" state, but i have found this in HA logs:

Logger: homeassistant.util.logging
Source: util/logging.py:105
First occurred: 9:41:04 (3 occurrences)
Last logged: 9:44:02

Exception in async_discover when dispatching 'mqtt_discovery_new_sensor_mqtt': ({'name': 'frequency', 'device_class': None, 'state_topic': 'SMA-EM/status/300xxxxxxxxx/frequency', 'unit_of_measurement': 'Hz', 'unique_id': '300xxxxxxxxx_frequency', 'device': {'identifiers': ['sma_em_300xxxxxxxxx'], 'name': 'SMA Energy Meter', 'model': 'Energy Meter', 'manufacturer': 'SMA'}, 'platform': 'mqtt'},) Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/mqtt/mixins.py", line 180, in async_discover config = schema(discovery_payload) File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 272, in __call__ return self._compiled([], data) File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 594, in validate_dict return base_validate(path, iteritems(data), out) File "/usr/local/lib/python3.9/site-packages/voluptuous/schema_builder.py", line 432, in validate_mapping raise er.MultipleInvalid(errors) voluptuous.error.MultipleInvalid: value must be one of ['battery', 'carbon_dioxide', 'carbon_monoxide', 'current', 'energy', 'humidity', 'illuminance', 'monetary', 'power', 'power_factor', 'pressure', 'signal_strength', 'temperature', 'timestamp', 'voltage'] for dictionary value @ data['device_class']

Removing u1 and frequency from measurements list in addon config is not able to get values for the messurement either.

from hassio-sma-em.

kellerza avatar kellerza commented on July 27, 2024

device_class was never implemented for frequency it seems, from your log:

"dev_cla": null

from hassio-sma-em.

kellerza avatar kellerza commented on July 27, 2024

Try removing frequency for now

from hassio-sma-em.

northalpha avatar northalpha commented on July 27, 2024

Unfortunately same "error" (no values seems to be read or feed into mqtt. I am only using pconsume in config at this point, I can see that the topic is being created in mosquitto, but no joy until now :(

Addon Log

ic| topic: 'homeassistant/sensor/300xxxxx/pconsume/config'
    payload: ('{"name": "pconsume", "dev_cla": "power", "stat_t": '
              '"SMA-EM/status/300xxxxx/pconsume", "unit_of_meas": "W", "uniq_id": '
              '"300xxxxx_pconsume", "dev": {"ids": ["sma_em_300xxxxx"], "name": "SMA '
              'Energy Meter", "mdl": "Energy Meter", "mf": "SMA"}}')

Inside Mosquitto:

{"name": "pconsume", "dev_cla": "power", "stat_t": "SMA-EM/status/300xxxxx/pconsume", "unit_of_meas": "W", "uniq_id": "300xxxxx/_pconsume", "dev": {"ids": ["sma_em_300xxxxx/"], "name": "SMA Energy Meter", "mdl": "Energy Meter", "mf": "SMA"}}

from hassio-sma-em.

kellerza avatar kellerza commented on July 27, 2024

It works ok for me

Do you see any new errors in HomeAssistant? (You might have to restart HASS/delete the persistent entry in MQTT and restart the addon)

If you use MQTTexplorer/something similar do you see anything posted for the value? SMA-EM/status/300xxxxx/pconsume?

from hassio-sma-em.

kellerza avatar kellerza commented on July 27, 2024

I tried to copy all the connection settings from the ‘legacy’ to the current version

if you still not see values I’ll post some instructions to help debug this

from hassio-sma-em.

kellerza avatar kellerza commented on July 27, 2024

@northalpha have you tried the normal version recently?

from hassio-sma-em.

kellerza avatar kellerza commented on July 27, 2024

Let me know if you still have an issue

from hassio-sma-em.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.