Skip to content
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

[Enhancement] Workaround for better Domoticz MQTT intergration? #904

Closed
Tigerstrength opened this issue Jan 10, 2023 · 9 comments
Closed
Labels
enhancement New feature or request
Milestone

Comments

@Tigerstrength
Copy link

Tigerstrength commented Jan 10, 2023

Hi,

I am using this software with great pleasure to control my Nefit Enviline 9kw split heatpump.

Currently I am running v3.5.0b12.

I use a Mosquitto MQTT broker and Domoticz 2022.2 as backend. Al runs smooth, but recently I noticed missing some sensors which Home Assistant users did have and I had not. Digging into it I found out that Domoticz does not support the number type mqtt messages. That is why Domoticz users are missing out a lot of usefull sensors.

From the domoticz files I see only these sensortypes are supported for MQTT autodiscovery (MQTTAutoDiscover.cpp):

(pSensor->component_type == "sensor") || (pSensor->component_type == "binary_sensor") || (pSensor->component_type == "switch") || (pSensor->component_type == "light") || (pSensor->component_type == "lock") || (pSensor->component_type == "select") || (pSensor->component_type == "cover") || (pSensor->component_type == "climate")

Is it possibible to add an option for sending numbers in an other format to MQTT? Most of the numbers can also be send as a select, climate or even text state.

Hoping for a solution. Curently I have a Python script running to handle the missing data, but that is far from ideal.

@proddy
Copy link
Contributor

proddy commented Jan 10, 2023

One solution is to go into the ESM-ESP Customization page and select these missing entities (they will be numerical and writeable) and mark them as read-only. This will force the Discovery topics to make them sensors and not numbers. I haven't tried it, but in theory it should work. If it's a huge problem we can add a workaround into EMS-ESP but I'd rather not. You could also log an enhancement/bug against Domotic that they're not supporting the full Discovery protocol :-)

@proddy proddy added the question Question about something label Jan 10, 2023
@Tigerstrength
Copy link
Author

Tigerstrength commented Jan 10, 2023

Thanks @proddy for your solution. This might work, but it disables the option of writing new setpoints to these entities.

As an example: I would like Domoticz to control the min.flow temperature to write a softstart service (preventing overshoot)

Or am I wrong and are the entities still writeable by MQTT?

@proddy
Copy link
Contributor

proddy commented Jan 10, 2023

oh yeah, you're right. if the write action is disabled then both MQTT and API will not work. If more people have the same issue we'd need to change EMS-ESP to choose which flavor of MQTT Discovery is being used (Domoticz, HA) and use that flag to determine whether to use 'number' or 'sensor'. It's more code so I'd rather not just yet. There are only 2 devs on the project and little time at the moment.

@proddy proddy added the enhancement New feature or request label Jan 10, 2023
@Tigerstrength
Copy link
Author

Tigerstrength commented Jan 10, 2023

I see the dilemma here.

Hopefully you still find time to implement this, as I know there are still a lot of Domoticz users around. Not as many as with Home Assistant I guess, but as the enhancement seems do-able with not too much code it is worth the effort imho.

Thanks so far! 👍

@bbqkees
Copy link
Contributor

bbqkees commented Jan 12, 2023

Auto Discovery was created for HA, and is now more or less becoming a de facto standard.
As it was created for HA, it is not always a good match for other systems like Domoticz.
Some parts of Discovery are 'easy' to implement, others don't fit properly on the structure a certain system implements.
So there is this tension between a good implementation of Discovery, and what can actually be matched in a home automation system.
Maybe it's better to open an issue on the Domoticz repository to see if they can have another look at this.

@Tigerstrength
Copy link
Author

Tigerstrength commented Jan 15, 2023

I understand the tension it creates, but I also would like to refer to the fact that de EMS-ESP software is listed as compatible with both HA and Domoticz. So please keep that in mind when considering wether to make a modification/enhancement to patch this is issue or not.

I will also start a topic on the Domoticz GitHub, it is valid to say they are also part of this issue. Also for the future support of mqqt discovery with number topics is a must for Domoticz.

Please note that I absolutely love the work which is done here. So hands downs to you all 👍

@proddy proddy added this to the v3.6.0 milestone Jan 19, 2023
@proddy proddy removed the question Question about something label Feb 11, 2023
@proddy
Copy link
Contributor

proddy commented Feb 19, 2023

in 3.6.0

@proddy proddy closed this as completed Feb 19, 2023
@Tigerstrength
Copy link
Author

Tigerstrength commented Mar 6, 2023

Please note that on Domoticz side things are moving aswel. Maybe @proddy can guide Gizmocuz with the trouble of implementing this? [https://github.com/domoticz/domoticz/issues/5550]

@gizmocuz
Copy link

gizmocuz commented Mar 8, 2023

Please note that on Domoticz side things are moving aswel. Maybe @proddy can guide Gizmocuz with the trouble of
implementing this? [https://github.com/domoticz/domoticz/issues/5550]

There's no trouble I think? Anyway it is not possible to configure the number values.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants