hansij66 / dsmr2mqtt Goto Github PK
View Code? Open in Web Editor NEWDSMR to MQTT; Smartmeter to MQTT; Slimme meter naar MQTT
License: GNU General Public License v3.0
DSMR to MQTT; Smartmeter to MQTT; Slimme meter naar MQTT
License: GNU General Public License v3.0
Hi !
I seem to not get messages with meter readings to my mqtt broker, only the status messages are transmitted.
Here is the log using just the provided test data:
pi@strompi:~/services/dsmr/test/dsmr2mqtt $ python3 dsmr-mqtt.py
dsmr-mqtt INFO: FUNCTION:<module> LINE:82: Starting dsmr-mqtt.py; version = 2.0.0
dsmr-mqtt.mqtt.mqtt INFO: FUNCTION:__init__ LINE:103: >> paho-mqtt version = 1.6.1
dsmr-mqtt.mqtt.mqtt INFO: FUNCTION:__init__ LINE:117: MQTT Client ID = mqtt-dsmr
dsmr-mqtt.P1_serial DEBUG: FUNCTION:__init__ LINE:51: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__init__ LINE:50: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__init__ LINE:66: NROF = 1
dsmr-mqtt.hadiscovery DEBUG: FUNCTION:__init__ LINE:49: >>
dsmr-mqtt DEBUG: FUNCTION:<module> LINE:186: __main__: >>
dsmr-mqtt DEBUG: FUNCTION:main LINE:150: >>
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:will_set LINE:425: >>
dsmr-mqtt.mqtt.mqtt INFO: FUNCTION:run LINE:517: Broker = 192.168.1.5>>
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__internet_on LINE:222: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:run LINE:215: >>
dsmr-mqtt.hadiscovery DEBUG: FUNCTION:run LINE:128: >>
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__internet_on LINE:229: Internet connectivity to MQTT broker 192.168.1.5 at port 1883 available
dsmr-mqtt.mqtt.mqtt INFO: FUNCTION:run LINE:575: Start mqtt loop...
dsmr-mqtt.P1_serial DEBUG: FUNCTION:run LINE:198: >>
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:set_status LINE:408: >>
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__set_status LINE:391: >>
dsmr-mqtt.P1_serial DEBUG: FUNCTION:__read_serial LINE:152: >>
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=test_dsmr/status; MESSAGE=online
dsmr-mqtt.mqtt.mqtt WARNING: FUNCTION:do_publish LINE:451: MQTT publish was not successfull, rc = 4: The client is not currently connected.
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/test_dsmr/dsmr-device/config; MESSAGE={"name":"dsmr reader","unique_id":"dsmr-device","state_topic":"test_dsmr/status","icon":"mdi:home-automation","device":{"name":"dsmr reader","sw_version":"2.0.0","model":"P1 USB/dsmr-mqtt","manufacturer":"hansij66 @github.com","identifiers":["dsmr"]}}
dsmr-mqtt.mqtt.mqtt WARNING: FUNCTION:do_publish LINE:451: MQTT publish was not successfull, rc = 4: The client is not currently connected.
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:run LINE:587: Disconnect TIMER = 0
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=test_dsmr/sw-version; MESSAGE=main=2.0.0; mqtt=2.0.0
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/test_dsmr/p_consumed/config; MESSAGE={"unique_id":"p_consumed","state_topic":"test_dsmr/el","name":"Total power usage [W]","unit_of_measurement":"W","value_template":"{{value_json.p_consumed}}","device_class":"power","icon":"mdi:gauge","device":{"identifiers":["dsmr"]}}
dsmr-mqtt.mqtt.mqtt WARNING: FUNCTION:do_publish LINE:451: MQTT publish was not successfull, rc = 4: The client is not currently connected.
dsmr-mqtt.mqtt.mqtt WARNING: FUNCTION:do_publish LINE:451: MQTT publish was not successfull, rc = 4: The client is not currently connected.
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/test_dsmr/p_generated/config; MESSAGE={"unique_id":"p_generated","state_topic":"test_dsmr/el","name":"Total power generation [W]","unit_of_measurement":"W","value_template":"{{value_json.p_generated}}","device_class":"power","icon":"mdi:gauge","device":{"identifiers":["dsmr"]}}
dsmr-mqtt.mqtt.mqtt WARNING: FUNCTION:do_publish LINE:451: MQTT publish was not successfull, rc = 4: The client is not currently connected.
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:run LINE:587: Disconnect TIMER = 0
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/test_dsmr/gas_consumed/config; MESSAGE={"unique_id":"gas_consumed","state_topic":"test_dsmr/gas","name":"gas consumption [m\u00b3]","unit_of_measurement":"m\u00b3","value_template":"{{value_json.gas_consumed|float/1000|round(0)}}","device_class":"gas","state_class":"total","icon":"mdi:counter","device":{"identifiers":["dsmr"]}}
dsmr-mqtt.mqtt.mqtt WARNING: FUNCTION:do_publish LINE:451: MQTT publish was not successfull, rc = 4: The client is not currently connected.
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__on_connect LINE:262: >>
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__on_connect LINE:264: Connected: userdata=None; flags={'session present': 0}; rc=Success: Connection Accepted.
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/test_dsmr/el_consumed/config; MESSAGE={"unique_id":"el_consumed","state_topic":"test_dsmr/el","name":"EL consumed [Wh]","unit_of_measurement":"Wh","value_template":"{{value_json.el_consumed}}","device_class":"energy","state_class":"total","icon":"mdi:counter","device":{"identifiers":["dsmr"]}}
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__set_connected_flag LINE:237: >> flag=True; current __connected_flag=False
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__set_status LINE:391: >>
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/test_dsmr/el_returned/config; MESSAGE={"unique_id":"el_returned","state_topic":"test_dsmr/el","name":"EL returned [Wh]","unit_of_measurement":"Wh","value_template":"{{value_json.el_returned}}","device_class":"energy","state_class":"total","icon":"mdi:counter","device":{"identifiers":["dsmr"]}}
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=test_dsmr/status; MESSAGE=online
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/test_dsmr/V1/config; MESSAGE={"unique_id":"V1","state_topic":"test_dsmr/el","name":"Voltage L1 [V]","unit_of_measurement":"V","value_template":"{{value_json.V1}}","device_class":"voltage","icon":"mdi:gauge","device":{"identifiers":["dsmr"]}}
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/test_dsmr/V2/config; MESSAGE={"unique_id":"V2","state_topic":"test_dsmr/el","name":"Voltage L2 [V]","unit_of_measurement":"V","value_template":"{{value_json.V2}}","device_class":"voltage","icon":"mdi:gauge","device":{"identifiers":["dsmr"]}}
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/test_dsmr/V3/config; MESSAGE={"unique_id":"V3","state_topic":"test_dsmr/el","name":"Voltage L3 [V]","unit_of_measurement":"V","value_template":"{{value_json.V3}}","device_class":"voltage","icon":"mdi:gauge","device":{"identifiers":["dsmr"]}}
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_serial DEBUG: FUNCTION:__read_serial LINE:180: EOF Detected in test/dsmr.raw
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__decode_telegrams LINE:188: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:run LINE:232: <<
dsmr-mqtt.P1_serial DEBUG: FUNCTION:__read_serial LINE:194: <<
dsmr-mqtt.P1_serial DEBUG: FUNCTION:run LINE:211: <<
dsmr-mqtt DEBUG: FUNCTION:main LINE:167: t_serial.join exited; set stopper for other threats
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:set_status LINE:408: >>
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__set_status LINE:391: >>
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=test_dsmr/status; MESSAGE=offline
dsmr-mqtt DEBUG: FUNCTION:main LINE:178: <<
dsmr-mqtt DEBUG: FUNCTION:<module> LINE:193: __main__: <<
dsmr-mqtt INFO: FUNCTION:close LINE:96: Exitcode = 1 >>
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:run LINE:600: Close down MQTT client & connection to broker
dsmr-mqtt.mqtt.mqtt INFO: FUNCTION:__on_disconnect LINE:294: Expected disconnect, userdata = None; rc = 0: No error.
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__set_connected_flag LINE:237: >> flag=False; current __connected_flag=True
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__set_connected_flag LINE:242: Disconnect TIMER started
dsmr-mqtt.mqtt.mqtt INFO: FUNCTION:run LINE:606: Shutting down MQTT Client... 13 MQTT messages have been published
dsmr-mqtt.mqtt.mqtt INFO: FUNCTION:run LINE:608: <<
dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__del__ LINE:211: >>
dsmr-mqtt.mqtt.mqtt INFO: FUNCTION:__del__ LINE:212: Shutting down MQTT Client... 13 MQTT messages have been published
dsmr-mqtt.P1_serial DEBUG: FUNCTION:__del__ LINE:84: >>
dsmr-mqtt.P1_parser DEBUG: FUNCTION:__del__ LINE:69: >>
dsmr-mqtt.hadiscovery DEBUG: FUNCTION:__del__ LINE:59: >>
pi@strompi:~/services/dsmr/test/dsmr2mqtt $
Any idea what i am doing wrong ?
Description:
Home Assistant's auto-discovery feature does not accept 'device_class': 'V' for voltage sensors. The correct device class for voltage should be 'voltage' as per the Home Assistant documentation. This discrepancy prevents voltage sensors from being automatically discovered.
Steps to Reproduce:
{
"unique_id": "V1",
"state_topic": "dsmr/el",
"unit_of_measurement": "V",
"value_template": "{{ value_json.V1 }}",
"device_class": "V",
"icon": "mdi:gauge",
"device": {
"identifiers": ["dsmr"]
},
"name": "Voltage L1",
"platform": "mqtt"
}
Expected Behavior:
The voltage sensor should be automatically discovered and added to Home Assistant without any errors.
Actual Behavior:
An error is logged, and the voltage sensor is not discovered.
Error Log:
Error 'expected SensorDeviceClass or one of 'date', 'enum', 'timestamp', 'apparent_power', 'aqi', 'atmospheric_pressure', 'battery', 'carbon_monoxide', 'carbon_dioxide', 'conductivity', 'current', 'data_rate', 'data_size', 'distance', 'duration', 'energy', 'energy_storage', 'frequency', 'gas', 'humidity', 'illuminance', 'irradiance', 'moisture', 'monetary', 'nitrogen_dioxide', 'nitrogen_monoxide', 'nitrous_oxide', 'ozone', 'ph', 'pm1', 'pm10', 'pm25', 'power_factor', 'power', 'precipitation', 'precipitation_intensity', 'pressure', 'reactive_power', 'signal_strength', 'sound_pressure', 'speed', 'sulphur_dioxide', 'temperature', 'volatile_organic_compounds', 'volatile_organic_compounds_parts', 'voltage', 'volume', 'volume_storage', 'volume_flow_rate', 'water', 'weight', 'wind_speed' for dictionary value @ data['device_class']' when processing MQTT discovery message topic: 'homeassistant/sensor/dsmr/V1/config', message: '{'unique_id': 'V1', 'state_topic': 'dsmr/el', 'unit_of_measurement': 'V', 'value_template': '{{ value_json.V1 }}', 'device_class': 'V', 'icon': 'mdi:gauge', 'device': {'identifiers': ['dsmr']}, 'name': 'Voltage L1', 'platform': 'mqtt'}'
Hi all,
I am trying to increase the frequency of the MQTT messages in oder to try to get 1 meter reading per second to HA. When I change the default value of 7 in dsmr50.py to another value, doesn't matter which value, the meter readings are not updated anymore. Only when I re-enter the value of 7, I will get a reading once every minute. What do I do wrong?
Thanks for your help!
Best,
Thomas
Got error:
AttributeError: module 'serial' has no attribute 'Serial'
dsmr-mqtt.mqtt INFO: FUNCTION:del LINE:162: >>
Python 3.8.6 @ Synology DSM6
Hi,
I've setup the code but the JSON received through MQTT only shows configuration. In the logging, I see that certain MQTT messages don't seem to be sent.
user@server:/opt/dsmr2mqtt $ python3 dsmr-mqtt.py dsmr-mqtt INFO: FUNCTION:<module> LINE:70: Starting /opt/dsmr2mqtt/dsmr-mqtt.py; version = 3.0.0 dsmr-mqtt.mqtt.mqtt INFO: FUNCTION:__init__ LINE:103: >> paho-mqtt version = 1.5.1 dsmr-mqtt.mqtt.mqtt INFO: FUNCTION:__init__ LINE:117: MQTT Client ID = mqtt-dsmr dsmr-mqtt.P1_serial DEBUG: FUNCTION:__init__ LINE:51: >> dsmr-mqtt.P1_serial DEBUG: FUNCTION:__init__ LINE:73: serial /dev/ttyUSB0 opened dsmr-mqtt.P1_parser DEBUG: FUNCTION:__init__ LINE:50: >> dsmr-mqtt.P1_parser DEBUG: FUNCTION:__init__ LINE:62: NROF = 1 dsmr-mqtt.hadiscovery DEBUG: FUNCTION:__init__ LINE:49: >> dsmr-mqtt DEBUG: FUNCTION:<module> LINE:174: __main__: >> dsmr-mqtt DEBUG: FUNCTION:main LINE:138: >> dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:will_set LINE:425: >> dsmr-mqtt.mqtt.mqtt INFO: FUNCTION:run LINE:517: Broker = 192.168.0.5>> dsmr-mqtt.P1_parser DEBUG: FUNCTION:run LINE:211: >> dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__internet_on LINE:222: >> dsmr-mqtt.hadiscovery DEBUG: FUNCTION:run LINE:128: >> dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/dsmr/dsmr-device/config; MESSAGE={"name":"Status","unique_id":"dsmr-device","state_topic":"dsmr/status","icon":"mdi:home-automation","device":{"name":"HA dsmr reader","sw_version":"3.0.0","model":"P1 USB/dsmr-mqtt","manufacturer":"hansij66 @github.com","identifiers":["dsmr"]}} dsmr-mqtt.mqtt.mqtt WARNING: FUNCTION:do_publish LINE:451: MQTT publish was not successfull, rc = 4: The client is not currently connected. dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/dsmr/p_consumed/config; MESSAGE={"unique_id":"p_consumed","state_topic":"dsmr/el","name":"Total power usage [W]","unit_of_measurement":"W","value_template":"{{value_json.p_consumed}}","device_class":"power","icon":"mdi:gauge","device":{"identifiers":["dsmr"]}} dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__internet_on LINE:229: Internet connectivity to MQTT broker 192.168.0.5 at port 1883 available dsmr-mqtt.mqtt.mqtt INFO: FUNCTION:run LINE:575: Start mqtt loop... dsmr-mqtt.mqtt.mqtt WARNING: FUNCTION:do_publish LINE:451: MQTT publish was not successfull, rc = 4: The client is not currently connected. dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:set_status LINE:408: >> dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__set_status LINE:391: >> dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=dsmr/status; MESSAGE=online dsmr-mqtt.P1_serial DEBUG: FUNCTION:run LINE:198: >> dsmr-mqtt.mqtt.mqtt WARNING: FUNCTION:do_publish LINE:451: MQTT publish was not successfull, rc = 4: The client is not currently connected. dsmr-mqtt.P1_serial DEBUG: FUNCTION:__read_serial LINE:152: >> dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/dsmr/p_generated/config; MESSAGE={"unique_id":"p_generated","state_topic":"dsmr/el","name":"Total power generation [W]","unit_of_measurement":"W","value_template":"{{value_json.p_generated}}","device_class":"power","icon":"mdi:gauge","device":{"identifiers":["dsmr"]}} dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=dsmr/sw-version; MESSAGE=main=3.0.0; mqtt=2.0.0 dsmr-mqtt.mqtt.mqtt WARNING: FUNCTION:do_publish LINE:451: MQTT publish was not successfull, rc = 4: The client is not currently connected. dsmr-mqtt.mqtt.mqtt WARNING: FUNCTION:do_publish LINE:451: MQTT publish was not successfull, rc = 4: The client is not currently connected. dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:run LINE:587: Disconnect TIMER = 0 dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/dsmr/gas_consumed/config; MESSAGE={"unique_id":"gas_consumed","state_topic":"dsmr/gas","name":"gas consumption [m\u00b3]","unit_of_measurement":"m\u00b3","value_template":"{{value_json.gas_consumed|float/1000|round(0)}}","device_class":"gas","state_class":"total","icon":"mdi:counter","device":{"identifiers":["dsmr"]}} dsmr-mqtt.mqtt.mqtt WARNING: FUNCTION:do_publish LINE:451: MQTT publish was not successfull, rc = 4: The client is not currently connected. dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/dsmr/el_consumed/config; MESSAGE={"unique_id":"el_consumed","state_topic":"dsmr/el","name":"EL consumed [Wh]","unit_of_measurement":"Wh","value_template":"{{value_json.el_consumed}}","device_class":"energy","state_class":"total","icon":"mdi:counter","device":{"identifiers":["dsmr"]}} dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/dsmr/el_returned/config; MESSAGE={"unique_id":"el_returned","state_topic":"dsmr/el","name":"EL returned [Wh]","unit_of_measurement":"Wh","value_template":"{{value_json.el_returned}}","device_class":"energy","state_class":"total","icon":"mdi:counter","device":{"identifiers":["dsmr"]}} dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/dsmr/V1/config; MESSAGE={"unique_id":"V1","state_topic":"dsmr/el","name":"Voltage L1 [V]","unit_of_measurement":"V","value_template":"{{value_json.V1}}","device_class":"voltage","icon":"mdi:gauge","device":{"identifiers":["dsmr"]}} dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/dsmr/V2/config; MESSAGE={"unique_id":"V2","state_topic":"dsmr/el","name":"Voltage L2 [V]","unit_of_measurement":"V","value_template":"{{value_json.V2}}","device_class":"voltage","icon":"mdi:gauge","device":{"identifiers":["dsmr"]}} dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=homeassistant/sensor/dsmr/V3/config; MESSAGE={"unique_id":"V3","state_topic":"dsmr/el","name":"Voltage L3 [V]","unit_of_measurement":"V","value_template":"{{value_json.V3}}","device_class":"voltage","icon":"mdi:gauge","device":{"identifiers":["dsmr"]}} dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__on_connect LINE:262: >> dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__on_connect LINE:264: Connected: userdata=None; flags={'session present': 0}; rc=Success: Connection Accepted. dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__set_connected_flag LINE:237: >> flag=True; current __connected_flag=False dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:__set_status LINE:391: >> dsmr-mqtt.mqtt.mqtt DEBUG: FUNCTION:do_publish LINE:444: >> TOPIC=dsmr/status; MESSAGE=online
Am I doing something wrong?
Hi,
There is a "dsmr50_Stromnetz_Graz_Austria.py" so i think it should work also
in Graz with the Sagemcom T210-D-r
Where i have to enter the two codes (got from https://portal.e-netze.at/anschlussobjektdaten ) in your files?
Thanks, Alex
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.