-
-
Notifications
You must be signed in to change notification settings - Fork 116
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
Refactor MQTT subscriptions and API calls #173
Comments
hi @MichaelDvP, I made some breaking changes to the code so please wait for this PR before submitting any changes. I'll see if I can get it all working tonight. |
|
There might be an issue with checking the mqtt base, we have introduces the "base" to allow some people to set a longer mqtt-path like tasmota. e.g |
Good point, thanks for checking. I touched a lot of code so expect a few more quirks here and there. In this case I can remove that check anyway since the subscriptions will always come in on the MQTT base and API calls on the /api. This was left over from an earlier experiment where I subscribed to '/#' but then it would pick up everything, including the MQTT 'response' topics. |
making a fix now |
Maybe it differs for different mqtt brokers, but subscription on |
oh you are correct, sending to topic 'thermostat' will not work. I didn't add that. But will later. Good catch! |
this change to
It's not allowed according the official MQTT specification, see (example “sport/tennis#” is not valid). I'll add the / back --- edit --- Unlike the API I think we should restrict client's from publishing directly to the device's, such as |
Please add the extra subscription to device only. This was the methode for all emsesp versions until now and first in the documentation. I think most people using this, as individual subscriptions need to be activated by settings. |
Ok, I'll add it back if people use it. I still don't see a valid use case of why anyone would publish to an MQTT topic like 'ems-esp/thermostat'. If you have an example let me know! BTW individual subscriptions and all the complicated settings stuff is gone. |
I've already linked it in doc, it is the default most older users use: |
I see in the specification: |
Ok, I'll also test with Mosquitto (which is standard with Home Assistant) and perhaps wrap the additonal subscription code around an #ifdef IOBROKER just in case. I'm out today so if you want to do that pls go ahead |
I dont think this is needed, emsesp should not correct the bugs from other software. Iobroker-users can use @tp1de adapter or mosquitto. I've opend an issue and maybe this will be fixed. |
I've opend an issue, made a small fix and a PR. I'll remove the extra subscriptions, if someone complains, he can use my version until the PR is merged. |
ODINServ reported an error via Discord that sending a value in an MQTT payload fails. I've made a fix |
Can you please help me, I'm a little bit confused. Now in v3.3.0b8 my previously (in v3.2.2b10) working HA/Mqtt commands are no longer working. HA:
Manually calling command in console is working:
Can you please tell me how the config for the command should look like in HA? Thanks |
yes, sorry, that was a bug I fixed yesterday around 1pm CET. I didn't change the version so it's still called 3.3.0b8. Can you check you have the latest ? |
thanks, yes my version was older. |
Currently we make individual MQTT subscriptions for everything, whether it's a command (e.g. system/send or thermostat/temp) or an endpoint. And there are also options to register all device values which introduces a bit more code, I plan to refactor this and use wildcards and remove the options so all options work.
The text was updated successfully, but these errors were encountered: