logo elektroda
logo elektroda
X
logo elektroda

Tuya Smart Breaker with OpenBK: MQTT Integration for HomeAssistant Energy, Voltage, Power, Toggle

lubopetrov 51 3
ADVERTISEMENT
  • #1 21589316
    lubopetrov
    Level 2  
    I need help with Tuya smart circuit breaker flashed with OpenBK. How to MQTT to HomeAssistant consuption,voltage,power and control Toggle function?
    here is my autoexec
    
    // Start TuyaMCu driver
    startDriver TuyaMCU
    // set TuyaMCU baud rate
    //tuyaMcu_setBaudRate 115200
    // set TuyaMCU default wifi state 0x04, which means "paired",
    // because some TuyaMCU MCUs will not report all data
    // unless they think they are connected to cloud
    tuyaMcu_defWiFiState 4
    
    setChannelType 1 EnergyTotal_kWh_div100
    setChannelType 2 toggle
    // linkTuyaMCUOutputToChannel dpId verType tgChannel
    linkTuyaMCUOutputToChannel 16 bool  2
    // set voltage, current ,power channel types
    setChannelType 3 Voltage_div10
    setChannelType 4 Current_div1000
    setChannelType 5 Power
    // map dpID 6, which is VCP format, to first voltage, then current, then power (3, 4, 5)
    linkTuyaMCUOutputToChannel 6 RAW_V2C3P3  3
    
    // map dpID 1, which is energy, to channel 1
    linkTuyaMCUOutputToChannel 1 val 1
    
    

    json:
    
    
      {
        "id": 109,
        "type": 3,
        "data": "AAAA"
      },
      {
        "id": 106,
        "type": 3,
        "data": "EwAAAAAAAAAAAA=="
      },
      {
        "id": 105,
        "type": 2,
        "data": 0
      },
      {
        "id": 104,
        "type": 1,
        "data": 1
      },
      {
        "id": 102,
        "type": 2,
        "data": 5
      },
      {
        "id": 107,
        "type": 2,
        "data": 10
      },
      {
        "id": 18,
        "type": 0,
        "data": "01010276"
      },
      {
        "id": 12,
        "type": 1,
        "data": 0
      },
      {
        "id": 13,
        "type": 2,
        "data": 0
      },
      {
        "id": 11,
        "type": 1,
        "data": 0
      },
      {
        "id": 9,
        "type": 5,
        "data": "00"
      },
      {
        "id": 111,
        "type": 4,
        "data": 0
      },
      {
        "id": 1,
        "type": 2,
        "data": 25
      },
      {
        "id": 6,
        "type": 206,
        "data": "0931000000000000"
      },
      {
        "id": 16,
        "type": 1,
        "data": 1
      }
    
  • ADVERTISEMENT
  • #2 21589425
    p.kaczmarek2
    Moderator Smart Home
    OpenBeken supports automatic Home Assistant Discovery. It should work well once you have already set the channel types. Follow this guide:


    Helpful post? Buy me a coffee.
  • ADVERTISEMENT
  • #3 21589456
    lubopetrov
    Level 2  
    I already have MQTT set. The problem is that it is showing some data, but not the one I'm interested in. I need power consumption, voltage and power, but instead I see this.
    Tuya Smart Breaker with OpenBK: MQTT Integration for HomeAssistant Energy, Voltage, Power, Toggle
  • #4 21589608
    p.kaczmarek2
    Moderator Smart Home
    p.kaczmarek2 wrote:
    OpenBeken supports automatic Home Assistant Discovery. It should work well once you have already set the channel types.

    Home Assistant Discovery configures Home Assistant to show channel types you have set when you do Discovery. If you add some new channels or remove them, you need to do Home Assistant Discovery again. You may also need to manually remove first device from HA.
    Helpful post? Buy me a coffee.
ADVERTISEMENT