// Copyright (C) 2019-2023 Fredrik Öhrström (gpl-3.0-or-later)
driver {
name = eurisii
meter_type = HeatCostAllocationMeter
default_fields = name,id,current_consumption_hca,status,timestamp
detect {
mvt = INE,55,08
mvt = RAM,55,08
}
fields {
field {
name = status
quantity = Text
info = 'Meter status from error flags and tpl status field.'
attributes = STATUS,INCLUDE_TPL_STATUS
match {
measurement_type = Instantaneous
vif_range = ErrorFlags
}
lookup {
name = ERROR_FLAGS
map_type = BitToString
mask_bits = 0xffff
default_message = OK
map {
name = MEASUREMENT
value = 0x0001
test = Set
}
map {
name = SABOTAGE
value = 0x0002
test = Set
}
map {
name = BATTERY
value = 0x0004
test = Set
}
map {
name = CS
value = 0x0008
test = Set
}
map {
name = HF
value = 0x0010
test = Set
}
map {
name = RESET
value = 0x0020
test = Set
}
}
}
field {
name = error_flags
quantity = Text
info = 'Deprecated field! Use status instead.'
attributes = DEPRECATED,STATUS,INCLUDE_TPL_STATUS
match {
measurement_type = Instantaneous
vif_range = ErrorFlags
}
lookup {
name = ERROR_FLAGS
map_type = BitToString
mask_bits = 0xffff
default_message = OK
map {
name = MEASUREMENT
value = 0x0001
test = Set
}
map {
name = SABOTAGE
value = 0x0002
test = Set
}
map {
name = BATTERY
value = 0x0004
test = Set
}
map {
name = CS
value = 0x0008
test = Set
}
map {
name = HF
value = 0x0010
test = Set
}
map {
name = RESET
value = 0x0020
test = Set
}
}
}
field {
name = current_consumption
quantity = HCA
info = 'The current heat cost allocation.'
match {
measurement_type = Instantaneous
vif_range = HeatCostAllocation
}
}
field {
name = 'consumption_at_set_date_{storage_counter}'
quantity = HCA
info = 'The heat cost allocation at set date #.'
match {
measurement_type = Instantaneous
vif_range = HeatCostAllocation
storage_nr = 1,17
}
}
field {
name = consumption_at_set_date
quantity = HCA
info = 'Deprecated field.'
match {
measurement_type = Instantaneous
vif_range = HeatCostAllocation
storage_nr = 1
}
}
}
tests {
test {
args = 'HeatMeter eurisii 88018801 NOKEY'
telegram = 7644C52501880188550872_01880188C5255508010000002F2F0B6E332211426E110182016E1102C2016E110382026E1104C2026E110582036E1106C2036E110782046E1108C2046E110982056E1110C2056E111182066E1112C2066E111382076E1114C2076E111582086E1116C2086E111702FD172100
json = '{"_":"telegram","media":"heat cost allocation","meter":"eurisii","name":"HeatMeter","id":"88018801","status":"MEASUREMENT RESET","current_consumption_hca":112233,"consumption_at_set_date_hca":273,"consumption_at_set_date_1_hca":273,"consumption_at_set_date_2_hca":529,"consumption_at_set_date_3_hca":785,"consumption_at_set_date_4_hca":1041,"consumption_at_set_date_5_hca":1297,"consumption_at_set_date_6_hca":1553,"consumption_at_set_date_7_hca":1809,"consumption_at_set_date_8_hca":2065,"consumption_at_set_date_9_hca":2321,"consumption_at_set_date_10_hca":4113,"consumption_at_set_date_11_hca":4369,"consumption_at_set_date_12_hca":4625,"consumption_at_set_date_13_hca":4881,"consumption_at_set_date_14_hca":5137,"consumption_at_set_date_15_hca":5393,"consumption_at_set_date_16_hca":5649,"consumption_at_set_date_17_hca":5905,"error_flags":"MEASUREMENT RESET","timestamp":"1111-11-11T11:11:11Z"}'
fields = 'HeatMeter;88018801;112233;MEASUREMENT RESET;1111-11-11 11:11.11'
}
test {
args = 'HeatMeter2 eurisii 60200770 NOKEY'
telegram = 76442D4870072060550872700720602D485508280060052F2F_0B6E320100426E550082016E3500C2016E1F0082026E1F00C2026E130082036E1300C2036E130082046E1300C2046E120082056E7D01C2056E440182066E0601C2066EB80082076E7F00C2076E320082086E1C00C2086E1C0002FD170000
json = '{"_":"telegram","media":"heat cost allocation","meter":"eurisii","name":"HeatMeter2","id":"60200770","status":"OK","error_flags":"OK","current_consumption_hca":132,"consumption_at_set_date_4_hca":31,"consumption_at_set_date_5_hca":19,"consumption_at_set_date_6_hca":19,"consumption_at_set_date_2_hca":53,"consumption_at_set_date_14_hca":127,"consumption_at_set_date_8_hca":19,"consumption_at_set_date_1_hca":85,"consumption_at_set_date_10_hca":381,"consumption_at_set_date_17_hca":28,"consumption_at_set_date_13_hca":184,"consumption_at_set_date_11_hca":324,"consumption_at_set_date_3_hca":31,"consumption_at_set_date_9_hca":18,"consumption_at_set_date_15_hca":50,"consumption_at_set_date_16_hca":28,"consumption_at_set_date_7_hca":19,"consumption_at_set_date_12_hca":262,"consumption_at_set_date_hca":85,"timestamp":"1111-11-11T11:11:11Z"}'
fields = 'HeatMeter2;60200770;132;OK;1111-11-11 11:11.11'
}
}
}