syssi / esphome-solax-x1-mini

ESPHome component to monitor a Solax X1 mini via RS485
Apache License 2.0
39 stars 11 forks source link

Feature Request: Override Switch for Export Control #61

Closed syssi closed 8 months ago

syssi commented 9 months ago

Discussed in https://github.com/syssi/esphome-solax-x1-mini/discussions/60

Originally posted by **Sven177** December 8, 2023 Having an Override Switch for the Meter Gateway, to toggle between either listening to an existing sensor´s value to determine the current power demand, or using a fixed value (like 500W) would be nice. This would allow to "disable" the export control function on the Meter Gateway side whenever needed, while leaving the actual export control function of the Inverter (and according settings) still active and untouched. (Hope this is the right way for a Feature Request - first time for me) 😉
syssi commented 8 months ago

@Sven177 The feature is ready. Do you like to give it a try?

Sven177 commented 8 months ago

Awesome, thanks! I´ll give it a try... 👍

Sven177 commented 8 months ago

Was trying to use that manual switches in the ESP32 multiple UART code, but it throws me that one when adding that underneath the emergency off switches:

_[manual_mode] is an invalid option for [switch.solax_metergateway]. Please check the indentation.

Am I missing something?

Here the according section:

switch:
  - platform: solax_meter_gateway
    solax_meter_gateway_id: solax_meter_gateway0
    emergency_power_off:
      name: "${device0} emergency power off"
      restore_mode: RESTORE_DEFAULT_OFF
    manual_mode:
      name: "${device0} manual mode"
      restore_mode: RESTORE_DEFAULT_OFF

  - platform: solax_meter_gateway
    solax_meter_gateway_id: solax_meter_gateway1
    emergency_power_off:
      name: "${device1} emergency power off"
      restore_mode: RESTORE_DEFAULT_OFF
    manual_mode:
      name: "${device1} manual mode"
      restore_mode: RESTORE_DEFAULT_OFF

number:
  - platform: solax_meter_gateway
    solax_meter_gateway_id: solax_meter_gateway0
    manual_power_demand:
      name: "${device0} manual power demand"
  - platform: solax_meter_gateway
    solax_meter_gateway_id: solax_meter_gateway1
    manual_power_demand:
      name: "${device1} manual power demand"
syssi commented 8 months ago

The new feature isn't merged into the main branch yet. Did you change the external component section to the feature branch?

Sven177 commented 8 months ago

Ah, no. That is still @main. So change that as well?

OK - changed to the feature branch, saved and validated the yaml file - now it´s error free. Cool - will move on and test it... 👍

Sven177 commented 8 months ago

Awesome! Both switches and both Numeric Input Fields show up as entities already. Will test tomorrow, when Inverter(s) are up and running, and will report (but looking fine so far) :-)

Sven177 commented 8 months ago

Seems working. 👍 Had one Meter Fault as operation mode from the gateway, after switching back from manual to auto-mode, but couldn´t reproduce it yet when switching modes...

syssi commented 8 months ago

The short meter fault while turning off the manual mode is fine (and harmless) because the implementation does need a cycle to pick up the measurement of your smart meter and make it available as valid power demand.

syssi commented 8 months ago

I've prepared a new release. You should switch back to the @main branch again.