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

t102-v1.1 PA15 pin issues #288

Open
voed opened this issue Jun 22, 2024 · 0 comments
Open

t102-v1.1 PA15 pin issues #288

voed opened this issue Jun 22, 2024 · 0 comments

Comments

@voed
Copy link

voed commented Jun 22, 2024

Hi. I have a generic smart socket with energy monitor based on t102 board. It has connected BL0937's SEL pin to PA15, so according to #155, i am used version: 1.6.0 to avoid the bootlop. But looks like the pin just does not work anymore, i have created the gpio switch to manually switch between voltage and current and it is still reports the same values. After changing to board: wr2, it worked:

[14:12:23][D][sensor:093]: 'rtlsocket_voltage': Sending state 0.43395 V with 1 decimals of accuracy
[14:12:23][D][sensor:093]: 'rtlsocket_power': Sending state 2.02600 W with 1 decimals of accuracy
[14:12:23][D][sensor:093]: 'rtlsocket_energy': Sending state 0.47667 Wh with 1 decimals of accuracy
[14:12:26][D][hlw8012:082]: Got power=2.7W, voltage=0.4V
[14:12:26][D][sensor:093]: 'rtlsocket_voltage': Sending state 0.37196 V with 1 decimals of accuracy
[14:12:26][D][sensor:093]: 'rtlsocket_power': Sending state 2.70133 W with 1 decimals of accuracy
[14:12:26][D][sensor:093]: 'rtlsocket_energy': Sending state 0.47892 Wh with 1 decimals of accuracy
[14:12:26][D][switch:012]: 'rtlsocket_sel_switch' Turning ON.
[14:12:26][D][switch:055]: 'rtlsocket_sel_switch': Sending state ON
[14:12:29][D][hlw8012:082]: Got power=2.7W, voltage=327.1V
[14:12:29][D][sensor:093]: 'rtlsocket_voltage': Sending state 327.07501 V with 1 decimals of accuracy
[14:12:29][D][sensor:093]: 'rtlsocket_power': Sending state 2.70133 W with 1 decimals of accuracy
[14:12:29][D][sensor:093]: 'rtlsocket_energy': Sending state 0.48117 Wh with 1 decimals of accuracy
[14:12:32][D][sensor:093]: 'rtlsocket_power': Sending state 2.70133 W with 1 decimals of accuracy
[14:12:32][D][sensor:093]: 'rtlsocket_energy': Sending state 0.48343 Wh with 1 decimals of accuracy

Don't mind the values, it is still uncalibrated, but at least now i can calibrate.
So looks like the last commit just prevents 15 pin from changing the state for t102.

Full configuration:

rtl87xx:
  board: wr2
  framework: 
    version: 1.6.0
switch:
    - platform: gpio
      pin: 0
      name: ${hostname}_switch
      id: ${hostname}_switch
      restore_mode: ALWAYS_OFF
      device_class: outlet
    - platform: gpio
      pin:
        number: 15
        allow_other_uses: true
      name: ${hostname}_sel_switch
      id: ${hostname}_ssel_switch
      restore_mode: ALWAYS_OFF
binary_sensor:
    - platform: gpio
      pin:
        number: 18
        mode: INPUT_PULLUP
        inverted: true
      name: ${hostname}_button
      on_release: 
        - switch.toggle: ${hostname}_switch


status_led:
  pin: 
    number: 23
    inverted: true

sensor:
  - platform: hlw8012
    model: BL0937
    sel_pin:
        number: PA15
        allow_other_uses: true
        #inverted: true


    cf_pin: #D1 #4
      number: PA5


    cf1_pin: #D0 #5
      number: PA12

    current:
      name: ${hostname}_current
    voltage:
      name: ${hostname}_voltage
    power:
      name: ${hostname}_power
    energy:
      name: ${hostname}_energy
    #voltage_divider: 860
    current_resistor: 0.001
    
    update_interval: 3s
    #initial_mode: CURRENT
    change_mode_every: 8
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

1 participant