Space Engineers

Space Engineers

67 ratings
Energieverbrauchsanzeige
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
108.773 KB
6 Jun, 2016 @ 12:37pm
8 Aug, 2022 @ 12:05pm
24 Change Notes ( view )

Subscribe to download
Energieverbrauchsanzeige

Description
This script calculates the current power usage and shows it on one or multiple lcd panels.

Features:
- Number of power producer, green power producer and batteries (can be disabled)
- Maximum power
- Current power use
- Green energy usage (if green energy is produced)
- Battery status and stored energy
- Switching reactors on or off depending on battery charge (has to be enabled)
- Custom language support
- Self updating (can be disabled)
- Shows data on lcd panels of programmable block (can be disabled)

Language:
The language is English by default but it can be easily changed by set the value useCustomLanguage in the section Settings in the upper part of the code to true. By default, the language is changed to german. However, it can be chosen any language by adapting the labels in the section Custom Language.

Setup:
1. Subscribe this script
2. Place a programmable block and access its control panel
3. Press "Edit" to open the code editor
4. Press "Browse Workshop" at the bottom of the code editor
5. Choose the script "Power Usage" and press "Ok"
6. Press "Check Code" (should have no errors) and then "Remember & Exit"
7. Run the programmable block
8. Place a lcd panel and edit the public title (See chapter Configure for details)

Configure:
To display the power usage on a given lcd panel, the public title of the lcd panel has to be changed in Power. Then, when the script is running the public text is adapted.
The script is able to update the screens by self. A timer block is not needed.

Command:
The command Power can be changed in upper part in the section Commands too.

Settings:
With the values in the section Settings in the upper part of the code (before the Main function) the behavior of the script can be changed.

The following can be set:
useCustomLanguage: use the custom language
showCount: show the number of the reactors, batteries and solar panels
controlReactors: switch on or off the reactors based on the battery charge
minBatteryLevel (in %): switch on the reactors if the battery level falls below this level
maxBatteryLevel (in %): switch off the reactors if the battery level rises above this level
showTextOnScreen: show the text automatically on the screens
useOwnScreens: show text and infos automatically on own screens (on programmable block)
setOwnScreenFontSize: set font size of own screens automatically (on programmable block)
selfUpdating: run the script periodic byself
restrictToOwnGrid: consider just own grid (eg. no docked ships)
65 Comments
giorgiobusoni 31 Aug, 2022 @ 5:45am 
Also, I run into problems when I use solar panels on rotor with script to align them, as they belong to a different grid. Turning the setting for considering only won grid to false does not solve issue, cause in that case I don't get right the time for battery discharging, as it then counts docked ships as well. Would be nice to be able to include power generators from other grids based on group or connection...
giorgiobusoni 31 Aug, 2022 @ 4:09am 
could you add switch on/off of hydrogen engines as well?
rubinknoepfel  [author] 8 Aug, 2022 @ 12:09pm 
With the new version, I hope I can learn more about the problem. Please send me the new error output.
scorpio130386 25 Jul, 2022 @ 5:32am 
same probleme like Kaos...
--Kaos-- 25 Aug, 2021 @ 11:12am 
@rubinknoepfel Hi matey, I just downloaded the script to my base, checked code, and then the error appears in UI menu of the prog block. I have a few scripts on but ive turned all of them off... recompiled n still the same error ... i have a few mods too but nothing power related
rubinknoepfel  [author] 24 Aug, 2021 @ 2:08pm 
@--Kaos-- Seems to work at me. Can you describe your setup a little bit more? Do you have any mods installed? Do you have other scripts in use?
--Kaos-- 20 Aug, 2021 @ 11:20am 
doesnt work

caught exception during execution of script : object reference not set to and instance of an object at program...cTor()
dragonsphotoworks 24 May, 2021 @ 6:10pm 
Ah ok thank you for reply.
rubinknoepfel  [author] 20 May, 2021 @ 9:43am 
@dragonsphotoworks this ist currently not possible...
AL 9 May, 2021 @ 5:17am 
Hallo rubinknoepfel,
Ich konnte endlich testen. Nach meiner Einschätzung funktioniert die eingebaute Einschränkung genauso, wie ich sie mir gewünscht habe.
Wenn ein Miner andockt und die Batterien der Basis leersaugt, springt der Wasserstoffmotor an, sobald die Batterien der Basis unter den eingestellten Wert fallen - und nicht erst, wenn der Miner mit vollen Batterien wieder abfliegt.

Vielen vielen Dank!
Gruß AL