[APP][Pro] Watts Live MQTT

Watts Live MQTT integrates the smart power meter from Watts.dk into Homey.

The smart meter supports sending live data to a MQTT broker, and this app consumes that data, and exposes the smart power meter inside Homey.

To use it you will need a MQTT broker. If you don’t already have one, the excellent MQTT Broker app for Homey works just fine.

Once you’ve setup the broker, and created a login for the Watts Live device, you can then proceed to the actual setup of the device. Watts has a description for setting it up with Home Assistant, and you can skip step sections 1 and 2.

Next up you need the MQTT Client app for Homey, which you need to configure to connect to the broker running on your Homey Pro.

Finally you can install the Watts Live MQTT App. It automatically detects and connects to your MQTT Broker via the client app, and detects all Watts Live devices sending data to that broker.

Production metric are not included on initial setup as there is no way to tell if the device has production or not. Instead these can be enabled from the app settings once installed.

1 Like

I get this error when trying to add Watts Live MQTT, I have followed the instructions and know the MQTT Broker is working as I can subscribe to the watts topic using a MQTT client on my PC with the same settings as I used with the MQTT client on Homey, but it does not find anything.

When you look at the watts topic, does it say /watts/+ or does it say /watts/some identifier/ ?

If it’s a plus sign then your watts device is not connected to the broker.

Also, is your Honey MQTT client connected ? You can check the logs of the client to see if it connects.

When I get the time, I will implement MQTT directly into the Watts app, as this seems to cause more trouble than I anticipated. It is however not trivial to do, so it will take some time.

The watts topic is “watts/some identifier/measurement”

I am not sure what to look for in the client log other than it subscribing to some sys topic.

Thanks for the quick reply and for making this app, I have been looking forward to be able to integrate watts into Homey :smile:

I think I may have an idea about what goes wrong.
Can you try out the test version and tell me if that fixes your problem ?

I get the same error “Der er opstået en ukendt fejl [null]”

the MQTT message I receive from watts looks like this

{
  "positive_active_energy": 23513810,
  "negative_active_energy": 0,
  "positive_reactive_energy": 13500,
  "negative_reactive_energy": 22035350,
  "positive_active_power": 5013,
  "negative_active_power": 0,
  "positive_reactive_power": 0,
  "negative_reactive_power": 523,
  "voltage_l1": 235,
  "voltage_l2": 230,
  "voltage_l3": 233,
  "current_l1": 0.5,
  "current_l2": 12.43,
  "current_l3": 9.21,
  "positive_active_power_l1": 58,
  "positive_active_power_l2": 2807,
  "positive_active_power_l3": 2148,
  "negative_active_power_l1": 0,
  "negative_active_power_l2": 0,
  "negative_active_power_l3": 0
}

I just published a new version to test with more/better error handling, and more error messages. Could you give that a try ?

I’m not seeing any crashes in Homey, so I’m kinda shooting blind here :slight_smile:

Still fails with null, I have tried creating a diagnosis report with id
335427e7-62a8-478f-849d-fad5d8ca68f3

Thanks, using the diagnostic report I think I was able to replicate the issue on my local Homey, and I have pushed a build to test that fixes the problem for my instance.

Could you give it a try before I promote it from testing :slight_smile:

Yes, now it works :smiley: I can select and add it and it shows all the values. Thank you!

1 Like

Is this working anywhere? Did anyone avctually manage to connect it? I get the same error; simply the text “null” when clicking the “connect” button on the devices

It certainly works, and I’m chasing down the “null” error, but essentially it just means it cannot find your device.

The most common problem with not finding a device is because MQTT is not properly configured.

I’m working on, but nowhere near finished, a built in MQTT connection instead of using MQTT Client as that seems to cause much confusion.

1 Like

I get the same error; “null” when clicking the “connect” button on the devices

The MQTT client is following:


Can you see what I’m doing wrong ?

Kommer der widgets til deres nye dashboard??

Umiddelbart nej.

Watts Live er integreret som et “Smart Meter”, så alt der bygger på den funktionalitet vil også virke med Watts Live.

Den understøtter de samme capabilities som Homeys egen energy meter, så når der engang kommer Dashboard widgets til deres, så vil de også virke med Watts Live (under antagelse af de ikke bruger et eller andet internt API).

Var der noget bestemt du eftersøgte ?

@Morten_Jul @Jinie

If you could please keep the conversation in English as much as possible, then more people will be able to participate and help you. If you would rather not or can’t communicate in English then please check out Non-English boards/categories:

Dansk (Danish)
Deutsch (German)
Español (Spanish)
Suomeksi (Finnish)
Français (French)
Italiano (Italian)
Nederlands (Dutch)
Norsk (Norwegian)
Polskie (Polish)
Svenska (Swedish)

Ok, im not getting any data any more, i have restartet the app and had the module out and it dident help.
f6c9b067-a925-4d4a-ba9e-58f71f66f5cc

What kind of setup are you using ?

The report looks very weird compared to what I expected it to look like, and I’m wondering how you even got it setup to begin with :slight_smile:

The Watts Live MQTT App expects data on the topic /watts/deviceId/measurement

something like :

Message received on topic watts/0123143245612822/measurement: [object Object]
received reading {"positive_active_power":825,"positive_active_energy":90450341,"positive_active_power_l1":394,"positive_active_power_l2":355,"positive_active_power_l3":104,"current_l1":2.239,"current_l2":2.201,"current_l3":0.875,"voltage_l1":227.079,"voltage_l2":228.825,"voltage_l3":224.297,"negative_active_power":0,"negative_active_energy":2374,"negative_reactive_power":629,"negative_reactive_energy":33343782,"positive_reactive_power":0,"positive_reactive_energy":2497382,"negative_active_power_l1":0,"negative_active_power_l2":0,"negative_active_power_l3":0}

What I’m seeing in your stack trace looks like this :

Message received on topic homie/homey/watts-live/measure-power: 0
received reading {"positive_active_power":0,"positive_active_energy":0,"positive_active_power_l1":0,"positive_active_power_l2":0,"positive_active_power_l3":0,"current_l1":0,"current_l2":0,"current_l3":0,"voltage_l1":0,"voltage_l2":0,"voltage_l3":0,"negative_active_power":0,"negative_active_energy":0,"negative_reactive_power":0,"negative_reactive_energy":0,"positive_reactive_power":0,"positive_reactive_energy":0,"negative_active_power_l1":0,"negative_active_power_l2":0,"negative_active_power_l3":0}

So not only is the topic different, the data format received on that topic is also incorrect.

So I’m very curious to learn if you’ve setup something custom, or I have somehow messed up something enough that this is caused by a bug during setup ?

When the app receives a “bad format” message, it instead defaults to default values, in this case being 0. This was intended for when the Watts Live device sometimes reported wrong values in individual fields, and I never once thought it might apply to the entire message, but I guess we learn as long as we live :slight_smile:

Dear Jinie.

I really like your app.

Sometimes it stops updating the meter values. I can’t figure out what the cause is. But it is solved every time by restarting Watts Live MQTT app on Homey.

It would be cool if there was some way to make the app restart by itself when it is not updating.
Alternatively, it would be nice to have a when-trigger when the values are updated, then I could make a flow that restarts the app if the values are not updated in one minute or something like that.

Kind regards.

Bo

The only reason I can think of that could cause it to stop updating is if it isn’t getting data over MQTT. There are 0 crash reports for the current version, so the app is (probably) not crashing.

Are you certain your watts live module has a stable connection to the MQTT server, and your Homey has a stable connection ? Is your MQTT server stable ?

While anecdotal, I’ve tested both connection methods extensively, over WiFi and VPN, and haven’t managed to get it to lose connection. That’s not to say it can’t happen, but if everything else is stable there’s not a whole lot that can go wrong.

The app doesn’t do any “polling”, and instead relies on getting a “notification” from the MQTT server when a new message is available.

Even if it appears that data is not updating that doesn’t mean messages are not being received as homey only updates the values that have changed. You should check each value to see when it was last updated (mouse over or press it in mobile).

As for restarting the app when no data is received, i doubt I can do that, and it’s also not exactly best practice. First of all, due to the event driven nature, the app has no way to know if it should have received anything, so if your Watts Live module for some reason stops sending messages, the app would go into a restart loop.

What I will do, provided I can find the time, is to add a field to the settings where the logs from the app can be viewed. That should help with debugging any issues regarding connectivity.