-
Notifications
You must be signed in to change notification settings - Fork 10
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
Default Topic MQTT seems broken #10
Comments
Hi,
I will have a look at it and issue a new version with your suggestions. I
didn't test it with mosquito and it looked good by the time with the
command line tools I used. The problem with the name comes from the
thermostat and the BT library, but there isn't much I can do to override it
because no configuration is stored by the pymadoka library. Anyway, your
patch should be enough, thank you.
…On Sat, 5 Nov 2022 at 14:53, rekkebus ***@***.***> wrote:
Hi there,
Thanks for making a great library on pymadoka and a MQTT broker, trying to
get this to work for HVACS.
I noticed 2 things already:
When using root topic starting with a / you get some weird behaviour, at
least on mosquito:
Defining a root topic without a trailing / fixes this, although the
default ROOT TOPIC in mqtt.py is still defined with a /
Furthermore, my madoka keeps changing names in bluetooth. Half of the time
it is called "UE878_RF_MODULE" and the other half "BRC1H_AA_BB-CC" . i
changed the mqtt library to accept a config value "root_topic_only" that
omits the device name.
def get_device_topic(self): """ Get the customized device topic using the
device name and the root topic. Returns: str: The device topic in the form
/root_topic/device_name""" root_topic = self.ROOT_TOPIC if "root_topic" in
self.mqtt_cfg: root_topic = self.mqtt_cfg["root_topic"] if
"root_topic_only" in self.mqtt_cfg: return root_topic else: normalized_name
= self.controller.connection.name normalized_name =
normalized_name.replace(" ","_") normalized_name =
normalized_name.replace(":","_") normalized_name =
normalized_name.replace("/","_") return
"/".join([root_topic,normalized_name])
—
Reply to this email directly, view it on GitHub
<#10>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AFK3CTZND7G2UPXHHIGMWCTWGZRFLANCNFSM6AAAAAARX6AFRA>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I updated the library (0.2.8) so the address is always sent as part of the root topic (instead of the name provided by the bluetooth connection). Anyway, using the root_topic_only is still supported with slight changes to what you proposed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi there,
Thanks for making a great library on pymadoka and a MQTT broker, trying to get this to work for HVACS.
I noticed 2 things already:
When using root topic starting with a / you get some weird behaviour, at least on mosquito:
Defining a root topic without a trailing / fixes this, although the default ROOT TOPIC in mqtt.py is still defined with a /
Furthermore, my madoka keeps changing names in bluetooth. Half of the time it is called "UE878_RF_MODULE" and the other half "BRC1H_AA_BB-CC" . i changed the mqtt library to accept a config value "root_topic_only" that omits the device name.
def get_device_topic(self): """ Get the customized device topic using the device name and the root topic. Returns: str: The device topic in the form /root_topic/device_name""" root_topic = self.ROOT_TOPIC if "root_topic" in self.mqtt_cfg: root_topic = self.mqtt_cfg["root_topic"] if "root_topic_only" in self.mqtt_cfg: return root_topic else: normalized_name = self.controller.connection.name normalized_name = normalized_name.replace(" ","_") normalized_name = normalized_name.replace(":","_") normalized_name = normalized_name.replace("/","_") return "/".join([root_topic,normalized_name])
The text was updated successfully, but these errors were encountered: