Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch for load output possible? #105

Open
snipah opened this issue Dec 18, 2022 · 13 comments
Open

Switch for load output possible? #105

snipah opened this issue Dec 18, 2022 · 13 comments

Comments

@snipah
Copy link

snipah commented Dec 18, 2022

As the load output is configurable/ switchable via the Victron App, I want to ask if this is achievable via MQTT as well? It would be great to have control over the load output via Home Assistant.

@syssi
Copy link
Collaborator

syssi commented Dec 18, 2022

This implementation uses the read-only ve.direct ASCII protocol right now. I assume we have to switch to the binary version to control the device.

@SeByDocKy
Copy link

This implementation uses the read-only ve.direct ASCII protocol right now. I assume we have to switch to the binary version to control the device.

And even the BLE version ;)

@Git-ChrisSc
Copy link

There is theoretical an other way:

By the Victron MPPT Charger you can configure that the RX pin is "binary".
if is there a voltage from 0V - Disable the Output, and Enable by 5V.

Now you can build in ESPHome a Switch-Component (or Relais?) to raise the voltage to 5V on the RX-Pin

@syssi
Copy link
Collaborator

syssi commented Jun 14, 2023

This sounds odd. If you pull-up the voltage at the RX pin you won't be able to receive data anymore. :-)

@syssi
Copy link
Collaborator

syssi commented Jun 14, 2023

Ah, I understand the concept now. The RX pin is the unused one in a read-only setup.

@Git-ChrisSc
Copy link

I can confirm, that this way is working.

If you put 5V on RX Pin and config RX for switching the Load-Output in the Bluetooth-App.

After this, you have to build a "switch-component" in ESPHOME

@syssi
Copy link
Collaborator

syssi commented Jun 16, 2023

Could you try to drive the load output using a GPIO with 3.3V TTL:

switch:
  - platform: gpio
    name: "${name} load output"
    pin:
      number: GPIO14
      mode:
        pulldown: true

@Git-ChrisSc
Copy link

Hi,

Oh, i can test it after my vacation - because my "Jerrycan-Battery" is actuall in use and allready solderd with iron.

But: Why with 3V? For stability (in longterm use) I use a cheap logic level converter, because i wouldn't use 5V on the ESP32 Pins.
https://www.amazon.de/gp/product/B07BZJ73LV/

i using not the TTL as Output, i have solderd a "Jumperbridge" on the platin for XOR.
grafik

On the HV-Side i solderd the VCC from Victron and on HG is the Victron GND connected.
H1 and H4 connected to RX und TX Pins on the Victron.

@syssi
Copy link
Collaborator

syssi commented Jun 21, 2023

Let's ignore the voltage level of the UART communication for now (off-topic). If we focus on "how to control the load output of a victron device using the RX pin" we have to apply some voltage to this pin. If we simply attach a GPIO to the RX pin the voltage level will be 3.3V because the ESP is a 3.3V device. The RX pin probably expects 5V here (on some victron devices). I would like to know the lower voltage level is sufficient to drive the load output.

@Git-ChrisSc
Copy link

Git-ChrisSc commented Jun 21, 2023

"UART communication for now (off-topic)"
I think that i get missunderstand, because my english isnt good. My intention wasn't to discuss about the voltaglevel by UART.

Some facts for the focus:
When i apply 3.3V on the RX Pin the Victron will switch the load output to on. (This i have just tested it, for 5 Minutes, was easier then i think and i have tested it in my vacation)

In the previous post, I only just wanted to warn that 5V is not a good idea for long-term use on the RX of the ESP, and that you could switch everything via a logic-level converter that doesn't just do TTL.

So the Answere of the question above is:

  1. You can switch the load output with an ESP(and ESPHome) and there is no need of this lib: But you have to config the Victron in the Right-Way **1.
  2. Switching the Load Output need no more additional Hardware: But for reading Victron it's safer to use a Logik-Level-Converter and now you can also use it for switching the Output with right 5V

**1 And as an additional Answer:
I use it and tested it in the Last 5 days. Every nigth.
In the App you have to configure

  1. under menue-point: Battery -> Operation-Mode: Always on
  2. under menue-point: RX port -> RX port function: Load output on/off normal
    .... i have NOT tested it with some other options as battery-safer or something else

** if it is of interest, i will present the project in a few words.

@syssi
Copy link
Collaborator

syssi commented Jun 21, 2023

It took some time to understand your idea. :-) Long story short: The TX channel of a (two channel) level shifter can be used to drive the load output using 5V.

@zechnkaas
Copy link

just a quick not from me:
i do have a 75/10 and a 75/15 in a setup with Rx pin set to "Load output on/off normal" and putting Rx to GND in the victron. This turns off the load on closed and turn back on after releasing the relais. (it takes a few seconds until the victron actually switches the load)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants