[Beta] MQTT beta 3d (released 5th July)

Sorry, I should have read your second post related to JSON and nested JSON. I was able to get the ON and OFF working with the mapping below. I'll see if I can get the other attributes mapped.

Thanks again, Great App!

HE device details:

  • switch_MAP: [{"state": "ON"}, {"state": "OFF"}]
  • colorName_Topic:
  • saturation_Topic:
  • saturation_Cmd:
  • origin: user
  • color_Cmd: kitchen/esps/cabinet/set
  • switch_Topic: kitchen/esps/cabinet
  • color_Topic: kitchen/esps/cabinet
  • level_Cmd:
  • hue_Topic:
  • max_Level: 100
  • mqtt: enabled
  • RGB_Topic: kitchen/esps/cabinet
  • color_MAP: [unknown,open,closing,closed,opening]
  • colorName_MAP: [CT,RGB]
  • hue_Cmd:
  • colorName_Cmd:
  • level_Topic:
  • RGB_Cmd: kitchen/esps/cabinet/set
  • switch_Cmd: kitchen/esps/cabinet/set
  • properties: onoff,dim,color,color-name
  • RGB_MAP: [closed,open]

The color value with the nested 'color' R G and B values is going to be problematic as HE expects hue & sat values. If you want to see the state or set color via MQTT you may have to use RM, NodeRED or something to massage this value.

I do have inbuilt conversions for these RGB values when used with homie and HomeAssistant but not usable with these 'adhoc' MQTT devices. That's maybe a useful feature for me to add.

As you I'm sure know your cmd topic for the switch _CMD is wrong - you'll need to add the json bit there.

topic1/topic2/topic3{state:}
or
topic1/topic2/topic3{state:}{key2:3,key3:"whatever"}
if you need extra keys - I don't think you will.

switch_Cmd: kitchen/esps/cabinet/set{state:}

I don't think I support nested json for cmd's although there may be a work around for that which you'd need if you want RGB for example.

I 'think' but can't remember that the switch_MAP mappings will get used in reverse automatically so will publish 'ON' and 'OFF' rather than 'on' and 'off'. If they don't I should add this behaviour.

Awesome that worked for on and off, Thanks for the quick response and the great app. I'll try the RGB values and see if I can get it working.

brightness should be straight forward for you to implement if you need

Hi Folks,

I want to be able to expose sensor data from HA in to HE. Am I on the right lines with set up?

I've installed MQQT Broker in HA:

My HomeAssistant server is accessible from homeassistant.local on my network.

Opening up the MQTT App: I've populated as follows:



added the content of automations.yaml from git

updated configurations.yaml with the below:

mqtt_statestream:
base_topic: HAStateStream50
publish_attributes: true

Restarted HomeAssistant
Added the Device Driver & App:

I'll have a good lookover this shortly. cursory glance looks OK and it looks like it's checking for HA devices. When you re-run the app are any discovered devices now listed here ?

image

What I would do is install MQTT Explorer as this allows you to see what's actually being sent to MQTT. It's a great app - a must have.

Thanks Kevin for the reply, I checked the logs and am seeing this error:

MQTT> MQTT connect failed attempt:[null], try again in 10 secs

dev:29522020-09-08 04:26:45.963 pm infoMQTT> Connecting as Hubitat_temporary to MQTT broker null

I'll download the tool as you suggested to see if I can connect. Once I get this all working, happy to put together a how to with screenshots if that's helpful.

Ahh. known annoying issue... with new installs, Will be fixed in next (final) version.

Try deleting the MQTT client device - (not the driver) and then re-running the app. Recommend you reboot the hub after that too to stop the previous driver from running.

OK, so after a restart it was able to discover devices. I've selected a bunch of climate devices, but should it then create virtual devices for these? As nothing seems to happen after selecting them and clicking done..

These are temperature sensors in HA .. or thermostats ?
It should create virtual sensors in HE for these.

It maybe this support was changed in the ‘next version’ beta 3e as I modified it for thermostats too. Let me check here.

There’s another way to do it too, slightly more tedious though as it doesn’t use discovery. We’ll investigate that if needed.

Could you fully expand the ‘climate’ topic in MQTT for one of your sensors and post a screenhot snip so I can see the payloads it’s providing.

If you’re posting on HA specific issues it might be tidier to post here..

Hi folks,

I keep getting the following messages.

config is below:

image

Note: I have successfully connected to the MQTT broker via MQTT Explorer.

Any ideas? What am I missing?

Hello. I've been trying to set up MQTT for HE and HA to talk to each other. I've gotten the point where HA is at least publishing some data and I can see it with MQTT Explorer, but I can't get the MQTT app in HE to connect to the broker.

It's the same null broker config messages as mentioned above, but I am not sure what you mean by "re-running the app" after deleting the child device.

I did try yesterday to delete the child and remove the app, then re-add the app. It didn't change anything.

Okay, I think I got the child app communicating correctly. I deleted the child device, rebooted the hub, then loaded the MQTT app again. Checked the child device and it seems to see the broker now.

Now on to figuring out how to get HA devices to be discovered. I'll head to the other topic for that.

@Kevin I’ve been using the MQTT beta 3d for sometime without issue - via virtual devices. I have just tried to add these 3 devices via the discover in to HE option. I can find the 3 devices, but selecting them doesn’t create the devices... is there anything about these lights which isn’t supported? Thanks!

HAStateStream50/light

I do see this error but it looks like its associated with emoncms_use which is a device that is working:

app:34912020-10-30 10:39:15.802 pm infoMQTT: Passing on sensor Event values: emoncms_use_kwh 697.26 sensor true

app:34912020-10-30 10:39:15.739 pm errorjava.lang.NullPointerException: Cannot get property 'value' on null object on line 5918 (HASensorEventP)

app:34912020-10-30 10:39:15.729 pm infoMQTT: Passing on sensor Event values: emoncms_use 715.0 sensor true

app:34912020-10-30 10:38:45.814 pm errorjava.lang.NullPointerException: Cannot get property 'value' on null object on line 5918

I will try and discover one of these into my system tomorrow and see...

@kevin any idea what could be causing this null pointer exception? I can see the values coming in but the virtual device doesn’t get updated, but instead throws this error:

app:34912020-11-02 11:11:01.367 pm errorjava.lang.NullPointerException: Cannot get property 'value' on null object on line 5918 (HASensorEventP)

app:34912020-11-02 11:11:01.360 pm infoMQTT: Passing on sensor Event values: emoncms_use 698.0 sensor true

sorry it slipped my mind - thanks for the nudge I'll see what I can do about that..

Hi Kevin,

I had to reset my hub and after installing the mqtt driver and app now I keep getting this message when trying to update a virtual device I make. I have tried deleting the driver client and restarting, restarted the hub. I'm not that much of a programmer but i found this sentence in a catch some place. The hub version is 2.2.4.145.

" This device Big Garage Door was not created within this app and so can't be edited here".

Any thoughts?

Thanks!

The virtual devices used within the MQTT app are created as child devices of the app. If you delete the app it will also delete these child devices. So upon re-install you would have to recreate the devices again within the app.

The message you are getting confirms that the device you are trying to edit was not created within the current app.

How did you create this virtual device ?

Hey Kevin,

I am getting the same thing, no matter what Device I try to create within the app I get the same error.