# \[APP\]\[Pro\] MQTT Hub - Community version

**URL:** <https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463>\
**Category:** Apps\
**Tags:** app, mqtt, homey-pro\
**Created:** [July 26, 2024, 3:58pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463 "2024-07-26T15:58:53Z")\
**Posts on this page:** 20\
**Page:** 7

<div class="post-metadata">

**Author:** ![Awangens](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/awangens/32/7789_2.png) [@Awangens](https://community.homey.app/u/Awangens)\
**Post date:** [December 13, 2024, 8:53pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/129 "2024-12-13T20:53:19Z")

</div>

It was not possible to set as a separate line.

 ![IMG_0205](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/3/0/307e7efb0843c8ec77213698c2eb0faba0d59794.jpeg)

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [December 13, 2024, 9:04pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/130 "2024-12-13T21:04:45Z")

</div>

It looks like you missed something on copy/paste?

```auto
	"meter_power.acc": {
		"capability": "meter_power",
		"stateTopic": "ams/meter/import/active/accumulated",
		"setTopic": "",
		"valueTemplate": "",
		"outputTemplate": "",
		"title": "Energy",    
		"energy": {
			"cumulative": true
		}
	},

```

But I don’t think it will set the cumulative flag, but just try 🙂

---

<div class="post-metadata">

**Author:** ![Awangens](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/awangens/32/7789_2.png) [@Awangens](https://community.homey.app/u/Awangens)\
**Post date:** [December 13, 2024, 11:02pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/131 "2024-12-13T23:02:37Z")

</div>

Thanks for the guidance on the JASON, but did not solve my problem/feature request!

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [December 14, 2024, 12:35pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/132 "2024-12-14T12:35:08Z")

</div>

New **test version 4.3.0** :

- Added new **device classes** (pairing)
- Added new **capabilities** (pairing)
- Added **device setting for cumulative** device option (power/gas/water meter & measuring) to add devices to Homey Energy

**Minimum Homey FW: 12.2.0** based on requirements for devicce classes and capabilities.

Test version:

> **[MQTT Hub](https://homey.app/en-us/app/org.mqtt.hub/MQTT-Hub/)**
>
> Turn your Homey into a HUB and let external applications discover & control all your connected devices.

@Awangens FYI and test

---

<div class="post-metadata">

**Author:** ![luguber](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/luguber/32/16795_2.png) [@luguber](https://community.homey.app/u/luguber)\
**Post date:** [December 14, 2024, 12:50pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/133 "2024-12-14T12:50:28Z")

</div>

Thanks, this was perfect!

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [December 14, 2024, 1:56pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/134 "2024-12-14T13:56:19Z")

</div>

@Amersfoort Better use this thread 😉

It’s not possible yet. I’ll add a device setting like it’s done in HA community app.

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [December 15, 2024, 1:00pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/135 "2024-12-15T13:00:49Z")

</div>

New **test version 4.3.1**

- Added device setting for device class.
- Fixed int (0…100) conversion for dim capabilities.

@Awangens FYI and test

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [December 20, 2024, 11:18am UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/136 "2024-12-20T11:18:17Z")

</div>

New **test version 4.3.2** :

- HomeyEnergy: Added device settings to define device as cumulative and set imported/exported meter capabilities.

---

<div class="post-metadata">

**Author:** ![Filip\_Sutovsky](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/filip_sutovsky/32/79116_2.png) [@Filip\_Sutovsky](https://community.homey.app/u/Filip_Sutovsky)\
**Post date:** [December 20, 2024, 7:14pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/137 "2024-12-20T19:14:39Z")

</div>

Hi @RonnyW . I’m testing version 4.3.2 and I’m getting an error when trying to set `Cumulative energy measuring`. Both if I try to set it by itself or if I try to set imported/exported meter capability trough device settings UI

App version: 4.3.2 (Test)  
Homie Pro 2023: 12.3.0-rc.7  
Capabilities:

```auto
{
  "meter_power.imported": {
    "capability": "meter_power",
    "stateTopic": "deye/ac/total_energy_bought",
    "setTopic": "",
    "valueTemplate": "",
    "outputTemplate": "",
    "displayName": "Bought Energy"
  },
  "meter_power.exported": {
    "capability": "meter_power",
    "stateTopic": "deye/ac/total_energy_sold",
    "setTopic": "",
    "valueTemplate": "",
    "outputTemplate": "",
    "displayName": "Sold Energy"
  },
  "measure_power": {
    "capability": "measure_power",
    "stateTopic": "deye/ac/total_power",
    "setTopic": "",
    "valueTemplate": "",
    "outputTemplate": "",
    "displayName": "Power"
  }
}

```

Setting cumulative measuring by itself:  
 ![Screenshot 2024-12-20 at 20.12.34](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/c/4c05092cb927070ba20400bbea7b85c6181656be.png)  
Settings imported/exported:  
 ![Screenshot 2024-12-20 at 20.21.49](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/9/0/90159cc22f21276bf85c590d780584a712036367.png)  
API call payload:

 ![Screenshot 2024-12-20 at 20.24.29](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/5/8/58a7f67bc5c6713bef5be8883409ed6037853502.png)

---

<div class="post-metadata">

**Author:** ![luguber](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/luguber/32/16795_2.png) [@luguber](https://community.homey.app/u/luguber)\
**Post date:** [December 20, 2024, 7:52pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/138 "2024-12-20T19:52:41Z")

</div>

Funny, this works just fine for me.  
I’m on the stable homey firmware though, in case that makes a difference. v12.2.1

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [December 20, 2024, 9:00pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/139 "2024-12-20T21:00:30Z")

</div>

> [@Filip\_Sutovsky](#):
>
> I’m getting an error when trying to set `Cumulative energy measuring`

Hi, thanks for reporting.  
This is caused by a null energy object for a new device. Should be fixed now.  
The initial settings update for device class is re-added, too. Forgot about after tinkering with the energy settings bug in last rc FW.  
Nice to have such beta testers 🙂

---

<div class="post-metadata">

**Author:** ![Filip\_Sutovsky](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/filip_sutovsky/32/79116_2.png) [@Filip\_Sutovsky](https://community.homey.app/u/Filip_Sutovsky)\
**Post date:** [December 20, 2024, 9:53pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/140 "2024-12-20T21:53:14Z")

</div>

Fixed 🎉 All settings can be updated. Thanks for the quick update and also big thanks for maintaining/developing this app 🫶 👏 Without it I wouldn’t be able to connect my inverter to homey at all (of course I mean locally, I don’t like apps/integrations that use cloud APIs, seems borderline stupid to use them when you have all data available locally)  
Don’t hesitate to tag me in future releases, I’ll be more than happy to test them 🙂

---

<div class="post-metadata">

**Author:** ![Filip\_Sutovsky](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/filip_sutovsky/32/79116_2.png) [@Filip\_Sutovsky](https://community.homey.app/u/Filip_Sutovsky)\
**Post date:** [December 20, 2024, 10:10pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/141 "2024-12-20T22:10:32Z")

</div>

Now that my meter should be set up with correct meter\_power.imported/meter\_power.exported, I’m unable to see it in Energy tab 🙈

 ![Screenshot 2024-12-20 at 23.01.46](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/6/3/6373a718565a2270d2a3f374c84f2c1b2cf647e4.jpeg)  
One thing I’ve noticed in homey dev tools is, that in capabilities property, the “names” of capabilities do not match the names I gave them (ones shown in topics property)  
 ![Screenshot 2024-12-20 at 22.59.55](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/8/d/8d117076c0387a25d7b307b254821f04fbbfc4ab.png)  
@RonnyW

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [December 20, 2024, 10:18pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/142 "2024-12-20T22:18:23Z")

</div>

This topic handling is unchanged so far.  
Can you please check what capabilities are present in the device (in dev tools)?  
And did you set the “include in total” in device settings? This is needed in addition to device energy settings - because for standard apps the energy settings are static and you have to add the device to energy dashboard using this setting.

 ![grafik](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/f/8/f8b0a3208355363e02fa49bd40ee893d94f26b81.png)

---

<div class="post-metadata">

**Author:** ![Filip\_Sutovsky](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/filip_sutovsky/32/79116_2.png) [@Filip\_Sutovsky](https://community.homey.app/u/Filip_Sutovsky)\
**Post date:** [December 20, 2024, 10:43pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/143 "2024-12-20T22:43:14Z")

</div>

You are right, it was set to `No`. After toggling it, my `Grid` device showed up in Energy tab 🎉 I didn’t turn it on, because it is confusing to me. I thought, it would be counted as a home usage. This is only the grid consumption, not my home consumption (I have PV, which is not active right now and battery). I saw you were pointing to this specific use case on athom slack, where grid consumtion != home consumption. I’ve just updated to homie to 12.3.0-rc.10 and they’ve added `Track total home energy consumption` property to the device, which would be the one to turn on for overall home usage, right? I’m still confused about how should I set up homie devices, if I have values for grid consumption (import/export), battery consumption(charge/discharde) and pv generation

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [December 20, 2024, 11:06pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/144 "2024-12-20T23:06:01Z")

</div>

The difference is the energy setting for imported/exported capabilities.  
To show a smart meter in new energy dashboard, you need a device with at least meter\_power set as “imported” in energy settings. If you are also exporting energy to the grid, you need the second meter\_power for exported. And for realtime chart you need measure\_power.

The old energy dashboard used all devices with a measure\_power set to “include in total” to use these devices as smart meter.  
In this version, I set some of my internal meters (PV production, internal usage, battery charging, battery discharging) as “total device” so sum up all measures to get the sum as house usage.  
The new dashboard is acting differnent. It’s more like the HA energy dashboard based on meters.

It’s not clear how EV charger and batteries will be included in future.  
I think this will be based on device class (like defined in SDK).These devices will need a measure\_power and a meter\_power I tink to be summarized in the usage overview. But this is not yet documented by Athom.

---

<div class="post-metadata">

**Author:** ![Filip\_Sutovsky](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/filip_sutovsky/32/79116_2.png) [@Filip\_Sutovsky](https://community.homey.app/u/Filip_Sutovsky)\
**Post date:** [December 21, 2024, 12:58pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/145 "2024-12-21T12:58:59Z")

</div>

I have a question about JSONPath and MathJS. How exactly are they evaluated? Are there any examples for `valueTemplate` or `outputTemplate`? I tried to find some online evaluator for debugging, but haven’t been able to.  
F.e. I want to determine `charging`/`discharging` value for `battery_charging_state` capability from power value. How can I do that? This doesn’t work:

```auto
{
  "battery_charging_state": {
    "capability": "battery_charging_state",
    "stateTopic": "deye/battery/power",
    "setTopic": "",
    "valueTemplate": "value > 0 ? 'charging' : 'discharging'",
    "outputTemplate": "",
    "displayName": "Battery charging state"
  }
}

```

Also the `valueTemplate` isn’t updated in the capabilities property, can this be the problem?

 ![Screenshot 2024-12-21 at 14.02.42](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/0/d/0dce3d828ba6c9a512d9166edd81f5c754c40b16.png)

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [December 21, 2024, 1:42pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/146 "2024-12-21T13:42:18Z")

</div>

Only a short check on the code:

- mathjs expression or
- JSON path

Haven’t tried it yet.

---

<div class="post-metadata">

**Author:** ![Filip\_Sutovsky](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/filip_sutovsky/32/79116_2.png) [@Filip\_Sutovsky](https://community.homey.app/u/Filip_Sutovsky)\
**Post date:** [December 21, 2024, 9:27pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/147 "2024-12-21T21:27:25Z")

</div>

I’ve debugged it @RonnyW and I found the issue. MathJS evaluation runs ok, but after that, there is a bug when ValueParser.parseValue tries to access `capability.units.en` on object that doesn’t have `units` defined, because it is of type `enum`. Simple fix is to add an undefined check. I’ve tested it locally and it works. Here is a screenshot of the fix:

 ![Screenshot 2024-12-21 at 22.21.38](https://us1.discourse-cdn.com/flex025/uploads/athom/original/3X/4/7/47d77bc3ef63ca0ed9c16a6563e12da1a34463c1.png)  
Can you update it? Or I can create a PR, if you give me permission to the repo (GH username: filipSu) 🙂

---

<div class="post-metadata">

**Author:** ![RonnyW](https://sea1.discourse-cdn.com/flex025/user_avatar/community.homey.app/ronnyw/32/10879_2.png) [@RonnyW](https://community.homey.app/u/RonnyW)\
**Post date:** [December 21, 2024, 9:30pm UTC](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463/148 "2024-12-21T21:30:59Z")

</div>

Thanks, I will add the check.

[Previous page](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463.md?page=6)

[Next page](https://community.homey.app/t/app-pro-mqtt-hub-community-version/113463.md?page=8)
