syssi / esphome-apc-ups

ESPHome component to monitor and control a APC UPS via RS232
Apache License 2.0
30 stars 6 forks source link

Switch entities doesn't work as expected #12

Closed ananyevgv closed 1 week ago

ananyevgv commented 4 months ago

The switches are working?

src/main.cpp: In function 'void setup()': src/main.cpp:3062:9: error: 'class esphome::apc_ups::ApcUps' has no member named 'set_quick_test_switch' ups0->set_quick_test_switch(apc_ups_apcupsswitch);

ananyevgv commented 1 month ago
Hello friend, I did not find such tests in the description of the protocol. If I understood correctly, it meant:

beeper:  Front panel test
quick_test: Self test
deep_test: Runtime calibration
ten_minutes_test: Simulate power failure 
samoswall commented 1 month ago

Hello friend! I can't use the switch. Problems:

  1. The switch gets into the general command queue. It is triggered in every cycle. How do I exclude all switches from the general command queue? 01 07 24_14 24 05 This is not right.
  2. The switch works correctly, instantly sends a command. But it gives an error. 01 07 24_14 32 21 But the switch does not turn off when the answer is OK. I made changes, but it didn't change the action.
    TYPES = {
    CONF_BEEPER: ("A", "OK"),
    CONF_QUICK_TEST: ("T", "CT"),
    CONF_DEEP_TEST: ("TL", "CT"),
    CONF_TEN_MINUTES_TEST: ("T10", "CT"),
    }

    For more details, see my fork.

syssi commented 3 weeks ago

@samoswall Do you like to contribute your improvements? :-)

samoswall commented 3 weeks ago

@syssi Yes. I have improved your project. Fixed switches. They're working now. When power is lost or restored, an external command (Q-status flag) is sent to update the status (on_line and on_battery) Now I am adding a command to record the date of battery replacement in ups. I'm going to do a PR now.

syssi commented 3 weeks ago

Awesome job!

samoswall commented 3 weeks ago

@syssi I will finish the snmp component for your project in a few days. Maybe they should be combined together?

syssi commented 3 weeks ago

We could mention your SNMP component at the README if you like. I would like to keep this project as simple as possible. :-)

syssi commented 1 week ago

I've merged your improvements to main. Thanks for your great work!