"address": 32,
"interrupt pin": 4,
"pins":
- [ [ "E1-1", "T1-18", "Schwungrad" ], [ "E1-2", "T1-19", "Takt" ],
- [ "E1-3", "T1-20", "Öldruck" ], [ "E1-4", "T1-21", "Bruchplatte" ],
- [ "E1-5", "T1-22", "Bruchplatte Einzug" ], [ "E1-6", "T1-23" ],
- [ "E1-7", "T1-24" ], [ "E1-8", "T1-25" ] ] },
+ [ [ "E1-1", "T1-18" ], [ "E1-2", "T1-19" ],
+ [ "E1-3", "T1-20" ], [ "E1-4", "T1-21" ],
+ [ "E1-5", "T1-22" ], [ "E1-6", "T1-23" ],
+ [ "E1-7", "T1-24" ], [ "E1-8", "T1-25", "Schwungrad" ] ] },
{ "name": "E2",
"type": "input",
"address": 33,
"pins":
[ [ "E2-1", "T1-26" ], [ "E2-2", "T1-27" ],
[ "E2-3", "T1-28" ], [ "E2-4", "T1-29" ],
- [ "E2-5", "T1-30" ], [ "E2-6", "T1-31" ],
- [ "E2-7", "T1-32" ], [ "E2-8", "T1-33" ] ] },
+ [ "E2-5", "T1-30", "Takt" ], [ "E2-6", "T1-31", "Öldruck" ],
+ [ "E2-7", "T1-32", "Bruchplatte" ], [ "E2-8", "T1-33", "Bruchplatte Einzug" ] ] },
{ "name": "E3",
"type": "input",
"address": 34,
"interrupt pin": 27,
"pins":
[ [ "E3-1", "T2-1" ], [ "E3-2", "T2-2", "Notaus" ],
- [ "E3-3", "T2-3", "Stop" ], [ "E3-4", "T2-4", "Dauerlauf" ],
+ [ "E3-3", "T2-3", "Stop" ], [ "E3-4", "T2-4", "Tippen" ],
[ "E3-5", "T2-5", "Schmierung" ], [ "E3-6", "T2-6", "Vorlauf" ],
[ "E3-7", "T2-7", "Rücklauf" ], [ "E3-8", "T2-8" ] ] },
{ "name": "E4",
# AA115 = 01, 14-43
await self.__protocol.write_register(12015, 1)
# AC120 = 0.5 s, 14-44
- await self.__protocol.write_register(12220, 0.5)
+ await self.__protocol.write_register(12220, 1)
# bA122 = 02, 14-53
await self.__protocol.write_register(13022, 2)
- # bA123 = 35 A, 14-53
- await self.__protocol.write_register(13023, 35)
+ # bA123 = 50 A, 14-53
+ await self.__protocol.write_register(13023, 50)
# bA124 = 5 s, 14-53
await self.__protocol.write_register(13024, 5)
# Cb40 = 01, 14-58
await self.__protocol.write_register(15102, 11)
# Hb103 = 4, 14-64
await self.__protocol.write_register(15103, 4)
- # bA124 = 22.5A Motorschutz ???
+ # bC110 = 22.5A Motorschutz ???
async def set_frequency(self, frequency: int) -> None:
# Page 532 / 14-41
'conf': {
'min': 0,
'max': 23,
+ 'unit': '',
'scale': 1,
},
},
for pin_name in pin_names:
pins[pin_name] = pin
pin.on('change', callback_factory(pin_name))
+ pins['T1-1'].value = True
fu = None
if 'modbus' in conf:
modbus_conf = conf['modbus']
'settable': pin.settable, 'value': pin.value,
'changed': False})
elif command['command'] == 'setparameters':
- await fu.set_parameters()
+ pass
+ #await fu.set_parameters()
elif command['command'] == 'setfrequency':
await fu.set_frequency(command['value'])
elif command['command'] == 'getfrequency':
event = await queue.get()
message = json.dumps(event)
await websocket.send(message)
- if event['event'] == 'pinstate' and event['changed']:
+ if event['event'] == 'pinstate':
okay = ( pins['Zentralschmierung'].value and
pins['Ölpumpe'].value and
pins['Schwungrad'].value and
active = await fu.inverter_active
if active:
await fu.stop_inverter()
- if event['value']:
+ if event['changed'] and event['value']:
if event['pin'] == 'Notaus':
await fu.stop_inverter()
pins['Zentralschmierung'].value = False
pins['Ölpumpe'].value = False
elif event['pin'] == 'Stop':
await fu.stop_inverter()
- pins['Zentralschmierung'].value = False
- pins['Ölpumpe'].value = False
elif event['pin'] == 'Schmierung':
pins['Zentralschmierung'].value = True
pins['Ölpumpe'].value = True
elif event['pin'] == 'Vorlauf':
- if not pins['Dauerlauf'].value:
- await fu.set_parameters()
- await fu.set_frequency(5)
- await fu.start_inverter()
- await asyncio.sleep(1)
- await fu.stop_inverter()
- else:
- await fu.set_parameters()
- await fu.set_frequency(20)
- await fu.start_inverter()
+ if pins['Öllampe'].value:
+ if pins['Tippen'].value:
+ #await fu.set_parameters()
+ await fu.set_frequency(25)
+ await fu.start_inverter()
+ await asyncio.sleep(1)
+ await fu.stop_inverter()
+ else:
+ #await fu.set_parameters()
+ await fu.set_frequency(50)
+ await fu.start_inverter()
elif event['pin'] == 'Rücklauf':
- if not pins['Dauerlauf'].value:
- await fu.set_parameters()
- await fu.set_frequency(-5)
- await fu.start_inverter()
- await asyncio.sleep(1)
- await fu.stop_inverter()
+ if pins['Öllampe'].value:
+ if pins['Tippen'].value:
+ #await fu.set_parameters()
+ await fu.set_frequency(-25)
+ await fu.start_inverter()
+ await asyncio.sleep(1)
+ await fu.stop_inverter()
queue.task_done()
ws.addEventListener('open', function (event) {
ws.send(JSON.stringify({command: 'getpin', pin: 'Notaus'}))
ws.send(JSON.stringify({command: 'getpin', pin: 'Stop'}))
- ws.send(JSON.stringify({command: 'getpin', pin: 'Dauerlauf'}))
+ ws.send(JSON.stringify({command: 'getpin', pin: 'Tippen'}))
ws.send(JSON.stringify({command: 'getpin', pin: 'Schmierung'}))
ws.send(JSON.stringify({command: 'getpin', pin: 'Vorlauf'}))
ws.send(JSON.stringify({command: 'getpin', pin: 'Rücklauf'}))
ws.send(JSON.stringify({command: 'getpin', pin: 'Bruchplatte'}))
ws.send(JSON.stringify({command: 'getpin', pin: 'Bruchplatte Einzug'}))
})
- var parameter_button = document.getElementById('setparameters')
- parameter_button.addEventListener('click', function (event) {
- ws.send(JSON.stringify({command: 'setparameters'}))
- })
</script>
<h1>ControlPi</h1>
<section>
<h2>Kontrollfeld</h2>
<div id="Notaus">Notaus</div>
<div id="Stop">Stop</div>
- <div id="Dauerlauf">Dauerlauf</div>
+ <div id="Tippen">Tippen</div>
<div id="Schmierung">Schmierung</div>
<div id="Vorlauf">Vorlauf</div>
<div id="Rücklauf">Rücklauf</div>
<div id="Bruchplatte">Bruchplatte</div>
<div id="Bruchplatte Einzug">Bruchplatte Einzug</div>
</section>
- <section>
- <h2>FU</h2>
- <button id="setparameters">Set Parameters</button>
- </section>
</body>
</html>