smar000 / evoGateway

Python script for listening in and responding to evohome heating control radio messages
46 stars 17 forks source link

Question #54

Closed pdbayes closed 12 months ago

pdbayes commented 1 year ago

Hi

Is it possible to limit the MQTT published messages and change some of the keys. For example, I want to send directly to InfluxDB but it will see the key temperature, for every zone as the same thing. I need to concatenate the zone value and temperature keys. I only have 2 zones and DHW, and one thermostat as we use the controller as the thermostat for the other zone. I really just want to know the setpoint, temperature, DHW info, and valve status and rates. I could probably hack the python if pointed in the right place. I am currently doing all this in node red but it's only ever giving me the same set of messages and only once when i redeploy. Using Mqtt explorer I can see everything is being received as it should be. Thanks. Great bit of software.

smar000 commented 1 year ago

TBH I don't really have much time to spend on this script to have a proper look at what would be involved for such a change. I suspect though that materially changing the MQTT published message structure is likely to be risky as it could potentially break everything for others (including my own use!), and is therefore not something I would want to do at this stage.

If you want to give it a go yourself, have a look at the function mqtt_publish_received_msg and more specifically lines 773 to 816.

I have not tried MQTT data source with InfluxDB, but are you really sure that it will see every zone as the same thing? From a very quick scan of the docs just now, I get the impression that it can handle seperate topics easily. If not (and I recognise that I could be totally wrong on this) what about using Telegraf to help?

Do let me know how you get on!

EDIT: Another thought - if influxDB can parse JSON to create seperate time series, you could try the MQTT_PUB_JSON_ONLY=True in the evoGateway config, which will then just give you the full json rather than splitting it down to the individual properties.

sveco86 commented 1 year ago

I would suggest to filter out and/or transform mqtt messages with using NodeRed.

Dňa ut 14. 2. 2023 o 9:55 smar @.***> napísala(a):

TBH I don't really have much time to spend on this script to have a proper look at what would be involved for such a change. I suspect though that materially changing the MQTT published message structure is likely to be risky as it could potentially break everything for others (including my own use!), and is therefore not something I would want to do at this stage.

If you want to give it a go yourself, have a look at the function mqtt_publish_received_msg and more specifically lines 773 to 816.

I have not tried MQTT data source with InfluxDB, but are you really sure that it will see every zone as the same thing? From a very quick scan of the docs just now, I get the impression that it can handle seperate topics easily. If not (and I recognise that I could be totally wrong on this) what about using Telegraf to help?

Do let me know how you get on!

— Reply to this email directly, view it on GitHub https://github.com/smar000/evoGateway/issues/54#issuecomment-1429352161, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIO4MUFBQL3JPVEPT4JS3WXNCBNANCNFSM6AAAAAAU2BZMLQ . You are receiving this because you are subscribed to this thread.Message ID: @.***>

pdbayes commented 1 year ago

Thanks. I'm away this week but will have a look. It's working ok with node red but I will also try an Influxdb agent to subscribe to the topics. It may put them in different measurements within the same bucket which would be ok.

On Tue, 14 Feb 2023, 08:55 smar, @.***> wrote:

TBH I don't really have much time to spend on this script to have a proper look at what would be involved for such a change. I suspect though that materially changing the MQTT published message structure is likely to be risky as it could potentially break everything for others (including my own use!), and is therefore not something I would want to do at this stage.

If you want to give it a go yourself, have a look at the function mqtt_publish_received_msg and more specifically lines 773 to 816.

I have not tried MQTT data source with InfluxDB, but are you really sure that it will see every zone as the same thing? From a very quick scan of the docs just now, I get the impression that it can handle seperate topics easily. If not (and I recognise that I could be totally wrong on this) what about using Telegraf to help?

Do let me know how you get on!

— Reply to this email directly, view it on GitHub https://github.com/smar000/evoGateway/issues/54#issuecomment-1429352161, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN4GHPQKHGNRCUY3DKKPRDDWXNCBNANCNFSM6AAAAAAU2BZMLQ . You are receiving this because you authored the thread.Message ID: @.***>

pdbayes commented 1 year ago

Can you set the QOS and retain flags on messages? I am using a JavaScript client for a web site and it doesn't get the correct states until they change.

smar000 commented 1 year ago

Changing QOS/retain flags is currently not included, but should be relatively straight forward to add. I won't be able to look at this properly for at least a few weeks due to work committments, but feel free to change these yourself - just do a search for MQTT_CLIENT.publish and add whatever flag you need.

pdbayes commented 1 year ago

I think I found them, there is a 0 , True on most of them, so I changed to 2, true

I also had to change the client to cleanSession false. Thanks

On Tue, 28 Feb 2023, 17:42 smar, @.***> wrote:

Changing QOS/retain flags is currently not included, but should be relatively straight forward to add. I won't be able to look at this properly for at least a few weeks due to work committments, but feel free to change these yourself - just do a search for MQTT_CLIENT.publish and add whatever flag you need.

— Reply to this email directly, view it on GitHub https://github.com/smar000/evoGateway/issues/54#issuecomment-1448599718, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN4GHPSTJCVIQVB56PCZY23WZY2HNANCNFSM6AAAAAAU2BZMLQ . You are receiving this because you authored the thread.Message ID: @.***>

smar000 commented 1 year ago

Glad to hear that you've got it working.

pdbayes commented 1 year ago

Not sure it's 100% but not much time to fiddle. Just put a thermistor on the return pipe but need to update the ESP32 that's monitoring wether the boiler is running or not and then need to work out how to reduce the return temp so it actually condenses. It's not easy when you only have 1 flow temperature thermostat and it has to be hot enough to get the hot water over 60

On Tue, 28 Feb 2023, 20:28 smar, @.***> wrote:

Glad to hear that you've got it working.

— Reply to this email directly, view it on GitHub https://github.com/smar000/evoGateway/issues/54#issuecomment-1448855588, or unsubscribe https://github.com/notifications/unsubscribe-auth/AN4GHPTZYZ3MSSGTQ2WP4FTWZZNVDANCNFSM6AAAAAAU2BZMLQ . You are receiving this because you authored the thread.Message ID: @.***>

smar000 commented 1 year ago

Ah ok! Good luck!