Elektroda.com
Elektroda.com
X
  • First post, hope this is useful, see topic here also as ByteMangler added some i2c info

    https://github.com/openshwprojects/OpenBK7231T_App/issues/584

    Unit is from Bunnings here in Aus, has power monitoring and temp/humidity, more on that later, first some pics:

    https://grid-connect.com.au/smart-home-products/climate/

    Arlec PCTH01HA - Bunnings - CB3S BK7231N

    Arlec PCTH01HA - Bunnings - CB3S BK7231N

    Seems to be welded shut mainly in corners, few bashes with rubber mallet (ok gentle whacks!) and spudger and case came open, no damage, just go easy is my input

    Board and chips:

    Arlec PCTH01HA - Bunnings - CB3S BK7231N Arlec PCTH01HA - Bunnings - CB3S BK7231N Arlec PCTH01HA - Bunnings - CB3S BK7231N Arlec PCTH01HA - Bunnings - CB3S BK7231N

    In terms of flashing, tried a few times with windows version before reading comments that for the N version, python is the better way.

    Loaded up ras pi with spare sd card, raspbian lite installed and using python method, worked straight away. No desoldering any chips needed, just directly soldered jumpers to the chip vcc, gnd, rx and tx - all to cheap generic usb to serial dongle.

    My command was this, renamed the downloaded firmware to file.bin for easier typing:

    sudo python3 uartprogram /home/pi/file.bin --unprotect --startaddr 0x0 -d /dev/ttyUSB0 -w

    That's it, bang straight away it came up with open access point, added wifi credentials, up and running in web ui, fantastic!

    P8 Relay
    P7 Button_n
    P6 LED
    P9 SCL
    P14 SDA

    P26 BL0937 CF1
    P24 BL0937 CF
    ADC3 BL0937SEL

    Linked up to HA via mqtt and works great for relay and power readings from 937 chip.

    Outstanding is only the i2c CHT8305 chip data to get linked up for temp/hum

    See the above github link for more chatter or any posts after this.

    Edit: The temp/hum sensor sits in a nice, somewhat isolated compartment so it might be useful!..

    Arlec PCTH01HA - Bunnings - CB3S BK7231N

    Hope this helps, thanks to the OpenBk team :)

    Cool? Ranking DIY
    About Author
    359r
    Level 2  
    Offline 
    359r wrote 2 posts with rating 1. Been with us since 2022 year.
  • #2
    p.kaczmarek2
    Moderator Smart Home
    Nice, I didn't even know there such kinds of devices. This is also interesting:
    359r wrote:

    P9 SCL
    P14 SDA

    BK7231 has two hardware I2C ports and they are already working in OpenBeken.
    I2C1 is P20/P21:
    Arlec PCTH01HA - Bunnings - CB3S BK7231N
    I2C2 is P0/P1:
    Arlec PCTH01HA - Bunnings - CB3S BK7231N

    Arlec PCTH01HA - Bunnings - CB3S BK7231N

    P9 is not a hardware I2C..
    Arlec PCTH01HA - Bunnings - CB3S BK7231N

    That means we need a software I2C... of course assuming that the target chip is using a non-modified I2C protocol... I will check this soon
  • #3
    359r
    Level 2  
    Awesome, thanks for the reply. The plug is currently monitoring the dishwasher, once it finishes, I'll unplug and double check the pins with meter. Will update this post in around an hour or so, cheers

    Edit time, confirmed, P9 SCL and P14 SDA

    Added after 1 [hours] 21 [minutes]:

    Arlec PCTH01HA - Bunnings - CB3S BK7231N
  • #4
    p.kaczmarek2
    Moderator Smart Home
    Thanks to our contributor, a simple CHT8305 driver has been added.
    USAGE:
    - select CLK pin
    - select data pin
    - save pins
    - for data pin, select two channels to store temperature and humidity (not the same channel! Two different ones...):
    Arlec PCTH01HA - Bunnings - CB3S BK7231N
    Please try it out.
  • #5
    tonyb62
    Level 6  
    I found the information for this plug-in switch to be buried, so.
    This is the current working config i have running as of April 2023, on the latest release of OpenBK; 1.15.638

    P6 - LED_n - 0
    P7 - Btn - 0
    P8 - Rel - 0
    P9 - CHT8305_SCK
    P14 - CHT8305_SDA - 1 - 2
    P23 - BL0937SEL
    P24 - BL0937CF
    P26 - BL0937CF1

    Cheers for the effort involved it making it work.
  • #6
    p.kaczmarek2
    Moderator Smart Home
    Thank you, I will paste it into the online templates list, but please provide it in JSON format (copy template from Web Application)
  • #7
    tonyb62
    Level 6  
    Complete Noob to this but (i'm assuming here) what do you need to add to the home assistant config to have the temp and humidity sensors show in home assistant?
    Currently have;

    Code: yaml
    Log in, to see the code

    Cheers.

    Added after 2 [minutes]:

    >>20529048
    Code: json
    Log in, to see the code


    Will remember for next time.
  • #8
    tonyb62
    Level 6  
    Spent some time on this device and have found this mqtt config to display the temp and humidity sensors in home assistant, contained in this device.
    If you see any issues please let me know, I dont' know yaml and this is a copy and past that i have found works.

    Code: yaml
    Log in, to see the code
  • #9
    p.kaczmarek2
    Moderator Smart Home
    Hey @tonyb62 , I apologize for the slow reply. It's hard to check entire forum when I'm also working on OBK firmware and on our youtube videos:
    https://www.youtube.com/@elektrodacom

    Good job figuring that out, but I will add one more note here: you can also use home assistant discovery:
    https://www.youtube.com/watch?v=pkcspey25V4&ab_channel=Elektrodacom
    This will work as long as you set channel type of given channel to, for example, temperature, or humidity, etc.
    For simple devices and drivers, for Relays, etc, it also works even without setting channel type.
    You can do it on Web App:
    Arlec PCTH01HA - Bunnings - CB3S BK7231N
    That way you can, for example, use DHT11 with OpenBeken:
    https://www.youtube.com/watch?v=KEjOPuYd3CE&ab_channel=Elektrodacom

    So, in general, your YAML method is of course good, but we also have Hass Discovery, as I said above.

    Let me know if you have any other questions or feature requests, I'll be happy to help
  • #10
    tonyb62
    Level 6  
    p.kaczmarek2 wrote:
    Hey @tonyb62 , I apologize for the slow reply. It's hard to check entire forum when I'm also working on OBK firmware and on our youtube videos:
    https://www.youtube.com/@elektrodacom

    Good job figuring that out, but I will add one more note here: you can also use home assistant discovery:
    https://www.youtube.com/watch?v=pkcspey25V4&ab_channel=Elektrodacom
    This will work as long as you set channel type of given channel to, for example, temperature, or humidity, etc.
    For simple devices and drivers, for Relays, etc, it also works even without setting channel type.
    You can do it on Web App:
    Arlec PCTH01HA - Bunnings - CB3S BK7231N
    That way you can, for example, use DHT11 with OpenBeken:
    https://www.youtube.com/watch?v=KEjOPuYd3CE&ab_channel=Elektrodacom

    So, in general, your YAML method is of course good, but we also have Hass Discovery, as I said above.

    Let me know if you have any other questions or feature requests, I'll be happy to help


    Yes I need to watch more of your youtube videos.

    I've found the yaml method doesn't stay in the Homeassistant tab and needs to be entered each time additionally, which is an issues when fiddling with the device, but thankyou for pointing out the HASS discovery method.
    Im now using it on this device because of its persistence and easy of use.

    Cheers.
  • #11
    p.kaczmarek2
    Moderator Smart Home
    tonyb62 wrote:

    I've found the yaml method doesn't stay in the Homeassistant tab and needs to be entered each time additionally, which is an issues when fiddling with the device

    Do you mean the autogenerated YAML code in OBK? Well, it should just give you a quick start, not a final config. You should fiddle with code in Home Assistant configuration.yaml, which is kept as long as you don't delete it.
  • #12
    tonyb62
    Level 6  
    p.kaczmarek2 wrote:
    tonyb62 wrote:

    I've found the yaml method doesn't stay in the Homeassistant tab and needs to be entered each time additionally, which is an issues when fiddling with the device

    Do you mean the autogenerated YAML code in OBK? Well, it should just give you a quick start, not a final config. You should fiddle with code in Home Assistant configuration.yaml, which is kept as long as you don't delete it.


    Yes, I was adding to yaml code in OBK, I see the error of my ways :)