module
0.0.0-20240818183358-2ecf27686e20
Repository: https://github.com/alex11prog/ups-imitator.git
Documentation: pkg.go.dev
# README
Ups-imitator
Simulates the operation of UPS, calculates and loads current parameter values into it via Modbus
Intended for testing the monitoring system
Work scheme
In this work was used mock ups controller
Operating modes
-
Auto
Work in cycle:- q0 — The electrical network is connected, the battery is charged;
- q1 — The electrical network is turned off, the battery is discharging;
- q2 — The electrical network is turned off, the battery is discharged;
- q3 — The electrical network is connected, the battery is charging.
-
Manual
Manually changing parameters via rest api
Swagger documentation
Getting started
-
Prepare config
example:ups_addr = "127.0.0.1:1502" rest_api_bind_addr = ":8080" ups_sync_interval = 30 # sec cycle_change_timeout = 3600 # sec default_input_ac_voltage = 220 # V max_bat_group_voltage = 54 # V min_bat_group_voltage = 42 # V load_power = 1000 # W default_bat_capacity = 50 # Ah charge_current_limit = 20 # A low_soc_trigger_alarm = 0.1 # from 0 to 1, 1: 100%
-
Build
make
-
Run
./bin/ups-imitator
Testing
make test
Results of work in auto mode
- Launch mock ups controller;
- Launch ups-imitator (pre-specify the mock-ups address in the config);
- Launch ups-agent to read data from the UPS.
Result of loop in grafana
Graph with marked transitions of automatic mode states