Ich habe mir folgenden Gaszähler gekauft: Smartnetz Shop | Smartnetz Smart Gas Reader SCE 3.0 BK4 / BK G4- WiFi mit TASMOTA vorinstalliert | WLAN | MQTT | BK4 MICRO USB
Der Gaszähler wurde nach Anleitung installiert und die Einstellungen vorgenommen. Leider werden keine Entitäten erstellt.
Auch der Hersteller hat bisher keine Lösung gefunden.
Tasmota-Script:
>D
resetb=0
p:m1=0
p:g1=0
p:g2=0
p:month1=0
p:month2=0
p:month3=0
p:gesamt=0
c1=0
s1=0
h1=0
hkw1=0
gkw1=0
gkw2=0
mkw1=0
mkw2=0
mkw3=0
mkwgs=0
skw1=0
hgp=0
g1gp=0
g2gp=0
m1gp=0
m2gp=0
m3gp=0
gsgp=0
hr=0
dy=0
zu=0.952
br=11.5
gp=11.01
gasinit=17623.307
gastotal=0
>B
=>sensor53 l255
=>Teleperiod 60
=>CounterDebounceLow 500
=>CounterDebounceHigh 500
>S
if resetb==1
then
=>counter1 0
=>reset 2
endif
h1=s1-m1
hkw1=h1*br*zu
hgp=(hkw1*gp)/100
gkw1=g1*br*zu
gkw2=g2*br*zu
mkw1=month1*br*zu
mkw2=month2*br*zu
mkw3=month3*br*zu
mkwgs=gesamt*br*zu
g1gp=(gkw1*gp)/100
g2gp=(gkw2*gp)/100
m1gp=(mkw1*gp)/100
m2gp=(mkw2*gp)/100
m3gp=(mkw3*gp)/100
gsgp=(mkwgs*gp)/100
skw1=s1*br*zu
hr=hours
dy=day
if chg[hr]>0
and hr==0
then
m1=s1
g2=g1
g1=h1
month1=month1+h1
gesamt=gesamt+h1
if chg[dy]<2
and dy==1
then
month3=month2
month2=month1
month1=0
endif
svars
endif
if upsecs%tper==0{
=>Publish tasmota/%topic%/main/td_m3 %2h1%
=>Publish tele/%topic%/main/td_kwh %2hkw1%
=>Publish tele/%topic%/main/yd_m3 %2g1%
=>Publish tele/%topic%/main/yd_kwh %2gkw1%
=>Publish tele/%topic%/main/dbyd_m3 %2g2%
=>Publish tele/%topic%/main/dbyd_kwh %2gkw2%
=>Publish tele/%topic%/main/value %2s1%
=>Publish tele/%topic%/main/gastotal %2gastotal%
=>Publish tele/%topic%/json {"gastotal": "%2gastotal%", "value": "%2s1%", "today_m3": "%2h1%", "today_kwh": "%2hkw1%", "yesterday_m3": "%2g1%", "yesterday_kwh": "%2gkw1%", "db_yesterday_m3": "%2g2%", "db_yesterday_kwh": "%2gkw2%"}
}
>T
s1=Counter#C1/100
c1=Counter#C1
gastotal=(c1/100)+gasinit
>W
<br><br>
Smartnetz Smart {m} Gas Reader 3.0 SCE
<a href="https://script.smartnetz.at" target="_blank">Script Configurator</a>
<br><br>
GAS gezählt: {m} %3s1% m³
Zählerstand: {m} %gastotal% m³
<br>
Zustandszahl: {m} %zu%
Brennwert: {m} %br% kWh/m³
Gaspreis: {m} %gp% Cent/kWh
<br>
Verbrauch:
Heute: {m} %2h1% m³ | %2hkw1% kWh
Kosten: {m} %2hgp% €
Gestern: {m} %2g1% m³ | %2gkw1% kWh
Kosten: {m} %2g1gp% €
Vorgestern: {m} %2g2% m³ | %2gkw2% kWh
Kosten: {m} %2g2gp% €
<br>
Aktueller Monat: {m} %2month1% m³ | %2m1gp% €
Letzter Monat: {m} %2month2% m³ | %2m2gp% €
Vorletzter Monat: {m} %2month3% m³ | %2m3gp% €
Gesamt: {m} %2gesamt% m³ | %2gsgp% €
bu(resetb "..." "Zählerreset")
#
Auszug aus der Konsole von Tasmota:
19:01:49.676 SCR: performs "Publish tasmota/Gaszaehler/main/td_m3 5.14"
19:01:49.683 MQT: tasmota/Gaszaehler/main/td_m3 = 5.14
19:01:49.686 SCR: performs "Publish tele/Gaszaehler/main/td_kwh 56.27"
19:01:49.690 MQT: tele/Gaszaehler/main/td_kwh = 56.27
19:01:49.693 SCR: performs "Publish tele/Gaszaehler/main/yd_m3 6.56"
19:01:49.697 MQT: tele/Gaszaehler/main/yd_m3 = 6.56
19:01:49.700 SCR: performs "Publish tele/Gaszaehler/main/yd_kwh 71.82"
19:01:49.706 MQT: tele/Gaszaehler/main/yd_kwh = 71.82
19:01:49.708 SCR: performs "Publish tele/Gaszaehler/main/dbyd_m3 4.92"
19:01:49.713 MQT: tele/Gaszaehler/main/dbyd_m3 = 4.92
19:01:49.715 SCR: performs "Publish tele/Gaszaehler/main/dbyd_kwh 53.86"
19:01:49.720 MQT: tele/Gaszaehler/main/dbyd_kwh = 53.86
19:01:49.722 SCR: performs "Publish tele/Gaszaehler/main/value 27.45"
19:01:49.726 MQT: tele/Gaszaehler/main/value = 27.45
19:01:49.729 SCR: performs "Publish tele/Gaszaehler/main/gastotal 17650.76"
19:01:49.733 MQT: tele/Gaszaehler/main/gastotal = 17650.76
19:01:49.736 SCR: performs "Publish tele/Gaszaehler/json {"gastotal": "17650.76", "value": "27.45", "today_m3": "5.14", "today_kwh": "56.27", "yesterday_m3": "6.56", "yesterday_kwh": "71.82", "db_yesterday_m3": "4.92", "db_yesterday_kwh": "53.86"}"
19:01:49.744 MQT: tele/Gaszaehler/json = {"gastotal": "17650.76", "value": "27.45", "today_m3": "5.14", "today_kwh": "56.27", "yesterday_m3": "6.56", "yesterday_kwh": "71.82", "db_yesterday_m3": "4.92", "db_yesterday_kwh": "53.86"}
MQTT-Einstellungen in Tasmota:
IP: Hostname oder Ip Adresse ihres MQTT Servers auf Homeassistant
Port: Port Ihres MQTT Servers
Client: Gaszaehler
Benutzer: MQTT Benutzername
Passwort: MQTT Passwort
Topic: Gaszaehler
Full Topic: %prefix%/%topic%/
MQTT Integration in Home Assistant: (Script für Configuration.yaml)
mqtt:
sensor:
- name: "Zählerstand"
unique_id: sensor.gaszaehler_zaehlerstand
state_topic: "tele/Gaszaehler/json"
value_template: '{{ value_json.gastotal }}'
unit_of_measurement: 'm³'
payload_available: "Online"
payload_not_available: "Offline"
device_class: gas
state_class: "total_increasing"
- name: "Zählung seit Nullung"
unique_id: sensor.gaszaehler_zaehlung_seit_nullung
state_topic: "tele/Gaszaehler/json"
value_template: '{{ value_json.value }}'
unit_of_measurement: 'm³'
payload_available: "Online"
payload_not_available: "Offline"
device_class: gas
state_class: "total_increasing"
- name: "Verbrauch Volumen heute"
unique_id: sensor.gaszaehler_verbrauch_volumen_heute
state_topic: "tele/Gaszaehler/json"
value_template: '{{ value_json.today_m3 }}'
unit_of_measurement: 'm³'
payload_available: "Online"
payload_not_available: "Offline"
device_class: gas
state_class: "total_increasing"
- name: "Verbrauch Energie heute"
unique_id: sensor.gaszaehler_verbrauch_energie_heute
state_topic: "tele/Gaszaehler/json"
value_template: '{{ value_json.today_kwh }}'
unit_of_measurement: 'kWh'
payload_available: "Online"
payload_not_available: "Offline"
device_class: energy
state_class: "total_increasing"
- name: "Verbrauch Volumen gestern"
unique_id: sensor.gaszaehler_verbrauch_volumen_gestern
state_topic: "tele/Gaszaehler/json"
value_template: '{{ value_json.yesterday_m3 }}'
unit_of_measurement: 'm³'
payload_available: "Online"
payload_not_available: "Offline"
device_class: gas
state_class: "total_increasing"
- name: "Verbrauch Energie gestern"
unique_id: sensor.gaszaehler_verbrauch_energie_gestern
state_topic: "tele/Gaszaehler/json"
value_template: '{{ value_json.yesterday_kwh }}'
unit_of_measurement: 'kWh'
payload_available: "Online"
payload_not_available: "Offline"
device_class: energy
state_class: "total_increasing"
- name: "Verbrauch Volumen vorgestern"
unique_id: sensor.gaszaehler_verbrauch_volumen_vorgestern
state_topic: "tele/Gaszaehler/json"
value_template: '{{ value_json.db_yesterday_m3 }}'
unit_of_measurement: 'm³'
payload_available: "Online"
payload_not_available: "Offline"
device_class: gas
state_class: "total_increasing"
- name: "Verbrauch Energie vorgestern"
unique_id: sensor.gaszaehler_verbrauch_energie_vorgestern
state_topic: "tele/Gaszaehler/json"
value_template: '{{ value_json.db_yesterday_kwh }}'
unit_of_measurement: 'kWh'
payload_available: "Online"
payload_not_available: "Offline"
device_class: energy
state_class: "total_increasing"
Dennoch wird keine Entität unter MQTT angelegt. Wer kann bei der Fehlersuche unterstützen?