logo elektroda
logo elektroda
X
logo elektroda

Optimizing OpenBeken Smartplug MQTT Settings: Selective Topics & Multiple Hosts

arjen2 225 2
ADVERTISEMENT
  • #1 21375880
    arjen2
    Level 3  
    Dear forum

    Got a smartplug device, hacked to openbeken. Trying to mold the MQTT setting to my liking.

    Question 1:
    The device currently spits out everything it knows. Since I have 8 of these devices it is getting busy on the wifi line. Sort of like watching the news, but you're only interested in the weather forecast.

    e.g.

    22:14:33.080 -> received topic 'homeserver/energycounter_today/get' with data '25.307'
    22:14:33.080 -> received topic 'homeserver/energycounter_yesterday/get' with data '27.996'
    22:14:33.080 -> received topic 'homeserver/energycounter_2_days_ago/get' with data '27.994'
    22:14:33.080 -> received topic 'homeserver/energycounter_3_days_ago/get' with data '54.004'
    22:15:34.981 -> received topic 'homeserver/voltage/get' with data '235.9'
    22:15:37.015 -> received topic 'homeserver/power/get' with data '0.00'
    22:15:37.015 -> received topic 'homeserver/power_factor/get' with data '0.00'
    22:15:51.980 -> received topic 'homeserver/current/get' with data '0.033'
    22:15:52.025 -> received topic 'homeserver/power_apparent/get' with data '7.80'
    22:15:52.025 -> received topic 'homeserver/power_reactive/get' with data '7.69'
    22:16:37.989 -> received topic 'homeserver/power/get' with data '1.35'


    I would not be interested in topics like (e.g.) homeserver/power_factor/get or homeserver/power_apparent/get or homeserver/power_reactive/get.

    Is it possible to not send these topics at all?
    I know it is possible to just not subscribe to these topics, but the smartplug will throw them anyway over the Wifi.
    Can I make a list of 'interesting topics to send' ?

    Question 2:
    Is it possible to enter multiple hosts in the config? Currently I have 2 brokers, they are not always on, so I cannot use one broker to collect and then forward the topic to the other broker.

    Thanks.
  • ADVERTISEMENT
  • #2 21375889
    p.kaczmarek2
    Moderator Smart Home
    I think the simplest and the most reliable way to remove topics you don't like is to create your own OBK version with our online build system:
    OpenBeken online building system - compiling firmware for all platforms (BK7231, BL602, W800, etc)
    This can be done fully on Github, no compiler required. You should be able to find out and comment out entries you don't like, altough, I haven't tried that.

    Regarding MQTT brokers - we didn't predict this feature, but again, with some basics mod to code it should be possible.... maybe even with scripting, count how long current MQTT connection is down and then use console commands to set second broker?
    Helpful post? Buy me a coffee.
  • #3 21375927
    arjen2
    Level 3  
    Thanks
    I was not aware of the fact that I could compile my own version. I'll have a look into that.
ADVERTISEMENT