logo elektroda
logo elektroda
X
logo elektroda

Connecting ORNO OR-WE-516 Three-phase Meter to Home Assistant via WiFi

maratoczyk 5181 23
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #1 19383033
    maratoczyk
    Level 3  
    Hi
    I have an ORNO meter that I would like to connect to the HA.
    The meter is in the garage I do not have the possibility to connect to it by wire.
    meter-> rs-485 -> wifi -> Homeassistant
    Is it possible, maybe someone has done this before?
    I've looked on the internet but can't seem to find my way around, I'm a bit green on the subject .

    Orno user manual
    https://files.orno.pl/manuals/OR-WE-516_manual_PL.pdf
  • ADVERTISEMENT
  • Helpful post
    #2 19383494
    xury
    Automation specialist
    You might be tempted to make an rs485 bridge, e.g. on an esp32
  • ADVERTISEMENT
  • ADVERTISEMENT
  • #5 19391389
    Anonymous
    Level 1  
  • #6 19391672
    starob
    Level 29  
    maratoczyk wrote:
    I found this wonder
    .
    1. you will need this miracle to make an RS485>TCP (wifi) bridge.
    E.g. like this: https://github.com/emelianov/modbus-esp8266
    2. you will need to know the addresses and functions of the counter registers.
    3. configuration of the Home Assistants :https://www.home-assistant.io/integrations/modbus/

    In addition some knowledge and patience will be needed.

    Ps. i would not make a bridge but buy a ready made one for similar money - Elfin-EW11
    https://www.gotronik.pl/ has it on offer but expensive
  • #7 19724299
    emes30
    Level 2  
    Old topic, but if anyone is interested, I can describe how to connect this meter to Home Assistant using Wemos modules RS485->TTL converter, ESPhome software.
  • #8 19735021
    piterek-23
    Level 33  
    emes30 wrote:
    if anyone is interested, I can describe how to connect this meter to a Home Assistant using Wemos modules + RS485->TTTL converter, ESPhome software.
    .
    I would be interested to know :) .
  • #9 19735825
    emes30
    Level 2  
    For operation we need the WeMos module and any RS485<->TTL converter.
    The converter has on one side A and B connectors for data transmission, and on the
    TTL 3 pins: DI, RO, RE.
    RS485 - WeMos
    DI <- TX data in
    RO -> RX read out
    RE <- D5 third pin is responsible for controlling the transmission direction, in some cases
    it is not necessary to connect it, in my case it did not work without it.

    RS485 is connected via twisted pair A<->A B<->B

    And as far as the connection is concerned that's all, I had more problems with configuring the esphome.
    Only debugging the transmission had any effect. ESPhome did not want me to decode correctly
    float values, so I wrote a function that reads these values correctly.
    The whole thing consists of three files.

    modbus_func.h
    Code: C / C++
    Log in, to see the code
    .

    common configuration for all my devices

    .common.yaml
    
    esphome:
        name: $node_name
        platform: ESP8266
        board: $board
        build_path: ./build/${node_name}
    
    wifi:
        networks:
            - ssid: ***
              password: ***
            - ssid: ***
              password: ***
        ap:
            ssid: $node_name
            password: ***
    
    captive_portal:
    
    logger:
        baud_rate: 0
    
    api:
    
    ota:
    
    sensor:
        - platform: wifi_signal
          name: "WIFI $device_verbose_name"
          update_interval: 60s
    text_sensor:
        - platform: wifi_info
          ip_address:
            name: $node_name ip
          mac_address:
            name: $node_name mac
    
    switch:
        - platform: restart
          name: "$device_verbose_name Restart"
    
    
    .

    and the actual configuration of energy_meter_main.yaml attached
    energy_met...r_main.zip Download (1.4 kB) .
  • #10 20390178
    cycu-87
    Level 11  
    Will the configuration files fit under the Orno meter model OR-WE-520?
  • #11 20580731
    Darek.S
    Level 34  
    I am embracing the topic of connecting the ORNO 516 to the Raspberry Pi and there is a problem. There is no communication. On the A/B terminals I have a voltage of 3.5V when the interface is not connected. After connecting the interface the voltage is only 0,036V. When I measure the resistance between terminals A B on the interface it is only 120Ω.
    The interface is a USB Serial CH341A. A friend who has a twin sysem and programmed my tiny has a slightly different interface, probably CH340. Maybe this is the problem?

    Added after 8 [hours] 29 [minutes]: .

    Darek.S wrote:
    bodies CH340
    .
    Sorry HL-340 and there is a different chipset. Its interface is 47kOm. But I checked on another one on Max485 and there it is also 120. Just to be sure, I removed this resistor in my CH-341 and the voltages are already like my colleague's. It remains to get the HL-340 interface....
  • #12 20582502
    starob
    Level 29  
    Darek.S wrote:
    on the interface it is only 120Ω.


    Which is exactly what it should be :) .
    As for voltages and where 120ohm comes from I would suggest starting at
    https://ntronic.pl/rs-485/
    The USB chipset has nothing to do with the transmission side of RS485. If the converter is seen by the system as COM then there is nothing further to dabble in that direction. The important thing is the RS(ttl) <> RS485 converter, which as a second must sit in such a device. But he is "transparent" and works or not. What do you mean when you write "HL-340"?
  • #13 20582550
    Darek.S
    Level 34  
    Yes 120Ω is the recommended value and probably transmission over RS485 is taking place.
    However, at a colleague's interface I had an AB voltage of about 5V and a resistance of 47k
    After removing this resistor, 3.3V appeared on mine but I still had "Time out" in the logs
    starob wrote:
    What do you mean when you write "HL-340"?
    .
    Different chipset. The facts are that both mine and my colleague's have exactly the same driver but his works and mine does not. I quote his reply:
    "Yours is 1a86:5523 QinHeng Electronics CH341 in serial mode, usb to serial port converter

    My 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter"

    This is what mine looks like
    Connecting ORNO OR-WE-516 Three-phase Meter to Home Assistant via WiFi .
    Both myself and a colleague bought from the same shop and they are sold as RS 485 to USB converters. Nowhere is it stated that they can be on different chipsets. The colleague stated that he must have been lucky to come across one that worked. He tried to run mine on a different driver, but without success.
    The problem seems to be on the parity check side.
    When writing the script for RaspberryPi a colleague was helped a lot by this thread Link .
    It shows that communication over RS-485 with Orno is badly screwed up.
    And the HL-340 chipset somehow manages it and my CH-341 no longer does.
  • #14 20582563
    starob
    Level 29  
    In the system it is seen correctly as COM3 and physically this chip converts from USB to SerialTTL.
    There is a second SerialTTL to RS485 converter inside (e.g. MAX485 or other) and it is rather the one you have a problem with.
    Whatever you would do with the drivers you have no influence on it (it is unprogrammable) - as I wrote: it works or not.
    It could be faulty or something wrong with the connections.
    Take a friend's borrowed second one, clip them on each other over RS485 and send an "echo" from COM to COM in a loop. Then you will be sure if it is operational and where to look next.
    Obviously you don't have an oscilloscope?
  • #15 20582662
    Darek.S
    Level 34  
    starob wrote:
    In the system it is seen correctly as COM3
    .
    Darek.S wrote:
    This is my
    .
    I forgot , that in the computer under Windows10. and there it will not work only in RasperryPi2. A colleague has an identical system ( admittedly Rasperrypi3 but it should not matter ) and my converter in him did not work. "
    starob wrote:
    In the system it is seen correctly as COM3
    .
    Darek.S wrote:
    This is my
    .
    I forgot , that in the computer under Windows10. And there it will not work only in RasperryPi2. A colleague has an identical system ( admittedly Rasperrypi3 but it should not matter) and my converter in him did not work.
    I.e. from the RasperryPi side it is visible but it does not communicate with Orno. The message "Timeout"
    starob wrote:
    Of course you don't have an oscilloscope?
    .
    Connecting ORNO OR-WE-516 Three-phase Meter to Home Assistant via WiFi .

    ... but I don't know how to operate ;) .
  • ADVERTISEMENT
  • #16 20582714
    starob
    Level 29  
    Raspberry you say ... this changes the form :) .
    The key is to start by establishing if the converters are working, so trying to send anything windows and checking with an oscilloscope what comes out over RS485 with a 120ohm load. Trying on two converters would be better because you can check the transfer in two directions.
    Then a similar thing can be done on Pi<>Windows.
    Only when success is achieved in this simple trial would I start to think about running the meter.
    At the moment you have too many unknowns to solve the equation.
    For good measure, you can check the communication with the counter even under windows. The counter communicates via modbus RTU, so under windosewm you can read it with a simple program called "Modbus master simulator".
  • #17 20582760
    Darek.S
    Level 34  
    starob wrote:
    At the moment, you have too many unknowns to solve the equation
    .
    This is how I know it . As many unknowns as many independent equations are needed. One thing is certain. A colleague has a working system on an HL-340 converter and he has programmed my "little one" under his converter. The drivers under his HL and my CH identical.
  • #18 20582771
    starob
    Level 29  
    You have everything at your fingertips ... swap his converter your little one and vice versa.
    If you don't try it and draw a conclusion as to the direction to look for the fault then no one on the forum will find it.
    All in all I have run out of ideas as to what else I could advise.
  • #19 20582884
    Darek.S
    Level 34  
    Well the easiest thing to do would be to just buy an HL-340. The swaps were done yesterday. His HL works mine does not.
    michcior wrote:
    The second issue. Communication over RS485 is a mystery in itself. It turns out that the FIFO concept is alien to the designers of this venerable counter. If you don't give a pause somewhere 5ms between characters, there won't be any communication! This is some absurdity, on 9600 a character is sent about 0.9ms and a pause of 5ms?!
    .
    - This is a quote from the link , which I posted above. It may be possible to fit my CH but in a situation where they cost a dozen £ it makes absolutely no sense.
    starob wrote:
    It may be faulty
    .
    I can't rule that out either although new....
    By the way thanks for the link about the RS845. will read.
  • #20 20583029
    starob
    Level 29  
    I don't know who is wrong, is @michcior with his measurements or the manufacturer? ;) .
    According to the documentation the meter complies with the Modbus standard and I have not found any other info to the contrary.
    If you look at the modbus timing then a 5ms interval is quite likely.
  • #21 20583053
    Darek.S
    Level 34  
    starob wrote:
    I don't know who is wrong,
    .
    It is difficult for me to decide here. I am not a programmer. I have only written a few programs in my life and that in Fortran and assembler but that was 30 years ago. It was for this reason that a friend, who is a computer scientist, programmed the Raspberry. He has had the system for two years. I've had just as much time as he has with photovoltaics and I've been thinking about these measurements for a long time. I'm still waiting for the LH to arrive.
  • #22 20586456
    Darek.S
    Level 34  
    starob wrote:
    There is a second SerialTTL to RS485 converter sitting inside (e.g. MAX485 or other) and it is more likely to be the one you have a problem with.
    .
    This is exactly the case
    Connecting ORNO OR-WE-516 Three-phase Meter to Home Assistant via WiFi .
    It is difficult to say whether the Max485 or the CH551G is underperforming in this CH-341. The fact is that as a whole it does not work. Yesterday the HL-340 arrived and with it there is no longer a problem.
  • #23 20586586
    starob
    Level 29  
    Worth fixing if it's a max485 problem - especially as you have an oscilloscope.
    Those extra pins are probably serial Rx,Tx? Then you could use it as a converter to USB<>TTL.
  • #24 20586596
    Darek.S
    Level 34  
    starob wrote:
    Worth fixing if it's a problem with max485
    .
    I will keep in mind. I have some converter from TTL to USB on PLI2003 bought for programming my Bafang. i also have RS485 to TTL converter bought in monsterelekktronik. But i will play with it in my free time. . One always some professional development two another converter can always be useful. Sometimes you need to log something.

Topic summary

The discussion revolves around connecting the ORNO OR-WE-516 three-phase meter to Home Assistant (HA) via WiFi, utilizing an RS-485 to WiFi bridge. Users suggest using microcontrollers like ESP32 or Raspberry Pi to decode RS-485 signals and communicate with HA. Various solutions are proposed, including using specific converters like MAX485 and ready-made WiFi modules such as Elfin-EW11. Configuration details for Home Assistant's Modbus integration are shared, along with troubleshooting tips for communication issues between the meter and the Raspberry Pi. Users also discuss the importance of ensuring proper voltage levels and resistance in RS-485 connections, as well as the potential need for different USB to RS-485 converters.
Summary generated by the language model.
ADVERTISEMENT