Giter VIP home page Giter VIP logo

Comments (11)

catalin2402 avatar catalin2402 commented on August 27, 2024 1

more precise: inverted signal on CF and CF1

from libretiny.

descipher avatar descipher commented on August 27, 2024

p24 = pin 16 on the BK7231N qfn32 which is virtually mapped to arduino D3 in libretuya.

from libretiny.

descipher avatar descipher commented on August 27, 2024

also p6 and p7 are not D0 and D1

cb2s.json

			},
			"13": {
				"IC": 24,
				"ARD": "D8"
			},
			"14": {
				"IC": 23,
				"ARD": "D9"

from libretiny.

kuba2k2 avatar kuba2k2 commented on August 27, 2024

There's no pin 34, so I believe this is a typo.

@descipher If you take a look at the docs here, you can see that D0 and D1 are indeed P6 and P7.

Since yesterday, you can actually use the P* pins directly in esphome config (make sure you have the latest commits for both esphome and LibreTuya).

from libretiny.

dj-fiorex avatar dj-fiorex commented on August 27, 2024

Sorry guys, i don't understand, is there an error in my config? Or this type of power meter is not supported?

Thanks

from libretiny.

kuba2k2 avatar kuba2k2 commented on August 27, 2024

This type of meter currently has some sort of problem. We're investigating it, and hopefully we'll find a solution in the coming days.

from libretiny.

dj-fiorex avatar dj-fiorex commented on August 27, 2024

ok @kuba2k2 thanks for the fast response, i could help of course, please give me some hints to where to look to fix

from libretiny.

kuba2k2 avatar kuba2k2 commented on August 27, 2024

You can try adding a basic pulse_counter component, and see if it reports anything:

sensor:
  - platform: pulse_counter
    pin:
      number: D0
      mode: input
    name: "D0 Pulse Counter"
    update_interval: 10s
  - platform: pulse_counter
    pin:
      number: D1
      mode: input
    name: "D1 Pulse Counter"
    update_interval: 10s

(adjust the pin numbers as needed)

from libretiny.

dj-fiorex avatar dj-fiorex commented on August 27, 2024

Tried with your suggests but i receive 0 pulses/min in the two pins, so i think the problem might be in pulse_counter also

from libretiny.

dj-fiorex avatar dj-fiorex commented on August 27, 2024

Thanks to the help of @catalin2402 i successfully read the current/voltage/power from that BL0937
I will post the updated yaml soon, the trick was to invert cf and cf1 pin

from libretiny.

dj-fiorex avatar dj-fiorex commented on August 27, 2024

Like promised this is the yaml

sensor:
  - platform: hlw8012
    model: BL0937  # note that the model must be specified to use special calculation parameters
    voltage_divider: 780  # adjust it according to the actual resistor values on board
    current_resistor: 0.00107
    update_interval: 10s
    sel_pin:
      number: P24
      inverted: true  # the logic of BL0937 is opposite from HLW8012
    cf_pin:
      number: P7
      inverted: true
      mode:
        input: true
        pulldown: true
    cf1_pin:
      number: P6
      inverted: true
      mode:
        input: true
        pulldown: true  
    current:
      name: 'Plug 1 Current'
    voltage:
      name: 'Plug 1 Voltage'
    power:
      name: 'Plug 1 Power'
    energy:
      name: 'Plug 1 Energy'
      # convert it to kWh
      filters:
        - multiply: 0.001
      unit_of_measurement: 'kWh'
      accuracy_decimals: 4

from libretiny.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.