diff --git a/abbflow.py b/abbflow.py index 5d06578..0a29d6c 100644 --- a/abbflow.py +++ b/abbflow.py @@ -1,34 +1,31 @@ - +"""Driver for connecting ABB Flowmeter to Meshify.""" import threading -import time from device_base import deviceBase -from datetime import datetime class start(threading.Thread, deviceBase): + """Start class required for driver.""" + def __init__(self, name=None, number=None, mac=None, Q=None, mcu=None, companyId=None, offset=None, mqtt=None, Nodes=None): + """Initalize the driver.""" threading.Thread.__init__(self) deviceBase.__init__(self, name=name, number=number, mac=mac, Q=Q, mcu=mcu, companyId=companyId, offset=offset, mqtt=mqtt, Nodes=Nodes) self.daemon = True - self.version = "5" + self.version = "6" self.finished = threading.Event() threading.Thread.start(self) - self.sleep_minutes = 20 # this is a required function for all drivers # its goal is to upload some piece of data # about your device so it can be seen on the web def register(self): + """Register the driver.""" self.channels["status"]["last_value"] = "" def run(self): - self.sendtodbDev("01", 'sleeplog', "I'm awake!", 0, "abbflow") - while (True): - t = datetime.now() - if (t.minute == 10 or t.minute == 40): - self.sendtodbDev("01", 'sleeplog', "Going to sleep...", 0, "abbflow") - self.mcu.sleep(self.sleep_minutes * 60) + """Run the driver.""" + pass diff --git a/config.txt b/config.txt index 65cd0ca..b318c91 100644 --- a/config.txt +++ b/config.txt @@ -3,7 +3,7 @@ "driverFileName":"abbflow.py", "deviceName":"abbflow", "driverId":"0110", -"releaseVersion":"5", +"releaseVersion":"6", "files": { "file1":"abbflow.py", "file2":"modbusMap.p" } diff --git a/modbusMap.p b/modbusMap.p index 5ce54df..9ded07d 100644 --- a/modbusMap.p +++ b/modbusMap.p @@ -46,7 +46,7 @@ V3600 p24 sVla p25 -F51.145000000000006 +F506.857 sVchn p26 Vvolume_flow @@ -55,55 +55,55 @@ sVr p28 V0-5000 p29 -sVdn -p30 -Vabbflow -p31 -sVda -p32 -V1 -p33 -sVlrt -p34 -F1486686157.69757 -sVa -p35 -V4003 -p36 -sVc -p37 -V20.0 -p38 -sVmisc_u -p39 -VMCF/Day -p40 -sVf -p41 -V4 -p42 -sVmrt -p43 -V60 -p44 -sVm -p45 -Vnone -p46 -sVm1ch -p47 -g11 -sVmv -p48 -V0 -p49 -sVs -p50 -VOn -p51 sVun +p30 +V1 +p31 +sVdn +p32 +Vabbflow +p33 +sVda +p34 +g31 +sVlrt +p35 +F1495636820.550884 +sVa +p36 +V4003 +p37 +sVc +p38 +V20.0 +p39 +sVmisc_u +p40 +VMCF/Day +p41 +sVf +p42 +V4 +p43 +sVmrt +p44 +V60 +p45 +sVm +p46 +Vnone +p47 +sVm1ch +p48 +g11 +sVs +p49 +VOn +p50 +sVmv +p51 +V0 p52 -g33 sVt p53 Vfloat @@ -120,7 +120,7 @@ sVbytary p59 NsVal p60 -g49 +g52 sVvn p61 VToday Volume @@ -139,55 +139,55 @@ V3600 p68 sVla p69 -F11.007999999999999 +F37.203000000000006 sVchn p70 Vtoday_volume p71 -sg28 -V0-1000 -p72 sVun -p73 -g33 +p72 +g31 sVdn -p74 +p73 Vabbflow -p75 +p74 sVda -p76 -g33 +p75 +g31 sVlrt -p77 -F1486686158.4710568 -sg35 +p76 +F1495636821.3177112 +sg36 V4005 -p78 -sg37 +p77 +sg38 V10.0 -p79 +p78 sVmisc_u -p80 +p79 VMCF -p81 -sg41 -g42 +p80 +sg42 +g43 sVmrt -p82 +p81 V60 -p83 -sg45 +p82 +sg46 Vnone -p84 +p83 sVm1ch -p85 +p84 g56 -sg50 +sVmv +p85 +g52 +sg49 VOn p86 -sVmv +sg28 +V0-1000 p87 -g49 sg53 Vfloat p88 @@ -222,55 +222,55 @@ V3600 p102 sVla p103 -g14 +F12.765 sVchn p104 Vbattery_voltage p105 sVun p106 -g33 +g31 sVdn p107 Vabbflow p108 sVda p109 -g33 +g31 sVlrt p110 -F1481739138.1118399 -sg35 -V4001 -p111 -sg37 -V5 -p112 -sVmisc_u -p113 -VV -p114 -sg41 -g42 -sVmrt -p115 -V60 -p116 -sg45 -Vnone -p117 -sVm1ch -p118 -g90 -sVmv -p119 -g49 -sg50 -VOn -p120 +F1495635171.9785649 sg28 V0-50 +p111 +sg36 +V4001 +p112 +sg38 +V5 +p113 +sVmisc_u +p114 +VV +p115 +sg42 +g43 +sVmrt +p116 +V60 +p117 +sg46 +Vnone +p118 +sVm1ch +p119 +g90 +sg49 +VOn +p120 +sVmv p121 +g52 sg53 Vfloat p122 @@ -286,7 +286,7 @@ sVbytary p127 NsVal p128 -g49 +g52 sVvn p129 VLast Calc. Period Volume @@ -305,7 +305,7 @@ V86400 p136 sVla p137 -F30.056 +F346.049 sVchn p138 Vlast_calculation_period_volume @@ -313,47 +313,47 @@ p139 sg28 V0-1000000 p140 -sVdn +sVun p141 -Vabbflow +g31 +sVdn p142 -sVda +Vabbflow p143 -g33 -sVlrt +sVda p144 -F1486686019.8056409 -sg35 -V4011 +g31 +sVlrt p145 -sg37 -V10 +F1495636861.3905972 +sg36 +V4011 p146 -sVmisc_u +sg38 +V10 p147 -VSCF +sVmisc_u p148 -sg41 -g42 -sVmrt +VSCF p149 -V60 +sg42 +g43 +sVmrt p150 -sg45 -Vnone +V60 p151 -sVm1ch +sg46 +Vnone p152 -g124 -sVmv +sVm1ch p153 -g49 -sg50 +g124 +sg49 VOn p154 -sVun +sVmv p155 -g33 +g52 sg53 Vfloat p156 @@ -369,7 +369,7 @@ sVbytary p161 NsVal p162 -g49 +g52 sVvn p163 VDifferential Pressure @@ -388,54 +388,54 @@ V3600 p170 sVla p171 -F0.0 +F17.853000000000003 sVchn p172 Vdifferential_pressure p173 -sg28 -V0-500 -p174 sVun -p175 -g33 +p174 +g31 sVdn -p176 +p175 Vabbflow -p177 +p176 sVda -p178 -g33 +p177 +g31 sVlrt -p179 -F1486684603.377617 -sg35 +p178 +F1495634999.4304049 +sg36 V4013 -p180 -sg37 -g112 +p179 +sg38 +g113 sVmisc_u -p181 +p180 VInH20 -p182 -sg41 -g42 +p181 +sg42 +g43 sVmrt -p183 +p182 V60 -p184 -sg45 +p183 +sg46 Vnone -p185 +p184 sVm1ch -p186 +p185 g158 -sg50 +sVmv +p186 +g52 +sg49 VOn p187 -sVmv +sg28 +V0-500 p188 -g49 sg53 Vfloat p189 @@ -451,433 +451,443 @@ sVbytary p194 NsVal p195 -g49 -sVvn +V0 p196 -VYesterday Volume +sVvn p197 -sVct +VYesterday Volume p198 -Vnumber +sVct p199 -sVle +Vnumber p200 -V32 +sVle p201 -sVgrp +V32 p202 -V86400 +sVgrp p203 -sVla +V42300 p204 +sVla +p205 F0.152 sVchn -p205 -Vyesterday_volume p206 -sg28 -V0-1000 +Vyesterday_volume p207 sVun p208 -g33 -sVdn +V1 p209 -Vabbflow +sVdn p210 -sVda +Vabbflow p211 -g33 -sVlrt +sVda p212 -F1486680992.5114951 -sg35 -V4007 +g209 +sVlrt p213 -sg37 -V10.0 +F1486680992.5114956 +sVr p214 -sVmisc_u +V0-1000 p215 -VMCF +sVa p216 -sg41 -g42 -sVmrt +V4007 p217 -V60 +sVc p218 -sg45 -Vnone +V10.0 p219 -sVm1ch +sVmisc_u p220 -g191 -sg50 -VOn +VMCF p221 -sVmv +sVf p222 -g49 -sg53 -Vfloat +V4 p223 -sVvm +sVmrt p224 -NssV2-5 +V60 p225 -(dp226 -Vah +sVm +p226 +Vnone p227 +sVm1ch +p228 +g191 +sVs +p229 +VOn +p230 +sVmv +p231 +g196 +sVt +p232 +Vfloat +p233 +sVvm +p234 +NssV2-5 +p235 +(dp236 +Vah +p237 g14 sVbytary -p228 -NsVal -p229 -g49 -sVvn -p230 -VAccumulated Volume -p231 -sVct -p232 -Vnumber -p233 -sVle -p234 -V32 -p235 -sVgrp -p236 -V3600 -p237 -sVla p238 -F11.028 -sVchn +NsVal p239 -Vaccumulated_volume +g52 +sVvn p240 +VAccumulated Volume +p241 +sVct +p242 +Vnumber +p243 +sVle +p244 +V32 +p245 +sVgrp +p246 +V3600 +p247 +sVla +p248 +F452594.0 +sVchn +p249 +Vaccumulated_volume +p250 sg28 V0-1000000 -p241 -sVdn -p242 -Vabbflow -p243 -sVda -p244 -g33 -sVlrt -p245 -F1486684604.89034 -sg35 -V4009 -p246 -sg37 -V10 -p247 -sVmisc_u -p248 -VMCF -p249 -sg41 -g42 -sVmrt -p250 -V60 p251 -sg45 -Vnone -p252 -sVm1ch -p253 -g225 -sVmv -p254 -g49 -sg50 -VOn -p255 sVun +p252 +g31 +sVdn +p253 +Vabbflow +p254 +sVda +p255 +g31 +sVlrt p256 -g33 +F1495635175.5692881 +sg36 +V4009 +p257 +sg38 +V10 +p258 +sVmisc_u +p259 +VMCF +p260 +sg42 +g43 +sVmrt +p261 +V60 +p262 +sg46 +Vnone +p263 +sVm1ch +p264 +g235 +sg49 +VOn +p265 +sVmv +p266 +g52 sg53 Vfloat -p257 +p267 sVvm -p258 +p268 NssV2-8 -p259 -(dp260 +p269 +(dp270 Vah -p261 +p271 g14 sVbytary -p262 -NsVal -p263 -g49 -sVvn -p264 -VStatic Pressure -p265 -sVct -p266 -Vnumber -p267 -sVle -p268 -V32 -p269 -sVgrp -p270 -V3600 -p271 -sVla p272 -F33.138 -sVchn +NsVal p273 -Vstatic_pressure +g52 +sVvn p274 -sVun +VStatic Pressure p275 -g33 -sVdn +sVct p276 -Vabbflow +Vnumber p277 -sVda +sVle p278 -g33 -sVlrt +V32 p279 -F1486684605.811446 +sVgrp +p280 +V3600 +p281 +sVla +p282 +F37.38 +sVchn +p283 +Vstatic_pressure +p284 sg28 V0-250 -p280 -sg35 -V4015 -p281 -sg37 -g112 -sVmisc_u -p282 -VPSIA -p283 -sg41 -g42 -sVmrt -p284 -V60 p285 -sg45 -Vnone +sVdn p286 -sVm1ch +Vabbflow p287 -g259 -sg50 -VOn +sVda p288 -sVmv +g31 +sVlrt p289 -g49 +F1495633579.1359341 +sg36 +V4015 +p290 +sg38 +g113 +sVmisc_u +p291 +VPSIA +p292 +sg42 +g43 +sVmrt +p293 +V60 +p294 +sg46 +Vnone +p295 +sVm1ch +p296 +g269 +sVmv +p297 +g52 +sg49 +VOn +p298 +sVun +p299 +g31 sg53 Vfloat -p290 +p300 sVvm -p291 +p301 NssV2-9 -p292 -(dp293 +p302 +(dp303 Vah -p294 +p304 g14 sVbytary -p295 -NsVal -p296 -g49 -sVvn -p297 -VTemperature -p298 -sVct -p299 -Vnumber -p300 -sVle -p301 -V32 -p302 -sVgrp -p303 -V3600 -p304 -sVla p305 -F76.523 -sVchn +NsVal p306 -Vtemperature +g52 +sVvn p307 -sVun +VTemperature p308 -g33 -sVdn +sVct p309 -Vabbflow +Vnumber p310 -sVda +sVle p311 -g33 -sVlrt +V32 p312 -F1486684606.5676731 +sVgrp +p313 +V3600 +p314 +sVla +p315 +F76.686000000000012 +sVchn +p316 +Vtemperature +p317 sg28 V0-300 -p313 -sg35 -V4017 -p314 -sg37 -g112 -sVmisc_u -p315 -Vdeg F -p316 -sg41 -g42 -sVmrt -p317 -V60 p318 -sg45 -Vnone +sVdn p319 -sVm1ch +Vabbflow p320 -g292 -sg50 -VOn +sVda p321 -sVmv +g31 +sVlrt p322 -g49 +F1495635806.1392561 +sg36 +V4017 +p323 +sg38 +g113 +sVmisc_u +p324 +Vdeg F +p325 +sg42 +g43 +sVmrt +p326 +V60 +p327 +sg46 +Vnone +p328 +sVm1ch +p329 +g302 +sVmv +p330 +g52 +sg49 +VOn +p331 +sVun +p332 +g31 sg53 Vfloat -p323 +p333 sVvm -p324 +p334 NssV2-10 -p325 -(dp326 +p335 +(dp336 Vah -p327 +p337 g14 sVbytary -p328 +p338 NsVal -p329 +p339 g14 sVvn -p330 -VCharger Voltage -p331 -sVct -p332 -Vnumber -p333 -sVle -p334 -V32 -p335 -sVgrp -p336 -V3600 -p337 -sVla -p338 -g14 -sVchn -p339 -Vcharger_voltage p340 -sVun +VCharger Voltage p341 -g33 -sVdn +sVct p342 -Vabbflow +Vnumber p343 -sVda +sVle p344 -g33 -sVlrt +V32 p345 -g49 -sg35 -V4019 +sVgrp p346 -sg37 -g112 -sVmisc_u +V3600 p347 -g114 -sg41 -g42 -sVmrt +sVla p348 -V60 +F13.521 +sVchn p349 -sg45 -Vnone +Vcharger_voltage p350 -sVm1ch +sVun p351 -g325 -sVmv +g31 +sVdn p352 -g49 -sg50 -VOn +Vabbflow p353 +sVda +p354 +g31 +sVlrt +p355 +F1495633750.047971 sg28 V0-50 -p354 +p356 +sg36 +V4019 +p357 +sg38 +g113 +sVmisc_u +p358 +g115 +sg42 +g43 +sVmrt +p359 +V60 +p360 +sg46 +Vnone +p361 +sVm1ch +p362 +g335 +sg49 +VOn +p363 +sVmv +p364 +g52 sg53 Vfloat -p355 +p365 sVvm -p356 +p366 NssssS'f' -p357 +p367 VOff -p358 +p368 sS'p' -p359 +p369 g14 sS's' -p360 -g33 +p370 +g209 ssS'2' -p361 -(dp362 +p371 +(dp372 g3 VM1-232 -p363 +p373 sg5 V9600 -p364 +p374 sg7 -(dp365 -sg357 +(dp375 +sg367 VOff -p366 -sg359 +p376 +sg369 g14 -sg360 -g33 +sg370 +g209 ss. \ No newline at end of file