#I like to integrate a Shelly Pro 1PM as powermeter in Mainsailos

21 messages · Page 1 of 1 (latest)

slim umbra
#

For a year now, it's been suggested that a power meter could be integrated into MainsailOS https://github.com/mainsail-crew/mainsail/pull/1888 . I've entered the necessary parameters in moonraker.conf as described on the Moonraker website. MQTT is working properly, and the configuration data for reading the Shelly Pro 1PM is starting up. have a look into the the moonraker.log file. However, I can't see the data. What am I doing wrong?

GitHub

Description
This PR adds the support for Moonraker sensors to display it on the Dashboard.
Related Tickets & Documents
none
Mobile & Desktop Screenshots/Recordings

[optional] Are t...

plucky coralBOT
#

Ahoi @slim umbra!
Welcome to the Mainsail support-forum!
There is a problem with the tags you selected for this post. Please fix them to fit your question.
For further information on tags please check the readme: https://discord.com/channels/758059413700345988/1320321898009071616

To change the tags of this post:

  1. Open the ... menu on the top right corner of this post.
  2. Find Edit tags
  3. Select the checkbox of the correct tags.

Usually you just need to select one tag!
If you still have no idea which one to choose, feel free to ask here.

Note: This is an automated message

Thanks for your cooperation!

slim umbra
#

No values.

austere swift
#

did you connect to your mqtt broker and subcriped to your shelly topic to check if data are being pushed correctly by the shelly?

slim umbra
#

state_topic = shellypro1pm-8813bfda8058.local/status/switch:0. This the address of my Shelly, When you look into the moonraker.log file, it seems to be active.

#

I also use the Shelly for power on/off printer, but not using mqtt.

austere swift
#

I am not 100% sure if the .local is correct in the topic. Thats why I suggest to connect to your mqtt broker with a client like mqtt explorer: https://mqtt-explorer.com/
With this you can actually see if your shelly is publishing data to the mqtt broker and the actuall topics etc...

your moonraker configruation looks correct and moonraker says its connected to your broker so thats fine.

slim umbra
#

I am using Mqtt explorer, here I can see my Shelly Pro 1pm. I also have a 4pm for testing, is working.

austere swift
#

so the shelly is publishing updates regulary?

slim umbra
#

i'll send you a screen dump, one moment

#

MQTT Explorer screendump

austere swift
#

this is a diffrent topic then configuired, but it doesent contain the data you want anyways.
Try enable Generic status update over MQTT on your shelly

slim umbra
#

{
"src": "shellypro1pm-8813bfda8058",
"dst": "shellypro1pm-8813bfda8058/events",
"method": "NotifyStatus",
"params": {
"ts": 1752155760,
"switch:0": {
"aenergy": {
"by_minute": [
285.28,
285.235,
285.474
],
"minute_ts": 1752155760,
"total": 2364.945
},
"apower": 16.8,
"aprtpower": 16.8,
"current": 0.165,
"freq": 49.99,
"pf": 0.4,
"ret_aenergy": {
"by_minute": [
0,
0,
0
],
"minute_ts": 1752155760,
"total": 0
},
"voltage": 243.2
}
}
}

shellypro1pm-8813bfda8058/events/rpc

austere swift
#

and there is .local in the device name as mentioned before

slim umbra
#

yes

slim umbra
#

I think, in "state_topic = shellypro1pm-8813bfda8058.local/status/switch:0" ...../status/switch:0 .....i s not correct

austere swift
#

I recommend enabling the generic status updates on your shelly. with this option the updates are send regulary to the status/switch topic. the events/rpc is not updated regulary. I had some issues with that back then.

#

but youre correct. the topic is currently wrong and you still need to remove the .local here: shellypro1pm-8813bfda8058**.local**/

slim umbra
#

Ok, i'll try it, and inform you later. I have to do something else now. Thanks for the info👍

slim umbra
#

Hi Rick, it's working. MQTT doesn't need the .local and on the Shelly side: Generic status update over MQTT mus be on. Thanks 👌 👍

slim umbra
#

{
"id": 0,
"source": "WS_in",
"output": true,
"apower": 15.9,
"voltage": 240.3,
"freq": 50,
"current": 0.162,
"pf": 0.41,
"aenergy": {
"total": 2448.778,
"by_minute": [
282.593,
282.25,
282.698
],
"minute_ts": 1752164460
},
"ret_aenergy": {
"total": 0,
"by_minute": [
0,
0,
0
],
"minute_ts": 1752164460
},
"temperature": {
"tC": 46.1,
"tF": 114.9
}
}

shellypro1pm-8813bfda8058/status/switch:0