kopia lustrzana https://github.com/weetmuts/wmbusmeters
				
				
				
			Add supercal driver.
							rodzic
							
								
									683fef8d5c
								
							
						
					
					
						commit
						b91a59d385
					
				| 
						 | 
				
			
			@ -0,0 +1,69 @@
 | 
			
		|||
// Copyright (C) 2024 Fredrik Öhrström (gpl-3.0-or-later)
 | 
			
		||||
driver {
 | 
			
		||||
    name           = supercal
 | 
			
		||||
    default_fields = name,id,total_kwh,timestamp
 | 
			
		||||
    meter_type     = HeatMeter
 | 
			
		||||
    detect {
 | 
			
		||||
        mvt = SON,1b,04
 | 
			
		||||
    }
 | 
			
		||||
    use = meter_datetime,flow_temperature_c,return_temperature_c,volume_flow_m3h
 | 
			
		||||
    field {
 | 
			
		||||
        name = total
 | 
			
		||||
        quantity = Energy
 | 
			
		||||
        match {
 | 
			
		||||
            measurement_type = Instantaneous
 | 
			
		||||
            vif_range = AnyEnergyVIF
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    field {
 | 
			
		||||
        name = total
 | 
			
		||||
        quantity = Volume
 | 
			
		||||
        match {
 | 
			
		||||
            measurement_type = Instantaneous
 | 
			
		||||
            vif_range = Volume
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    field {
 | 
			
		||||
        name = target
 | 
			
		||||
        quantity = Energy
 | 
			
		||||
        match {
 | 
			
		||||
            measurement_type = Instantaneous
 | 
			
		||||
            vif_range = AnyEnergyVIF
 | 
			
		||||
            storage_nr = 20
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    field {
 | 
			
		||||
        name = target
 | 
			
		||||
        quantity = Volume
 | 
			
		||||
        match {
 | 
			
		||||
            measurement_type = Instantaneous
 | 
			
		||||
            vif_range = Volume
 | 
			
		||||
            storage_nr = 20
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    field {
 | 
			
		||||
        name = target
 | 
			
		||||
        quantity = PointInTime
 | 
			
		||||
        display_unit = date
 | 
			
		||||
        match {
 | 
			
		||||
            measurement_type = Instantaneous
 | 
			
		||||
            vif_range = Date
 | 
			
		||||
            storage_nr = 20
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    field {
 | 
			
		||||
        name = power
 | 
			
		||||
        quantity = Power
 | 
			
		||||
        match {
 | 
			
		||||
            measurement_type = Instantaneous
 | 
			
		||||
            vif_range = AnyPowerVIF
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
    test {
 | 
			
		||||
        args = 'sonsupercal supercal 89508019 NOKEY'
 | 
			
		||||
        comment = 'Sontex Supercal 739 test case'
 | 
			
		||||
        telegram = 4444EE4D198050891B047AFB000000_046D3612E423820A6CE1F1040628010000840A060000000004144A110000840A14000000000259E30F025D2A0C023B1D01032C3A0100
 | 
			
		||||
        json = '{"flow_temperature_c": 40.67,"id": "89508019","media": "heat","meter": "supercal","meter_datetime": "2023-03-04 18:54","name": "sonsupercal","power_kw": 3.14,"return_temperature_c": 31.14,"target_date": "2127-01-01","target_kwh": 0,"target_m3": 0,"timestamp": "1111-11-11T11:11:11Z","total_kwh": 296,"total_m3": 44.26,"volume_flow_m3h": 0.285}'
 | 
			
		||||
        fields = 'sonsupercal;89508019;296;1111-11-11 11:11.11'
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			@ -31,7 +31,6 @@ namespace
 | 
			
		|||
        di.setMeterType(MeterType::HeatMeter);
 | 
			
		||||
        di.addLinkMode(LinkMode::T1);
 | 
			
		||||
        di.addDetection(MANUFACTURER_MAD, 0x04, 0x00);
 | 
			
		||||
        di.addDetection(MANUFACTURER_SON, 0x04, 0x1b); // Sontex Supercal 739
 | 
			
		||||
        di.setConstructor([](MeterInfo& mi, DriverInfo& di){ return shared_ptr<Meter>(new Driver(mi, di)); });
 | 
			
		||||
    });
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -172,10 +171,3 @@ namespace
 | 
			
		|||
// telegram=|A44424348630579300047ADD0000202F2F046D0721B62C04064708000004135DB0030001FD1700426C9F2C4406C6040000C40106C0070000C4020637070000C4030611070000C404060B070000C405060B070000C406060B070000C407060B070000C40806A5060000C40906F7050000C40A067A050000C40B060F050000C40C06C6040000C40D063F040000C40E06BB030000C40F06A502000003FD0C05000002FD0B1111|
 | 
			
		||||
// {"consumption_at_set_date_11_kwh":1803,"consumption_at_set_date_13_kwh":1803,"consumption_at_set_date_15_kwh":1803,"consumption_at_set_date_17_kwh":1701,"consumption_at_set_date_19_kwh":1527,"consumption_at_set_date_1_kwh":1222,"consumption_at_set_date_21_kwh":1402,"consumption_at_set_date_23_kwh":1295,"consumption_at_set_date_25_kwh":1222,"consumption_at_set_date_27_kwh":1087,"consumption_at_set_date_29_kwh":955,"consumption_at_set_date_31_kwh":677,"consumption_at_set_date_3_kwh":1984,"consumption_at_set_date_5_kwh":1847,"consumption_at_set_date_7_kwh":1809,"consumption_at_set_date_9_kwh":1803,"id":"93573086","media":"heat","meter":"microclima","meter_datetime":"2021-12-22 01:07","model_version":"000005","name":"Heat","parameter_set":"1111","set_date_11_date":"2020-02-29","set_date_13_date":"2019-12-31","set_date_15_date":"2019-10-31","set_date_17_date":"2019-08-31","set_date_19_date":"2019-06-30","set_date_1_date":"2020-12-31","set_date_21_date":"2019-04-30","set_date_23_date":"2019-02-28","set_date_25_date":"2018-12-31","set_date_27_date":"2018-10-31","set_date_29_date":"2018-08-31","set_date_31_date":"2018-06-30","set_date_3_date":"2020-10-31","set_date_5_date":"2020-08-31","set_date_7_date":"2020-06-30","set_date_9_date":"2020-04-30","status":"OK","timestamp":"1111-11-11T11:11:11Z","total_energy_consumption_kwh":2119,"total_volume_m3":241.757}
 | 
			
		||||
// |Heat;93573086;OK;2119;241.757;1111-11-11 11:11.11
 | 
			
		||||
 | 
			
		||||
// Sontex Supercal 739 test case
 | 
			
		||||
 | 
			
		||||
// Test: sonsupercal microclima 89508019 NOKEY
 | 
			
		||||
// telegram=|4444EE4D198050891B047AFB000000_046D3612E423820A6CE1F1040628010000840A060000000004144A110000840A14000000000259E30F025D2A0C023B1D01032C3A0100|
 | 
			
		||||
// {"media":"heat","meter":"microclima","name":"sonsupercal","id":"89508019","meter_datetime":"2023-03-04 18:54","flow_temperature_c":40.67,"return_temperature_c":31.14,"status":"OK","total_energy_consumption_kwh":296,"total_volume_m3":44.26,"volume_flow_m3h":0.285,"power_kw":3.14,"consumption_at_set_date_20_kwh":0,"set_date_20_date":"-205264256-02-29","timestamp":"1111-11-11T11:11:11Z"}
 | 
			
		||||
// |sonsupercal;89508019;OK;296;44.26;1111-11-11 11:11.11
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,7 +15,7 @@
 | 
			
		|||
 along with this program.  If not, see <http://www.gnu.org/licenses/>.
 | 
			
		||||
*/
 | 
			
		||||
 | 
			
		||||
// Generated 2024-06-19_21:28
 | 
			
		||||
// Generated 2024-06-19_22:21
 | 
			
		||||
 | 
			
		||||
BuiltinDriver builtins_[] =
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -26,6 +26,7 @@ BuiltinDriver builtins_[] =
 | 
			
		|||
    { "istaheat", "driver{name=istaheat meter_type=HeatMeter default_fields=name,id,status,total_kwh,target_kwh,timestamp detect{mvt=IST,a9,04}field{name=status quantity=Text info='Meter status from tpl field.'attributes=INCLUDE_TPL_STATUS}field{name=total quantity=Energy info='The total heat energy consumption recorded by this meter.'match{measurement_type=Instantaneous vif_range=AnyEnergyVIF}}field{name=target quantity=PointInTime info='Last day of previous billing month.'display_unit=date match{measurement_type=Instantaneous vif_range=Date storage_nr=2}}field{name=target quantity=Energy info='The total heat energy for the previous month period.'match{measurement_type=Instantaneous vif_range=AnyEnergyVIF storage_nr=2}}field{name=target quantity=Volume info='The total heating media volume recorded by this meter at the end of last month.'match{measurement_type=Instantaneous vif_range=Volume storage_nr=2}}field{name=last_year quantity=PointInTime info='Last day of previous billing year.'display_unit=date match{measurement_type=Instantaneous vif_range=Date storage_nr=1}}field{name=last_year quantity=Energy info='The total heat energy for the previous year period.'match{measurement_type=Instantaneous vif_range=AnyEnergyVIF storage_nr=1}}}", false },
 | 
			
		||||
    { "itronheat", "driver{name=itronheat meter_type=HeatMeter default_fields=name,id,status,total_kwh,timestamp detect{mvt=ITW,00,04}use=meter_datetime field{name=status quantity=Text info='Meter status from tpl field.'attributes=INCLUDE_TPL_STATUS}field{name=total quantity=Energy info='The total heat energy consumption recorded by this meter.'match{measurement_type=Instantaneous vif_range=AnyEnergyVIF}}field{name=total quantity=Volume info='The total volume of heating media recorded by this meter.'match{measurement_type=Instantaneous vif_range=Volume}}field{name=last_year quantity=PointInTime info='Last day of previous billing year.'display_unit=date match{measurement_type=Instantaneous vif_range=Date storage_nr=1}}field{name=last_year quantity=Energy info='The total heat energy for the previous year period.'match{measurement_type=Instantaneous vif_range=AnyEnergyVIF storage_nr=1}}}", false },
 | 
			
		||||
    { "kampress", "driver{name=kampress default_fields=name,id,status,pressure_bar,max_pressure_bar,min_pressure_bar,timestamp meter_type=PressureSensor detect{mvt=KAM,01,18}field{name=status quantity=Text info=status_and_error_flags match{measurement_type=Instantaneous vif_range=ErrorFlags}lookup{name=ERROR_FLAGS map_type=BitToString mask_bits=0xffff default_message=OK map{name=DROP info='Unexpected drop in pressure in relation to average pressure.'value=0x01 test=Set}map{name=SURGE info='Unexpected increase in pressure in relation to average pressure.'value=0x02 test=Set}map{name=HIGH info='Average pressure has reached configurable limit. Default 15 bar.'value=0x04 test=Set}map{name=LOW info='Average pressure has reached configurable limit. Default 1.5 bar.'value=0x08 test=Set}map{name=TRANSIENT info='Pressure changes quickly over short timeperiods. Average is fluctuating.'value=0x10 test=Set}map{name=COMM_ERROR info='Cannot measure properly or bad internal communication.'value=0x20 test=Set}}}field{name=pressure quantity=Pressure info='The measured pressure.'match{measurement_type=Instantaneous vif_range=Pressure}}field{name=max_pressure quantity=Pressure info='The maximum pressure measured during ?'match{measurement_type=Maximum vif_range=Pressure}}field{name=min_pressure quantity=Pressure info='The minimum pressure measured during ?'match{measurement_type=Minimum vif_range=Pressure}}field{name=alfa info='We do not know what this is.'quantity=Dimensionless vif_scaling=None match{difvifkey=05FF09}}field{name=beta info='We do not know what this is.'quantity=Dimensionless vif_scaling=None match{difvifkey=05FF0A}}}", false },
 | 
			
		||||
    { "supercal", "driver{name=supercal default_fields=name,id,total_kwh,timestamp meter_type=HeatMeter detect{mvt=SON,1b,04}use=meter_datetime,flow_temperature_c,return_temperature_c,volume_flow_m3h field{name=total quantity=Energy match{measurement_type=Instantaneous vif_range=AnyEnergyVIF}}field{name=total quantity=Volume match{measurement_type=Instantaneous vif_range=Volume}}field{name=target quantity=Energy match{measurement_type=Instantaneous vif_range=AnyEnergyVIF storage_nr=20}}field{name=target quantity=Volume match{measurement_type=Instantaneous vif_range=Volume storage_nr=20}}field{name=target quantity=PointInTime display_unit=date match{measurement_type=Instantaneous vif_range=Date storage_nr=20}}field{name=power quantity=Power match{measurement_type=Instantaneous vif_range=AnyPowerVIF}}}", false },
 | 
			
		||||
    { "werhlemodwm", "driver{name=werhlemodwm meter_type=WaterMeter default_fields=name,id,total_m3,timestamp detect{mvt=WZG,03,16}use=meter_datetime use=target_date use=target_m3 use=total_m3 use=fabrication_no field{name=next_target quantity=PointInTime display_unit=date match{measurement_type=Instantaneous vif_range=Date add_combinable=FutureValue storage_nr=1}}}", false },
 | 
			
		||||
};
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -40,5 +41,6 @@ MapToDriver builtins_mvts_[] =
 | 
			
		|||
    { { MANUFACTURER_IST,0xa9,0x04 }, "istaheat" },
 | 
			
		||||
    { { MANUFACTURER_ITW,0x00,0x04 }, "itronheat" },
 | 
			
		||||
    { { MANUFACTURER_KAM,0x01,0x18 }, "kampress" },
 | 
			
		||||
    { { MANUFACTURER_SON,0x1b,0x04 }, "supercal" },
 | 
			
		||||
    { { MANUFACTURER_WZG,0x03,0x16 }, "werhlemodwm" },
 | 
			
		||||
};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,4 +1,4 @@
 | 
			
		|||
// Generated 2024-06-19_21:28
 | 
			
		||||
// Generated 2024-06-19_22:21
 | 
			
		||||
test {
 | 
			
		||||
    args     = 'Gas elster 05105025 NOKEY'
 | 
			
		||||
    telegram = 3644A511640010253837722550100593158103E70020052F2F_0374E602000C137034220302FD74EE0F2F2F2F2F2F2F2F2F2F2F2F2F2F2F
 | 
			
		||||
| 
						 | 
				
			
			@ -77,3 +77,10 @@ test {
 | 
			
		|||
    json     = '{"media":"pressure","meter":"kampress","name":"Pressing","id":"77000317","status":"LOW","pressure_bar":1.02,"max_pressure_bar":1.03,"min_pressure_bar":1.02,"alfa_counter":0.001246,"beta_counter":0.000997,"timestamp":"1111-11-11T11:11:11Z"}'
 | 
			
		||||
    fields   = 'Pressing;77000317;LOW;1.02;1.03;1.02;1111-11-11 11:11.11'
 | 
			
		||||
}
 | 
			
		||||
test {
 | 
			
		||||
    args     = 'sonsupercal supercal 89508019 NOKEY'
 | 
			
		||||
    comment  = 'Sontex Supercal 739 test case'
 | 
			
		||||
    telegram = 4444EE4D198050891B047AFB000000_046D3612E423820A6CE1F1040628010000840A060000000004144A110000840A14000000000259E30F025D2A0C023B1D01032C3A0100
 | 
			
		||||
    json     = '{"flow_temperature_c": 40.67,"id": "89508019","media": "heat","meter": "supercal","meter_datetime": "2023-03-04 18:54","name": "sonsupercal","power_kw": 3.14,"return_temperature_c": 31.14,"target_date": "2127-01-01","target_kwh": 0,"target_m3": 0,"timestamp": "1111-11-11T11:11:11Z","total_kwh": 296,"total_m3": 44.26,"volume_flow_m3h": 0.285}'
 | 
			
		||||
    fields   = 'sonsupercal;89508019;296;1111-11-11 11:11.11'
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Ładowanie…
	
		Reference in New Issue