Martinvdm
(Martin)
December 30, 2017, 2:14pm
1
Hi,
I have setup DSMR-reader from : GitHub - dsmrreader/dsmr-reader: DSMR-telegram reader & data visualizer for hobbyists. Free for non-commercial use.
This is working fine. Has a nice gui and seperate database.
I would like to just display the current meter readings in HA as a sensor, without recording it.
I can offcourse exlude the sensors from recording it, but i cannot get the right data in HA.
I have the following configuration:
sensor:
platform: rest
name: DSMR_Meter_Standen
json_attributes:
# Huidig elektriciteitsverbruik in kW
- electricity_currently_delivered
# Huidige teruglevering elektriciteit in kW
- electricity_currently_returned
# Meterstand van verbruikte elektriciteit (laagtarief) in kWh
- electricity_delivered_1
# Meterstand van verbruikte elektriciteit (piektarief) in kWh
- electricity_delivered_2
# Meterstand van teruggeleverde elektriciteit (laagtarief) in kWh
- electricity_returned_1
# Meterstand van teruggeleverde elektriciteit (laagtarief) in kWh
- electricity_returned_2
# Meterstand van de externe (gas)meter
- extra_device_delivered
resource: http://localhost/api/v2/datalogger/dsmrreading?ordering=-timestamp&limit=1
value_template: â{{ value_json.state }}â
headers:
X-AUTHKEY: XXXXXXXXXXXXXXXXXXXXX
platform: template
sensors:
electricity_currently_delivered:
friendly_name: âelectricity_currently_deliveredâ
value_template: â{{ states.sensor.json_state.attributes[âelectricity_currently_deliveredâ] }}â
unit_of_measurement: âkWâ
electricity_currently_returned:
friendly_name: âelectricity_currently_returnedâ
value_template: â{{ states.sensor.json_state.attributes[âelectricity_currently_returnedâ] }}â
unit_of_measurement: âkWâ
electricity_delivered_1:
friendly_name: âelectricity_delivered_1â
value_template: â{{ states.sensor.json_state.attributes[âelectricity_delivered_1â] }}â
unit_of_measurement: âkWhâ
electricity_delivered_2:
friendly_name: âelectricity_delivered_2â
value_template: â{{ states.sensor.json_state.attributes[âelectricity_delivered_2â] }}â
unit_of_measurement: âkWhâ
electricity_returned_1:
friendly_name: âelectricity_returned_1â
value_template: â{{ states.sensor.json_state.attributes[âelectricity_returned_1â] }}â
unit_of_measurement: âkWhâ
electricity_returned_2:
friendly_name: âelectricity_returned_2â
value_template: â{{ states.sensor.json_state.attributes[âelectricity_returned_2â] }}â
unit_of_measurement: âkWhâ
extra_device_delivered:
friendly_name: âextra_device_deliveredâ
value_template: â{{ states.sensor.json_state.attributes[âextra_device_deliveredâ] }}â
unit_of_measurement: âm3â
More infomation about the Restful api:
http://dsmr-reader.readthedocs.io/nl/latest/api.html#api-v2-restful-api
Could it be the {} in the output witch having issues in HA?
Thanks
1 Like
Martinvdm
(Martin)
December 24, 2018, 3:55pm
3
Yep, Just went with the Mqtt sensors
ceriel
(Ceriel Roland)
December 24, 2018, 9:48pm
4
Then its a work-arround and not a fix
Thanks for the tip, will try it.
Little bit off-topic, could you point me a direction for the water meter you created (saw your reply on tweakers) would love to have one as well.
Martinvdm
(Martin)
December 27, 2018, 6:49pm
5
Hi a bit off-topic indead; but i am using this docker project from Alex: https://github.com/ualex73/docker-s0pcm-reader
In conbination with a S0pcm usb Pulse counter and a Cyble Itron sensor on my Aquadis watermeter.
Could you please share what to do where to get that working? Iâm running HA on a Rpi3. I think i have activated the MQTT broker in HA, and DSMR is publishing MQTT Telegrams. But i canât get values displayed in HA. Current configuration.yaml entries:
####DSMR
platform: mqtt
name: DSMR electricity_currently_delivered
unit_of_measurement: âkWhâ
state_topic: âdsmr/jsonâ
value_template: â{{value_json.electricity_currently_delivered}}â
If i use HA to publish the topic and value as DSMR is doing (which i can see in DSMR), the sensor picks up the value i publish from within HA. But itâs not picking up the values DSMR is publishingâŚ
ceriel
(Ceriel Roland)
January 27, 2019, 10:18am
7
Hi Raoul,
I have enabled the MQTT broker in DSMR and published the daily information.
In HA:
sensor dsmr:
platform: mqtt
name: âDSMR Power daltariefâ
state_topic: âdsmr/day-consumptionâ
unit_of_measurement: âkWhâ
value_template: â{{ value_json.electricity1 }}â
platform: mqtt
name: âDSMR Power piektariefâ
state_topic: âdsmr/day-consumptionâ
unit_of_measurement: âkWhâ
value_template: â{{ value_json.electricity2 }}â
[edit:] you can always use the MQTT Lens addin in chrome to check if DSMR is publishing to the desired topics in MQTT.
Thanks for the reply. As a MQTT n00b, i had some trouble getting all parts to work. Found out embedded HBMQTT threw an error in logs. A previous attempt to install Mosquitto failed; but gave it another try, this time with success. Did not know i had to also install a mosquitto client to test mqtt pub sub from command line. Than did not know what to enter in :/admin/dsmr_mqtt/mqttbrokersettings/. Took lots of tries and reboots, but i now have a value in HA. Thanks again.
RezzZ
(ReneS)
March 13, 2019, 11:47am
9
Hi @Martinvdm , can you explain what you did to get the water pulse meter working? I had one installed (elster PR6) when I got a new smaller watermeter, but I have not been able to connect the wires to my pgio of the rpi, and receiving data from the puls meter.
Hi , Please check my post a couple posts earlier:
1 Like
RezzZ
(ReneS)
March 15, 2019, 8:33am
11
somehow I completely overlooked that link. thanks!
Hi, sorry for hijacking this topic but I have a similar question.
I have DSMR-reader running on a raspberry pi.
The settings that I have made within DSMR-reader are as follows:
Hostname: https://ip_of_hassio
Port: 1883
Security: none
ClientID: hassio (didnât know what to put here)
username: empty
password: empty
QoS: 0
mqtt data is published as a separate topic:
[mapping]
id = dsmr/reading/id
timestamp = dsmr/reading/timestamp
electricity_delivered_1 = dsmr/reading/electricity_delivered_1
electricity_returned_1 = dsmr/reading/electricity_returned_1
electricity_delivered_2 = dsmr/reading/electricity_delivered_2
electricity_returned_2 = dsmr/reading/electricity_returned_2
In my configuration.yaml file I have the following code:
mqtt:
broker: 192.168.178.17
port: 1883
# Sensors
sensor:
- platform: mqtt
name: "DSMR Power daltarief"
state_topic: "dsmr/reading/electricity_delivered_1"
unit_of_measurement: 'W'
Maybe you can tell it already but Iâm a complete noob at this, I have search the web but I cannot make any sense of it wat so ever. Im hoping somebody on this forum is willing to help me out.
Regards Jordy