MQTT Hub/Gateway

I expected HA to handle the naming correctly, since devices are first class members in HA nowadays. But that’s not the case…Both the device name and entity (=capability) name are provided. I once tried without the device name in the entity name, but that didn’t work as intended and the change was reversed. Don’t know if adding an alternative behavior for ‘onoff’ values is the way to go. Guess I’ll leave it as is for now … it’s easy to modify the names in HA afterwards anyway. You can even choose your own icon :wink:

1 Like

Yes indeed, I don’t see the name thing to be an issue really.

Version 3.3.3

  • Color temperature fix: Homey => HA

Works like a charm, @HarriedeGroot!
Thanks, very much appreciated! :+1:t2::smiley:

To make it really neat, I have to find a way to change the min and max values in HA (now 153 and 500), but I suppose that has something to do with the calculations in HA.
Great work, thx!

Wat are the allowed mired values? 153-500 is the default setting. Don’t know if these values can be read from the capability info from Homey? Homey works with a 0…1 value…

Version 3.4.0

  • MQTT Device: allow mathJS expressions as value template for incoming messages

Both mathJS & jsonPath expression are allowed as value template for incoming messages.
The value is accessible via the value param if the message is a raw value.
If the message is JSON formatted: path.within.json can be used to target the value.

Example: Convert incoming Wh to kWh

2 Likes

I never even heard of Mired… :confused: Long live Google! :slight_smile:
Now learned that a lot of questions are raise in the HA community why Mired is uses instead of the very much more commonly used Kelvin.

The desired Mired value for my Ikea bulbs would be 454.54 for most warm (2200K) and 250.00 for most cold. If I understand correctly the formula would be: Mired = 1.000.000/Kelvin.
In MQTT Exporer see the following lines in the config. Can something be done there, or do I (as I expect) have to sort this out in HA?

BTW: Since the last update(s) to v3.3.0 or 3.4.0 MQTT Explorer keeps displaying red notifications “disconnected from server” which I didn’t see before. But is reconnects immediately as well (and then disconnects again). Everything is working well though…
Can it have something to do with the updates?

To be honest, I wouldn’t bother to much about the actual displayed value in HA. The HA temperature slider is interpreted as a % scale (0…100) and the Homey IKEA driver converts this to the appropriate temperature between the min & max of the bulb’s capability. Or do you mis any functionality?

No the functionality is there. Is morefrom a cosmetic point of view. .

When you adjust the slider, the value is shown, just above and you can show the value right next to it.
In the screenshot below I am adjusting the slider; the value that is now at 500 gets updated when releasing the slider.
Those values are now incorrect.

I am already very happy so far! Thanks again for all the great help!

Works fine, thanks a million!

Just tried JSONpath and it’s a godsend for zigbee2mqtt! Great job!

Version 3.4.1

  • MQTTDevice: allow mathJS expressions as output template for outgoing messages
  • MQTTDevice: removed default ‘{{value}}’ output template

For version history, see: CHANGE_LOG.

You have something(s) logging on to the MQTT broker twice with the same client ID

Ah, thx for the tip!
Will try to sort that out then!

Tnx for this great app @HarriedeGroot !! In addition to @Henk_Renting’s question on color temperature, I’ve got another one:

I’ve got a zigbee lamp on Homey that is connected to Home Assistant using MQTT. It is capable of showing different colors ánd different light temperature. (screenshot). However to change from temperature to color or the other way around, the lamp ‘mode’ has to be changed. In the Homey UI this is done by picking the other circle (screenshot).

In Homey developer you can see there is a capability ‘light_mode’ which can be set. However, in Home Assistant it is shown as a separate sensor, not an attribute of the lamp. Is this something that can be changed in MQTT Hub? Or do I need to look somewhere else for a solution?

Unfortunately light modes is not implemented (yet).

Screenshot from (r557):

I’m really trying to understand these kind of things, so maybe one day I can actually contribute with code… So out of curiosity: how can Home Assistant discover a MQTT sensor ‘light mode’ for this lamp ?

The HA MQTT Light contains a color_mode config:

This needs to be mapped to the Homey light_mode capability.
But to be honest; I need to look into this further one day, not sure if thats the full picture…

I’m already happy the light is working and all my other devices are too, so I’ll happily wait . However I still don’t understand why HA is showing a sensor (screenshot) when there’s no mapping for light_mode. Or do all capabilities that have no mapping show up as a sensor?

image
Schermafbeelding 2021-05-04 225709

Version 3.4.2

  • MQTTDevice: Display capability details
  • Readme update

For version history, see: CHANGE_LOG